BCF XML V3 handlers.

Module Contents

class bcf.v3.bcfxml.BcfXml(filename: pathlib.Path | None = None, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None)

BCF XML handler.

property documents: bcf.v3.document.DocumentsHandler | None

Documents stored in the BCF file.

property extensions: bcf.v3.model.Extensions | None

BCF extensions.

property project: bcf.v3.model.Project | None

BCF project.

property project_info: bcf.v3.model.ProjectInfo | None

BCF project information.

property topics: dict[str, bcf.v3.topic.TopicHandler]

BCF topics.

property version: bcf.v3.model.Version

Bcf Version.

add_comment(_topic: bcf.v3.model.Topic, _comment: bcf.v3.model.Comment | None = None) None

Deprecated method.

add_topic(title: str, description: str, author: str, topic_type: str = '', topic_status: str = '') bcf.v3.topic.TopicHandler

Add a new topic to the BCF.


title: The title of the topic. description: The description of the topic. author: The author of the topic. topic_type: The type of the topic. topic_status: The status of the topic.


The newly created topic wrapped inside a TopicHandler object.

close() None
classmethod create_new(project_name: str | None = None, extensions: bcf.v3.model.Extensions | None = None, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None) BcfXml

Create a new BcfXml object.


project_name: The name of the project. extensions: The Extension XML object. Defaults to an empty one. xml_handler: XML parser and serializer.


A new BcfXml object.

edit_comment() None

Deprecated method.

edit_project() None

Deprecated method.

edit_topic() None

Deprecated method.

edit_version() None

Deprecated method.

get_header(guid: str) bcf.v3.model.Header | None

Return the header of a Topic by its GUID.

get_project(_filepath: str | None = None) bcf.v3.model.Project | None

Deprecated method.

get_topic(guid: str) bcf.v3.topic.TopicHandler

Return a topic by its GUID.

get_topics() dict[str, bcf.v3.topic.TopicHandler]

Deprecated method.

get_version() str
classmethod load(filename: pathlib.Path, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None) BcfXml | None

Create a BcfXml object from a file.


filename: Path to the file. xml_handler: XML parser and serializer.


A BcfXml object with the file contents.


ValueError: If the file name is null or empty

new_project() BcfXml

Deprecated method.

save(filename: pathlib.Path | None = None, keep_open: bool = False) None

Save the BCF file to the given filename.

save_project(filepath: pathlib.Path) None

Deprecated method.