omnisus-dbf
Optional DBF → Arrow reader and DBC decompressor for omnisus.
The main package keeps its Python build backend and does not require Rust.
This package is not on PyPI. Each omnisus release attaches its wheels (see the
main README), or build one locally:
python -m pip install maturin==1.12.6
maturin build --release --locked --manifest-path native/omnisus-dbf/Cargo.toml
python -m pip install native/omnisus-dbf/target/wheels/omnisus_dbf-*.whl
from omnisus_dbf import open_reader
reader = open_reader(dbf_bytes, encoding="latin-1", batch_rows=100_000)
try:
for batch in reader:
consume(batch)
finally:
reader.close()
from omnisus_dbf import decompress_dbc
dbf_bytes = decompress_dbc(dbc_bytes) # raises InvalidDbcError on bad input
decompress_dbc releases the GIL and returns the same bytes as the pure-Python
decoder in omnisus.sources.datasus_ftp.dbc. Both reject a declared DBF
header shorter than 33 bytes with the same message.
The reader owns a copy of the input bytes. Parsing and Arrow builders release the
GIL; the official arrow-pyarrow bridge exports each batch with owned buffers.
Returned batches remain valid after close() or reader destruction. Closing is
idempotent, as is exhaustion. A decoding or conversion error closes the reader.
No Python object is created per record.
API version 2 supports DBF versions 0x03 and 0x30, C/N fields, and strict latin-1, cp1252, ASCII and UTF-8. Python codec aliases are resolved at open. Character padding strips only trailing spaces and NUL bytes. Numeric fields attempt exact int64 before float64, accept Python numeric underscores and decimal comma, and preserve null-only batches as Arrow null. Integer overflow and mixed integer / float families fail; the Python staging layer reconciles schemas across batches. Deleted records do not appear in output. The SIA ABO FoxPro extension header is skipped after the first real descriptor terminator. Missing descriptor repair is the responsibility of the shared Python integrity layer before opening a reader.
UnsupportedDbfError identifies unsupported formats during synchronous preflight
only. Corruption raises InvalidDbfError; content errors retain ValueError,
TypeError, or UnicodeDecodeError categories. Automatic backend fallback belongs
to the main package and is only allowed before iteration begins.
API version 2 adds decompress_dbc.
Reproducible development
Versions were checked against upstream Cargo metadata: arrow-pyarrow 59.2.0 requires PyO3 0.29 and Arrow 59.2; both are pinned exactly. Cargo.lock also pins transitive dependencies (including arrow-buffer 59.3.0). Upstream Arrow declares minimum Rust 1.85 and PyO3 declares 1.83. This package declares and tests Rust 1.98.1, including its transitive lockfile; a lower minimum has not been validated. Maturin 1.12.6 is pinned in the isolated build backend.
Sources: Arrow bridge, PyO3, and Maturin mixed layout.
cargo test --locked --manifest-path native/omnisus-dbf/Cargo.toml
cargo clippy --locked --all-targets --manifest-path native/omnisus-dbf/Cargo.toml -- -D warnings
cargo fmt --manifest-path native/omnisus-dbf/Cargo.toml -- --check
python -m pytest native/omnisus-dbf/tests/test_bindings.py
Default Cargo features enable Python linking for Rust tests. extension-module
is enabled only by Maturin, avoiding Python symbol linker conflicts in tests.
Use --no-default-features for pure Rust checks and fuzzing without Python.
Wheels use the stable ABI (abi3, CPython 3.12 and later) on Linux x86_64, Windows
x86_64 and macOS arm64/x86_64. Free-threaded CPython is not supported.
The package version has one source, Cargo.toml; API_VERSION is independent.
Future native release tags use dbf-v*. Build/test wheels and sdist first, then
publish those same artifacts only through a separately authorized release.
Do not add a root-package dependency extra until the native version exists in
the package index. Building an sdist requires Rust; installing a supported wheel
does not.
Metadata
Release files for omnisus-dbf 0.2.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 | |
|---|---|---|---|
| omnisus_dbf-0.2.0.tar.gz | 26.5 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| omnisus_dbf-0.2.0-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| omnisus_dbf-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| omnisus_dbf-0.2.0-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
| omnisus_dbf-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl | CPython 3.12 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 1.4 MB
Release files / omnisus_dbf-0.2.0.tar.gz
| Download URL | omnisus_dbf-0.2.0.tar.gz |
|---|---|
| Size | 26.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
007b98de13a3fa7162d15f4dbfd6438c6170d9d855837db81285457b642168eb
|
|
BLAKE2b-256 checksum How to use checksums |
0408c3a84fbcf94ab08ff821e265c5353476928b9a48e10dbd490bac8e09dc8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency logRelease files / omnisus_dbf-0.2.0-cp312-abi3-win_amd64.whl
| Download URL | omnisus_dbf-0.2.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 267.8 kB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f0993a33f9029197f5b28cbc421a593b141985164ff2f30eea6f1843b33f4521
|
|
BLAKE2b-256 checksum How to use checksums |
4168d8b9467b516aa90207426c1872ed4f8cf286dca1e783350153abb670c34e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency logRelease files / omnisus_dbf-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | omnisus_dbf-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 403.1 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ab2f409c0321097788c54796569684bddf5423b08a3497f9b21dada809bb6c10
|
|
BLAKE2b-256 checksum How to use checksums |
f24ba9e4e0af31738207191913bb661c0348a653f22f89159508cf610ee2b895
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency logRelease files / omnisus_dbf-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | omnisus_dbf-0.2.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 357.9 kB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
75fa1b71d58e04014b67aa16e0d7a554bc25f8dbbc5c84b19d3b800436e0c81e
|
|
BLAKE2b-256 checksum How to use checksums |
7c6c1337bd085f152f1011ed8d6bc2c832b05915781cf5cf5316d1d23f739330
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency logRelease files / omnisus_dbf-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | omnisus_dbf-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 369.4 kB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
087c69290c595c6adbbed934db98faf0347ed20855090dc3685de5af5d907633
|
|
BLAKE2b-256 checksum How to use checksums |
673a394ae0b1621a2ee5a47073f0bc4990c8c82bed6875ca8409f628d27ec76a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency log