Skip to main content

📚 dbfread2

🚀 A modern Python library for reading DBF files with elegance and type safety

PyPI version Python 3.12+ License: MIT

dbfread2 is a modern, type-safe Python library for reading DBF files (dBase, Visual FoxPro, FoxBase+) with zero external dependencies.

✨ Highlights

  • 🐍 Modern Python 3.12+ implementation
  • 🔍 Comprehensive type hints
  • 🛠️ Simple yet powerful API
  • 📁 Native pathlib.Path support
  • 🔄 Streaming and memory-loaded modes
  • 📝 Support for all major DBF variants
  • 📋 18 field types with extensible FieldParser
  • 📎 Reads FPT and DBT memo files
  • 🔒 Type-safe operations

🚀 Quick Start

from dbfread2 import DBF

# Stream records (memory-efficient)
for record in DBF('people.dbf'):
    print(record)
# {'NAME': 'Alice', 'BIRTHDATE': datetime.date(1987, 3, 1)}
# {'NAME': 'Bob', 'BIRTHDATE': datetime.date(1980, 11, 12)}

# Load all records into memory
table = DBF('people.dbf', load=True)
print(table.records[0]['NAME'])  # Returns: 'Alice'

📦 Installation

pip install dbfread2

🔄 Migration from dbfread

Key Changes

  1. Python Version

    • ✅ Python 3.12+ required
    • ❌ No support for older versions
  2. Import Updates

    # Before ❌
    from dbfread import DBF
    # After ✅
    from dbfread2 import DBF
    
  3. Modern Parameter Names

    # Before ❌
    DBF('file.dbf', recfactory=dict, lowernames=True)
    # After ✅
    DBF('file.dbf', record_factory=dict, lowercase_names=True)
    
  4. Path Support

    # ✨ New Feature
    from pathlib import Path
    DBF(Path('data/file.dbf'))
    

🛠️ Development

Setup

  1. Install Tools

  2. Clone & Setup

    git clone https://github.com/wasdee/dbfread2.git
    cd dbfread2
    mise install
    uv pip install -e ".[docs]"
    

📚 Documentation

mise run docs:build    # Build docs
mise run docs:serve    # Serve locally
mise run docs:watch    # Watch mode
mise run docs:check    # Check for issues

✅ Code Quality

  • 🧹 ruff - Linting & formatting
  • 🔍 mypy - Static type checking

📄 License

MIT License

🙏 Credits

Fork of dbfread by Ole Martin Bjørndalen

📬 Contact

Nutchanon Ninyawee - me@nutchanon.org


⭐️ If this project helps you, consider giving it a star!

Metadata

Release files for dbfread2 0.1.0

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

Source distribution (sdist)

Source distribution for dbfread2 0.1.0
File Size Uploaded Provenance
dbfread2-0.1.0.tar.gz 46.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dbfread2 0.1.0
File Interpreter ABI Platform
dbfread2-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.5 kB

Release files / dbfread2-0.1.0.tar.gz

Download URL dbfread2-0.1.0.tar.gz
Size 46.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c0c0c428085a9449bc091863563c3ff4742f15e248097ab2364e7f2f8a66e66c
BLAKE2b-256 checksum
How to use checksums
a92dfece2942e2fe97936fd5ede5c20070ff507ee2c52da21ba86ba4eeafaba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Release files / dbfread2-0.1.0-py3-none-any.whl

Download URL dbfread2-0.1.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5a42675052ef3e3b4d0f52736942008e8c290471722331b1ab14886636c1cfb
BLAKE2b-256 checksum
How to use checksums
9ca08bf7fdc48f0fb150a8dccfff31186b21cc0348cbed481bd8b9f9bcea006d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.4

Security for dbfread2 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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