bidsschematools.render.tables¶
Functions for rendering portions of the schema as text.
Functions
- bidsschematools.render.tables.make_columns_table(schema: Namespace, table_name: str, src_path: str | None = None, tablefmt: str = 'github')¶
Produce columns table (markdown) based on requested fields.
- Parameters:
schema (Namespace) – The BIDS schema.
table_name (str) – Qualified name in schema.rules.tabular_data. Only one table may be provided in this function.
src_path (str or None) – The file where this macro is called, which may be explicitly provided by the “page.file.src_path” variable.
tablefmt (string, optional) – The target table format. The default is “github” (GitHub format).
- Returns:
table_str – The tabulated table as a Markdown string.
- Return type:
- bidsschematools.render.tables.make_entity_table(schema, tablefmt='github', src_path=None, **kwargs)¶
Produce entity table (markdown) based on schema.
- Parameters:
schema (str) – Directory containing schema, which is stored in yaml files.
tablefmt (string, optional) – The target table format. The default is “github” (GitHub format).
src_path (str or None) – The file where this macro is called, which may be explicitly provided by the “page.file.src_path” variable.
- Returns:
table_str – Markdown string containing the table.
- Return type:
- bidsschematools.render.tables.make_metadata_table(schema, field_info, src_path=None, tablefmt='github')¶
Produce metadata table (markdown) based on requested fields.
- Parameters:
schema (Namespace) – The BIDS schema.
field_info (dict of strings or tuples) – A dictionary mapping metadata keys to requirement levels in the rendered metadata table. The dictionary values may be strings, in which case the string is the requirement level information, or two-item tuples of strings, in which case the first string is the requirement level information and the second string is additional table-specific information about the metadata field that will be appended to the field’s base definition from the schema.
src_path (str or None) – The file where this macro is called, which may be explicitly provided by the “page.file.src_path” variable.
tablefmt (string, optional) – The target table format. The default is “github” (GitHub format).
- Returns:
table_str – The tabulated table as a Markdown string.
- Return type:
- bidsschematools.render.tables.make_sidecar_table(schema: Namespace, table_name: str | List[str], src_path: str | None = None, tablefmt: str = 'github')¶
Produce metadata table (markdown) based on requested fields.
- Parameters:
schema (Namespace) – The BIDS schema.
table_name (str or list of str) – Qualified name(s) in schema.rules.sidecars
src_path (str or None) – The file where this macro is called, which may be explicitly provided by the “page.file.src_path” variable.
tablefmt (string, optional) – The target table format. The default is “github” (GitHub format).
- Returns:
table_str – The tabulated table as a Markdown string.
- Return type:
- bidsschematools.render.tables.make_subobject_table(schema: Namespace, object_name: str, src_path: str | None = None, tablefmt: str = 'github')¶
Create a metadata table (markdown) based on the properties of an object
- Parameters:
schema (Namespace) – The BIDS schema.
object_name (str) – Qualified name in schema.objects
src_path (str or None) – The file where this macro is called, which may be explicitly provided by the “page.file.src_path” variable.
tablefmt (string, optional) – The target table format. The default is “github” (GitHub format).
- Returns:
table_str – The tabulated table as a Markdown string.
- Return type:
- bidsschematools.render.tables.make_suffix_table(schema, suffixes, src_path=None, tablefmt='github')¶
Produce suffix table (markdown) based on requested suffixes.