Skip to content
DesignBuilderSoftwarePublic

About

Python package for DesignBuilder XML files with read / edit / write functionality

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

db-schema

Python License PyPI Tests

Python package for reading, editing, and writing DesignBuilder XML (dsbXML) files using Pydantic and pydantic-xml. It also ships DesignBuilder.xsd, the schema that defines the format.

Documentation: https://designbuildersoftware.github.io/db-schema/ (user guide, schema element reference, API reference).

Install

pip install dsbxml

Quick Start

from dsbxml import load_model, save_model

dsb = load_model("building.xml")
dsb.name = "Updated Building"
save_model(dsb, "building_updated.xml")

Features

  • Type-safe XML handling via Pydantic v2
  • Models for the whole dsbXML tree, including detailed HVAC
  • Load and save XML; validate against the bundled DesignBuilder.xsd (dsbxml.utils.validate_against_xsd)
  • Semantic diff of two models (dsbxml.diff_models)

See the user guide for worked examples (source in docs_src/guide/).

Data Model

dsbXML
└── Site
    ├── Attributes / Tables / AssemblyLibrary
    └── Buildings
        └── Building
            ├── BuildingBlocks
            │   └── BuildingBlock
            │       └── Zones
            │           └── Zone
            │               └── Body
            │                   └── Surfaces
            │                       └── Surface
            │                           └── Openings / Adjacencies
            └── HVACNetwork
                └── HVACLoops / HVACZoneGroups

Development

git clone https://github.com/DesignBuilderSoftware/db-schema
cd db-schema
uv sync --extra dev
uv run pytest                    # tests (about 8 minutes: they round-trip every sample model)
uv run ruff check dsbxml         # lint, as in CI
uv run pylint dsbxml
uv run mkdocs build --strict -d site   # docs, into an untracked folder

The docs sources are in docs_src/; the schema element reference page is generated from dsbxml/DesignBuilder.xsd at build time by scripts/docs_xsd_reference.py.

License

MIT — DesignBuilder, Bartłomiej Tokarzewski

About

Python package for DesignBuilder XML files with read / edit / write functionality

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages