dbfrs
Minimalist DBF reader and writer for Python 3 written in Rust. The state of DBF libraries in 2024 is abysmal, yet still companies rely on this format. This library aims to provide a simple, easy-to-use interface for reading and writing DBF files.
Most libraries are either outdated, have a lot of dependencies, are too complex, or a really slow.
Most of them offer only reading capabilities. The main focus of dbfrs is to be minimalistic and fast.
Installation
pip install dbfrs
Usage
Reading a file
import dbfrs
import pandas as pd
filename = 'file.dbf'
records = dbfrs.load_dbf(filename)
Reading a file into a DataFrame, only loading specific fields
import dbfrs
import pandas as pd
filename = 'file.dbf'
fields = dbfrs.get_dbf_fields(filename)
records = dbfrs.load_dbf(filename, fields)
df = pd.DataFrame(records, columns=fields)
Writing a DataFrame to a file
import dbfrs
import pandas as pd
filename = 'file.dbf'
df = pd.DataFrame({'field1': [1, 2, 3], 'field2': ['a', 'b', 'c']})
fields = dbfrs.Fields()
fields.add_numeric_field('field1', 'N', 10, 0)
fields.add_character_field('field2', 'C')
records = [tuple(x) for x in df.values.tolist()]
dbfrs.write_dbf(filename, fields, records)
Development
Building the Rust library
maturin build
Publish a new version
maturin publish
Metadata
Release files for dbfrs 0.1.5
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 |
|---|---|---|---|---|
| dbfrs-0.1.5.tar.gz | 8.2 kB | Without provenance | Details for dbfrs-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dbfrs-0.1.5-cp310-abi3-manylinux_2_34_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ x86-64 | Details for dbfrs-0.1.5-cp310-abi3-manylinux_2_34_x86_64.whl |
Total release size: 416.2 kB
Release files / dbfrs-0.1.5.tar.gz
| Download URL | dbfrs-0.1.5.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c538b069a470600113b35a14b0206dc2321919b6a52cf821efcdb24af46f79d
|
|
BLAKE2b-256 checksum How to use checksums |
c9f2e35377210ccba2cd81e59da98a5deb8361c0d56bfbbccbe17f8bc10d18dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.1
|
Release files / dbfrs-0.1.5-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | dbfrs-0.1.5-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 408.0 kB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ad7f57e175e59439dc228d1ca55a0c14d3846d7afbf659599684cb4cf5d9a0d7
|
|
BLAKE2b-256 checksum How to use checksums |
cd19b2aefbb20519f35dc81b151c77a70612311b339b3d0bf03303fd32487fd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.1
|
Security for dbfrs 0.1.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.