biocypher.output.write._writer._Writer
- class biocypher.output.write._writer._Writer(translator: Translator, deduplicator: Deduplicator, output_directory: Optional[str] = None, strict_mode: bool = False, *args, **kwargs)
Abstract class for writing node and edge representations to disk. Specifics of the different writers (e.g. neo4j, postgresql, csv, etc.) are implemented in the child classes. Any concrete writer needs to implement at least: - _write_node_data - _write_edge_data - _construct_import_call - _get_import_script_name
- Parameters:
translator (Translator) – Instance of
Translator
to enable translation of nodes and manipulation of properties.deduplicator (Deduplicator) – Instance of
Deduplicator
to enable deduplication of nodes and edges.output_directory (str, optional) – Path for exporting CSV files. Defaults to None.
strict_mode (bool, optional) – Whether to enforce source, version, and license properties. Defaults to False.
strict_mode (bool, optional): Whether to enforce source, version, and license properties. Defaults to False.
- Raises:
NotImplementedError – Writer implementation must override ‘_write_node_data’
NotImplementedError – Writer implementation must override ‘_write_edge_data’
NotImplementedError – Writer implementation must override ‘_construct_import_call’
NotImplementedError – Writer implementation must override ‘_get_import_script_name’
- __init__(translator: Translator, deduplicator: Deduplicator, output_directory: Optional[str] = None, strict_mode: bool = False, *args, **kwargs)
Abstract class for writing node and edge representations to disk.
- Parameters:
translator (Translator) – Instance of
Translator
to enable translation of nodes and manipulation of properties.deduplicator (Deduplicator) – Instance of
Deduplicator
to enable deduplication of nodes and edges.output_directory (str, optional) – Path for exporting CSV files. Defaults to None.
strict_mode (bool, optional) – Whether to enforce source, version, and license properties. Defaults to False.
strict_mode (bool, optional): Whether to enforce source, version, and license properties. Defaults to False.
Methods
__init__
(translator, deduplicator[, ...])Abstract class for writing node and edge representations to disk.
write_edges
(edges[, batch_size, force])Wrapper for writing edges.
write_import_call
()Function to output.write the import call detailing folder and individual node and edge headers and data files, as well as delimiters and database name, to the export folder as txt.
write_nodes
(nodes[, batch_size, force])Wrapper for writing nodes.