Skip to main content

omnisus-dbf

Optional DBF → Arrow reader and DBC decompressor for omnisus. omnisus installs it from PyPI on Linux x86_64, macOS and Windows x86_64 (uv pip install omnisus); installing a wheel does not require Rust. Elsewhere, or with OMNISUS_DBF_BACKEND=python and OMNISUS_DBC_BACKEND=python, omnisus decodes in Python.

To build a wheel from a checkout of the repository (needs Rust):

uv build native/omnisus-dbf --wheel --out-dir dist/native -C build-args=--locked
uv pip install dist/native/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
uv run 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. A dbf-v<version> tag publishes the tested wheels and sdist to PyPI (RELEASE.md). Building an sdist requires Rust; installing a supported wheel does not.

Metadata

Release files for omnisus-dbf 0.2.1

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

Source distribution (sdist)

Source distribution for omnisus-dbf 0.2.1
File Size Uploaded
omnisus_dbf-0.2.1.tar.gz 26.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for omnisus-dbf 0.2.1
File
omnisus_dbf-0.2.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
omnisus_dbf-0.2.1-cp312-abi3-manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64 Details
omnisus_dbf-0.2.1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
omnisus_dbf-0.2.1-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.1.tar.gz

Download URL omnisus_dbf-0.2.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c41b9b1e29f8d94c535ea65d1a206e93d441d0b6d247f58b894e02c59a39b556
BLAKE2b-256 checksum
How to use checksums
12508c31174ad9fc916ab2d268ac5e0a13d38f3abe5c32ef689b61877137b711
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

Release files / omnisus_dbf-0.2.1-cp312-abi3-win_amd64.whl

Download URL omnisus_dbf-0.2.1-cp312-abi3-win_amd64.whl
Size 268.0 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4f220efc896b4bd1a662eeb3e05b3067d66214bd15680f762e499734e12abe23
BLAKE2b-256 checksum
How to use checksums
29cd670efb85d186e534996f4e13801b6c3f9559bbbba1ef3e1d3b1274694e8b
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

Release files / omnisus_dbf-0.2.1-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL omnisus_dbf-0.2.1-cp312-abi3-manylinux_2_28_x86_64.whl
Size 403.2 kB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
562b9bd379fd574d27b077a3014d0b5de41008b83cf580ec4526b478e34630bb
BLAKE2b-256 checksum
How to use checksums
99fb409892a99f81b96bf6893ba73bd28117b1271081ef771c50aea4dd310077
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

Release files / omnisus_dbf-0.2.1-cp312-abi3-macosx_11_0_arm64.whl

Download URL omnisus_dbf-0.2.1-cp312-abi3-macosx_11_0_arm64.whl
Size 358.0 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
399ed515b00b0ae99a398242cdbda27afb9c1ca971e576011d7383ddd477f7f3
BLAKE2b-256 checksum
How to use checksums
df2d13fbc367e0a29ad3ccd2820e2d34066430c03032d2c3d814bc136b38d0d3
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

Release files / omnisus_dbf-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl

Download URL omnisus_dbf-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl
Size 369.5 kB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a580b6711f15788fffa7b41bde68ffba6e7d424b95332e62a3aa7440ec5aea26
BLAKE2b-256 checksum
How to use checksums
8b951b4df88a736eaf5297b67fe0e79795b03b8c6db2e159c2d36480cfd1ae9c
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

Release history Release notifications | RSS feed

This release

0.2.1 This release

5 release files

0.2.0

5 release files

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