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.
- JSON Schema of every model, with the Forum's constraints or types only, attached to each release.
- 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, and every release carries the JSON Schema of each model. TypeScript and Go 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.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bbfmodels-0.5.0.tar.gz | 2.8 MB | With provenance | Details for bbfmodels-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bbfmodels-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for bbfmodels-0.5.0-py3-none-any.whl |
Total release size: 5.7 MB
Release files / bbfmodels-0.5.0.tar.gz
| Download URL | bbfmodels-0.5.0.tar.gz |
|---|---|
| Size | 2.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f3e745a8c397d54ab2cc172d312ed1e7e6b78ea34d66dee25b750fb4b0c5528
|
|
BLAKE2b-256 checksum How to use checksums |
65d3ec881e83c6789446eebbd1a6eac81a7011fd3925bea2fa1d61588ae77a7f
|
| 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 logRelease files / bbfmodels-0.5.0-py3-none-any.whl
| Download URL | bbfmodels-0.5.0-py3-none-any.whl |
|---|---|
| Size | 3.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fa145e1105faa31cb23de779768a8c81fed7718c57081e914206d2fc88c5e2c
|
|
BLAKE2b-256 checksum How to use checksums |
59febfaed48761928b9932ae7a906f70bc533418db84859d7eb80970ae22493f
|
| 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 logSecurity for bbfmodels 0.5.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.
Attestation for bbfmodels-0.5.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 logA 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.