catalog_api
trestle.core.catalog.catalog_api
¤
Main entrypoint to interact with catalog in memory.
Attributes¤
logger = logging.getLogger(__name__)
module-attribute
¤
Classes¤
CatalogAPI
¤
Main entrypoint to interact with catalog in memory.
Encapsulates all necessary functionality to manipulate, read and write the catalog and its markdown representation.
Source code in trestle/core/catalog/catalog_api.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
Functions¤
__init__(catalog, context=None)
¤
Initialize catalog api.
Source code in trestle/core/catalog/catalog_api.py
42 43 44 45 46 47 48 49 50 51 52 53 |
|
merge_catalog(catalog, replace_params)
¤
Merge one catalog into another.
Source code in trestle/core/catalog/catalog_api.py
114 115 116 |
|
read_additional_content_from_md(label_as_key=False)
¤
Read additional content from markdown.
Source code in trestle/core/catalog/catalog_api.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
read_catalog_from_markdown(markdown_dir, is_set_parameters)
¤
Read catalog from markdown.
Source code in trestle/core/catalog/catalog_api.py
89 90 91 92 93 94 95 96 |
|
update_context(context)
¤
Update current context.
Source code in trestle/core/catalog/catalog_api.py
55 56 57 58 59 |
|
write_catalog_as_markdown(label_as_key=False)
¤
Write out the catalog controls from dict as markdown files to the specified directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
label_as_key
|
bool
|
Whether to use label_as_key for part_id to label map |
False
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in trestle/core/catalog/catalog_api.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
Functions¤
handler: python