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, the generated Python models with USP commands and events, and typed paths are in place. 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.4.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.4.0
File Size Uploaded Provenance Actions
bbfmodels-0.4.0.tar.gz 2.8 MB With provenance Details for bbfmodels-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 5.7 MB

Release files / bbfmodels-0.4.0.tar.gz

Download URL bbfmodels-0.4.0.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
12e39d33ee620bcb35b3a659504652bd97ac963da82b069744874ad06b660365
BLAKE2b-256 checksum
How to use checksums
e906d2a4ed5be774d80a952166c67ed2a9ad27f2e6a623323595218461bd77cc
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.4.0-py3-none-any.whl

Download URL bbfmodels-0.4.0-py3-none-any.whl
Size 3.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
09353c8b55c67500093780157637ff9b504268e90d81dcb80a6865aed0facbfe
BLAKE2b-256 checksum
How to use checksums
457a411d57675d6ed559ed38f4f5650bf76d14f81d7931941889204d5ab133f8
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.4.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.4.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