Skip to main content

bbfmodels

Typed models and schema tooling for Broadband Forum data models (TR-181, TR-098, TR-104 and the rest), generated from the XML the Forum publishes.

The Forum defines what a broadband gateway exposes to its management system as XML in the TR-106 schema: thousands of objects and parameters, their types, ranges, enumerations, writability and multi-instance tables. Everyone who builds against those models, an ACS, a USP controller, a device simulator, an integration script, re-derives the same facts from the same XML and hand-types the same parameter paths as strings. bbfmodels does it once:

  • A parser that reads the published XML into a normalised intermediate representation, published as JSON with its own schema.
  • A Python runtime that works from that representation: resolve a path, validate a value against the model's constraints, convert between the flat path and value lists that CWMP and USP carry on the wire and a typed tree.
  • Generated typed bindings: pydantic models for Python, shipped for TR-181 and TR-098 and the service models (TR-104 voice, TR-135 set-top box, TR-140 storage, TR-196 femtocell, TR-517 Matter), and generated on demand for any other document, a vendor's included.
  • Typed paths for code that only needs correct path strings: str(Device.WiFi.SSID[1].SSID) with autocomplete over the whole model and the parameter's definition one attribute away. JSON Schema and TypeScript follow from the same representation, Go when there is a consumer.

Names stay as the Forum wrote them. Device.WiFi.SSID.{i}.SSID is a table of SSID entries indexed by instance number, and the attribute is SSID, not ssid.

Install

pip install bbfmodels

Python 3.11 or later. The one runtime dependency is pydantic.

Status

Early. The parser, the intermediate representation, the runtime and the generated Python models are in place. Commands and events in the generated models, JSON Schema and TypeScript come next. Before 1.0 a minor release may change the IR and the runtime API.

from bbfmodels.tr181_cwmp import Device

device = Device.from_flat(values_from_the_device)
radio = device.WiFi.Radio[1]
radio.Channel  # 36, an int
radio.Enable  # True
device.problems()  # every value outside the model's constraints
device.flatten()  # back to path and text pairs

The design decisions behind the code are in context/decisions/, indexed in context/README.md. Read them before changing the parser or the IR.

Development

Prerequisites: git and uv. The pinned Python is installed by uv.

scripts/bootstrap.sh
make test
make lint

make help lists the rest. Documentation is built from docs/ with make docs and published at https://docs.bbfmodels.ispx.co/.

Licence

Apache-2.0, copyright ISPX LIMITED. The Broadband Forum publishes its data models under the BSD 3-clause licence; output derived from them carries the Forum's notice.

Metadata

Release files for bbfmodels 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bbfmodels 0.3.0
File Size Uploaded Provenance Actions
bbfmodels-0.3.0.tar.gz 2.6 MB With provenance Details for bbfmodels-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bbfmodels 0.3.0
File Interpreter ABI Platform Actions
bbfmodels-0.3.0-py3-none-any.whl Python 3 none any Details for bbfmodels-0.3.0-py3-none-any.whl

Total release size: 5.5 MB

Release files / bbfmodels-0.3.0.tar.gz

Download URL bbfmodels-0.3.0.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
f690239768268b0353303bf0a6dc76e1bd126939bfef24b4d8702cb2a003764c
BLAKE2b-256 checksum
How to use checksums
ba80f43ae19cee676118a168e0b61e641a994cde6868054c652e4f32e9c96227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / bbfmodels-0.3.0-py3-none-any.whl

Download URL bbfmodels-0.3.0-py3-none-any.whl
Size 2.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
453d2f6934eb42c9ba05206f5e6d254411fd3137cb713087dc799c317d9209b3
BLAKE2b-256 checksum
How to use checksums
499cc21bff4cdf52bffffa6a236d215091a561ba8bc50bc0743ea10c559e28c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for bbfmodels 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bbfmodels-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page