# dbfpy3
[](https://pypi.org/project/dbfpy3/)
[](https://pypi.org/project/dbfpy3/)
[](https://pypi.org/project/dbfpy3/)
[](https://github.com/frankyxhl/dbfpy3/actions)
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 `with` statements
- **Python 3.5+** - Modern Python support
## ๐ Quick Start
### Installation
```bash
pip install dbfpy3
```
### Basic Usage
```python
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](docs/usage.rst) - Get up and running quickly
- [API Documentation](docs/index.rst) - Complete API reference
- [Examples](examples/) - Sample code and use cases
- [Contributing](CONTRIBUTING.rst) - How to contribute
## ๐งช Development
```bash
# 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](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
- [PyPI Package](https://pypi.org/project/dbfpy3/)
- [GitHub Repository](https://github.com/frankyxhl/dbfpy3)
- [Documentation](docs/index.rst)
- [Changelog](HISTORY.rst)
=======
History
=======
0.1.0 (2020-12-26)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/frankyxhl/dbfpy3",
"name": "dbfpy3",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": null,
"keywords": "dbfpy3",
"author": "Frank Xu",
"author_email": "franky.xhl@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/bf/0f/6fa5f0898fb000a4331a333cf0bed385135d8f33324a71e9b21f266cc181/dbfpy3-4.2.3.tar.gz",
"platform": null,
"description": "# dbfpy3\n\n[](https://pypi.org/project/dbfpy3/)\n[](https://pypi.org/project/dbfpy3/)\n[](https://pypi.org/project/dbfpy3/)\n[](https://github.com/frankyxhl/dbfpy3/actions)\n\nPure Python 3 library for reading and writing DBF (dBase/FoxPro) database files. No external dependencies required.\n\n## \u2728 Features\n\n- **Pure Python** - No C extensions or external dependencies\n- **FoxPro Support** - Full support for FoxPro DBF files and memo fields (.FPT)\n- **Code Page Support** - Proper character encoding for international data\n- **Context Manager** - Safe resource management with `with` statements\n- **Python 3.5+** - Modern Python support\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install dbfpy3\n```\n\n### Basic Usage\n\n```python\nfrom dbfpy3 import dbf\n\n# Read existing DBF file\nwith dbf.Dbf('customers.dbf') as db:\n for record in db:\n print(record['NAME'], record['EMAIL'])\n\n# Create new DBF file\ndb = dbf.Dbf('new_file.dbf', new=True)\ndb.add_field(\n ('C', 'NAME', 30), # Character field, max 30 chars\n ('D', 'BIRTHDATE'), # Date field\n ('N', 'SALARY', 10, 2), # Numeric field, 10 digits, 2 decimal places\n ('L', 'ACTIVE') # Logical field (True/False)\n)\n\n# Add records\nrec = db.new()\nrec['NAME'] = 'John Doe'\nrec['BIRTHDATE'] = datetime.date(1990, 1, 15)\nrec['SALARY'] = 75000.50\nrec['ACTIVE'] = True\ndb.write(rec)\ndb.close()\n```\n\n## \ud83d\udcd6 Documentation\n\n- [Quick Start Guide](docs/usage.rst) - Get up and running quickly\n- [API Documentation](docs/index.rst) - Complete API reference\n- [Examples](examples/) - Sample code and use cases\n- [Contributing](CONTRIBUTING.rst) - How to contribute\n\n## \ud83e\uddea Development\n\n```bash\n# Clone repository\ngit clone https://github.com/frankyxhl/dbfpy3.git\ncd dbfpy3\n\n# Install development dependencies\npip install -r requirements_dev.txt\n\n# Run tests\npython -m unittest discover tests\nmake test\n\n# Run specific test module\npython -m unittest tests.test_fields\n\n# Check code style\nmake lint\n```\n\n## \u26a0\ufe0f Important Notes\n\n- **Field Names**: Limited to 10 characters per DBF specification\n- **Unicode Support**: DBF files use code pages for character encoding\n- **Production Use**: While functional, use with caution in production environments\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the BSD License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Credits\n\n- **Original Author**: Jeff Kunce\n- **Python 3 Port**: Frank Xu\n- **Contributors**: Hans Fiby, Zden\u011bk B\u00f6hm, and many others\n\n## \ud83d\udd17 Links\n\n- [PyPI Package](https://pypi.org/project/dbfpy3/)\n- [GitHub Repository](https://github.com/frankyxhl/dbfpy3)\n- [Documentation](docs/index.rst)\n- [Changelog](HISTORY.rst)\n\n=======\nHistory\n=======\n\n0.1.0 (2020-12-26)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Port to Python 3. Dbfpy is a python-only module for reading and writing DBF-files.",
"version": "4.2.3",
"project_urls": {
"Homepage": "https://github.com/frankyxhl/dbfpy3"
},
"split_keywords": [
"dbfpy3"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2573c85bd126149d44a43dbf8ff48b42f1177817436ceadb76a4c9f8a925291f",
"md5": "c5c855bc7bb0f5d8073d3e690ca2cb82",
"sha256": "6b273649643542ba0f60d0e14fdc8d675580f3675e7d1663d861fc99d675cd78"
},
"downloads": -1,
"filename": "dbfpy3-4.2.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c5c855bc7bb0f5d8073d3e690ca2cb82",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.5",
"size": 21844,
"upload_time": "2025-08-30T15:07:04",
"upload_time_iso_8601": "2025-08-30T15:07:04.706895Z",
"url": "https://files.pythonhosted.org/packages/25/73/c85bd126149d44a43dbf8ff48b42f1177817436ceadb76a4c9f8a925291f/dbfpy3-4.2.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bf0f6fa5f0898fb000a4331a333cf0bed385135d8f33324a71e9b21f266cc181",
"md5": "a737911e54d63eb2dddb2c535da26774",
"sha256": "25c2033c9c909911542e8421a039ee7b049e7fa90ce73b23a2035c1cfd43eff4"
},
"downloads": -1,
"filename": "dbfpy3-4.2.3.tar.gz",
"has_sig": false,
"md5_digest": "a737911e54d63eb2dddb2c535da26774",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 27210,
"upload_time": "2025-08-30T15:07:05",
"upload_time_iso_8601": "2025-08-30T15:07:05.899079Z",
"url": "https://files.pythonhosted.org/packages/bf/0f/6fa5f0898fb000a4331a333cf0bed385135d8f33324a71e9b21f266cc181/dbfpy3-4.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-30 15:07:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "frankyxhl",
"github_project": "dbfpy3",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "dbfpy3"
}