bcf.v2.bcfxml

BCF XML V2 handler.

Module Contents

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

BCF XML handler.

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

Deprecated method.

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

Add a new topic to the BCF.

Args:

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.

Returns:

The newly created topic wrapped inside a TopicHandler object.

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

Create a new BcfXml object.

Args:

project_name: The name of the project. xml_handler: XML parser and serializer.

Returns:

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.v2.model.Header | None

Return the header of a Topic by its GUID.

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

Deprecated method.

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

Return a topic by its GUID.

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

Deprecated method.

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

Create a BcfXml object from a file.

Args:

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

Returns:

A BcfXml object with the file contents.

Raises:

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.

property extension_schema: bytes | None
property extensions: bcf.v2.model.extensions.Extensions | None

BCF extensions.

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

BCF project.

property project_info: bcf.v2.model.ProjectExtension | None

BCF project information.

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

BCF topics.

property version: bcf.v2.model.Version

Bcf Version.

bcf.v2.bcfxml.T