Registry / data / agate-dbf

agate-dbf

JSON →
library0.2.4pypypi✓ verified 85d ago

agate-dbf is a Python library that extends the `agate` data analysis library by adding robust read support for DBF (database file) files. It is currently at version 0.2.4. The library maintains an active development status, primarily releasing updates to ensure compatibility with newer Python versions.

pip install agate-dbf
INSTALL
IMPORT
SIG · AGATE-DBF
A
agate-dbf
datapythonv0.2.4
Install
2.5s avg
Import
433ms
Disk
52MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.464s · 53.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.5s · import 0.402s · 54MB
52MB installed
● package 52MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

agate
import agate
Required for `agate.Table` functionality.
agatedbf
import agatedbf
Importing `agatedbf` enables the `from_dbf` method on `agate.Table`.

This quickstart demonstrates how to load a DBF file into an `agate.Table` using the `from_dbf` method. Ensure you have a `.dbf` file available; a simple way to create one for testing is provided in the comments.

import agate import agatedbf import os # Create a dummy .dbf file for demonstration purposes # In a real scenario, you would already have a .dbf file. # For local testing, you might use a library like `dbf` or create one manually. # Example: (requires `pip install dbf`) # import dbf # db = dbf.Table('test.dbf', 'name C(15); age N(3,0)') # db.open() # db.append({'name': 'Alice', 'age': 30}) # db.append({'name': 'Bob', 'age': 24}) # db.close() # Ensure a dummy dbf file exists for this example to run. # We'll simulate this by checking for a non-existent file path # or asking the user to create one. dbf_path = 'test.dbf' if not os.path.exists(dbf_path): print(f"Please create a dummy DBF file named '{dbf_path}' with some data.") print("You can use `dbf` library for this (pip install dbf) or any other DBF creator.") print("Example: `db = dbf.Table('test.dbf', 'name C(15); age N(3,0)'); db.open(); db.append({'name': 'Alice', 'age': 30}); db.close()`") else: table = agate.Table.from_dbf(dbf_path) print("Table loaded successfully:") table.print_structure() table.print_table(max_rows=5)
Debug
Known issues
gotcha`agate.Table.from_dbf()` specifically requires a file *path* string as an argument. It cannot accept an open file handle (e.g., from `open()`) due to limitations of its underlying `dbfread` dependency.
fix
Always pass the string path to the DBF file, not a file object.
affects: All versions
breakingAs of version 0.2.2 (July 2020), `agate-dbf` no longer automatically lowercases column names when importing from DBF files.
fix
Update your code to expect column names as they appear in the DBF file (case-preserved). If lowercase names are needed, apply `.columns.lower()` manually after loading.
affects: 0.2.2 and later
breakingVersion 0.2.0 (December 2016) introduced significant internal changes, removing a monkeypatching dependency and requiring `agate` version 1.5.0 or higher. Older code relying on previous internal mechanisms or `agate` versions before 1.5.0 will break.
fix
Upgrade `agate` to at least 1.5.0 and review usage if upgrading from versions prior to 0.2.0.
affects: 0.2.0 and later
breakingSupport for older Python versions is routinely dropped to align with Python's end-of-life schedule. For example, version 0.2.4 dropped support for Python 3.8 and 3.9 (December 2025), and 0.2.3 dropped support for Python 3.7 and earlier (February 2024).
fix
Ensure your Python environment meets the minimum requirement specified in the `pyproject.toml` or `agate-dbf`'s documentation (currently `>=3.10`). Upgrade Python or pin `agate-dbf` to an older version compatible with your environment.
affects: 0.2.3 and later
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'agate-dbf'
The 'agate-dbf' package is not installed in the Python environment.
fix
Install the package using pip: 'pip install agate-dbf'.
ImportError: cannot import name 'from_dbf' from 'agate'
The 'from_dbf' method is not part of the 'agate' module; it is provided by the 'agate-dbf' extension.
fix
Ensure 'agate-dbf' is installed and import it alongside 'agate': 'import agate; import agatedbf'.
AttributeError: module 'agate' has no attribute 'from_dbf'
The 'from_dbf' method is not an attribute of the 'agate' module; it is added by the 'agate-dbf' extension.
fix
Import 'agate-dbf' to add 'from_dbf' support: 'import agate; import agatedbf'.
TypeError: from_dbf() missing 1 required positional argument: 'path'
The 'from_dbf' method requires a file path argument to specify the DBF file to read.
fix
Provide the path to the DBF file when calling 'from_dbf': 'table = agate.Table.from_dbf('path/to/file.dbf')'.
ValueError: Unsupported DBF file encoding
The DBF file uses an encoding that is not supported or recognized.
fix
Specify the correct encoding when calling 'from_dbf': 'table = agate.Table.from_dbf('file.dbf', encoding='utf-8')'.
Upgrade
Version history
0.2.4latest on PyPI · released Dec 15, 2025
Audit
Dependencies
agaterequiredCore data analysis library extended by agate-dbf.
dbfreadrequiredUnderlying library used for parsing DBF files.
isodaterequiredUsed for parsing ISO 8601 formatted dates and times within DBF files.
Agent activity
49 hits · last 30 days
node
40
OpenAI (training)
1
Resources
agate-dbf — pip install agate-dbf · libregistry