dbfpy3
Pure Python 3 library for reading and writing DBF (dBase/FoxPro) database files. No external dependencies required.
✨ Features
- Pure Python - No C extensions or external dependencies
- FoxPro Support - Full support for FoxPro DBF files and memo fields (.FPT)
- Code Page Support - Proper character encoding for international data
- Context Manager - Safe resource management with
withstatements - Python 3.5+ - Modern Python support
🚀 Quick Start
Installation
pip install dbfpy3
Basic Usage
from dbfpy3 import dbf
# Read existing DBF file
with dbf.Dbf('customers.dbf') as db:
for record in db:
print(record['NAME'], record['EMAIL'])
# Create new DBF file
db = dbf.Dbf('new_file.dbf', new=True)
db.add_field(
('C', 'NAME', 30), # Character field, max 30 chars
('D', 'BIRTHDATE'), # Date field
('N', 'SALARY', 10, 2), # Numeric field, 10 digits, 2 decimal places
('L', 'ACTIVE') # Logical field (True/False)
)
# Add records
rec = db.new()
rec['NAME'] = 'John Doe'
rec['BIRTHDATE'] = datetime.date(1990, 1, 15)
rec['SALARY'] = 75000.50
rec['ACTIVE'] = True
db.write(rec)
db.close()
📖 Documentation
- Quick Start Guide - Get up and running quickly
- API Documentation - Complete API reference
- Examples - Sample code and use cases
- Contributing - How to contribute
🧪 Development
# Clone repository
git clone https://github.com/frankyxhl/dbfpy3.git
cd dbfpy3
# Install development dependencies
pip install -r requirements_dev.txt
# Run tests
python -m unittest discover tests
make test
# Run specific test module
python -m unittest tests.test_fields
# Check code style
make lint
⚠️ Important Notes
- Field Names: Limited to 10 characters per DBF specification
- Unicode Support: DBF files use code pages for character encoding
- Production Use: While functional, use with caution in production environments
📄 License
This project is licensed under the BSD License - see the LICENSE file for details.
🙏 Credits
- Original Author: Jeff Kunce
- Python 3 Port: Frank Xu
- Contributors: Hans Fiby, Zdeněk Böhm, and many others
🔗 Links
======= History
0.1.0 (2020-12-26)
- First release on PyPI.
Metadata
Release files for dbfpy3 4.2.3
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 |
|---|---|---|---|---|
| dbfpy3-4.2.3.tar.gz | 27.2 kB | Without provenance | Details for dbfpy3-4.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dbfpy3-4.2.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for dbfpy3-4.2.3-py2.py3-none-any.whl |
Total release size: 49.1 kB
Release files / dbfpy3-4.2.3.tar.gz
| Download URL | dbfpy3-4.2.3.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25c2033c9c909911542e8421a039ee7b049e7fa90ce73b23a2035c1cfd43eff4
|
|
BLAKE2b-256 checksum How to use checksums |
bf0f6fa5f0898fb000a4331a333cf0bed385135d8f33324a71e9b21f266cc181
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / dbfpy3-4.2.3-py2.py3-none-any.whl
| Download URL | dbfpy3-4.2.3-py2.py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6b273649643542ba0f60d0e14fdc8d675580f3675e7d1663d861fc99d675cd78
|
|
BLAKE2b-256 checksum How to use checksums |
2573c85bd126149d44a43dbf8ff48b42f1177817436ceadb76a4c9f8a925291f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for dbfpy3 4.2.3
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.