Skip to main content

Python wrapper for CodeBase DLL for DBF table access and management.

Project description

Python CodeBaseTools

Python binding for the CodeBase-for-DBF data table engine, plus tools for spreadsheet access and other functions. Provides advanced capabilities for managing data tables in DBF format to support Python projects from simple scripts to multi-user applications with dozens of related tables and sophisticated record locking for data integrity.

Python Version License Module Version

Software Description

CodeBaseTools is a Python binding that encapsulates the very low-level functioning of the CodeBase(tm) .DLL product (formerly commercial software sold by Sequiter, Inc., and now open source) with simple powerful functions, making DBF format data table access convenient to use for Python programmers using all recent versions of Python for Windows. CodeBase(tm) was released to Open Source as of September, 2018 and updated extensively in 2026. The resulting DBF table access is dramatically faster than previously available DBF table access modules for Python and is capable of sophisticated data access and handling features normally available only to advanced SQL database tools like SQL-Server. See below for licensing details under the "Lesser GPL". Python Code-Base Tools provide the following capabilities:

  • Creates, Opens, Reads, Writes and Indexes DBF tables in a format compatible with Visual FoxPro type DBF tables.
  • Supports record, table, and table header locking compatible with that of Visual FoxPro, allowing hundreds of users to access the same tables simultaneously either with Python-Codebase-Tools or Visual FoxPro or both.
  • Optionally supports tables, fields, and index elements larger than the limits in Visual FoxPro (Maximum table size is 8GB for the standard mode required for VFP compatibility. A "Large Table" mode (not VFP compatible) is software selectable in both 32-bit and 64-bit versions that supports tables in multiple terrabyte sizes.)
  • Recognizes a wide variety of fields including:
    • Character (Assumes Code Page 1252 -Windows European Language characters)
    • Character-binary (Makes no assumptions regarding language representation, so suitable for Unicode data)
    • Memo (Large text up to 2GB)(Assumes Code Page 1252 -Windows European Language characters)
    • Memo-binary (Large text up to 2GB) (Makes no assumptions regarding language representation, so suitable for Unicode data)
    • Number (decimal values up to 17 digits)
    • Integer (4-byte signed integers)
    • Boolean (Logical, True/False)
    • Currency (Fixed 4-decimal point exact representation of money values)
    • Date (Year, Month, Day)
    • Datetime (Year, Month, Day, Hour, Minute, Second)
    • Float (like Number)
    • Double (like Number)
    • General (treated like Memo-binary, Windows OLE component content is not recognized)
  • Allows creation of standard VFP-style CDX indexes (with multiple "tags" for different orderings), IDX indexes (with a single ordering), and the auto updating of indexes when records are changed, including updating all distinct index tags in a CDX index.
  • Provides for temporary indexes which remain synchronized with the data table while in use, and are then deleted automatically when closed.
  • Supports copying DBF table data to Excel spreadsheet format with the ExcelTools modules (and the non-open-source commercial product LibXL, a purchased license for which is required. Capability supported in 32-bit versions only.)
  • Supports VFP-style CURSORTOXML and XMLTOCURSOR functions for rapid conversion of DBF data to generic XML and back to DBF.
  • Provides hundreds of powerful functions that emulate the capabilities of Visual FoxPro. VFP, though now a discontinued Microsoft product, was renowned for being able to create applications 3-4 times faster than comparable .NET tools due to its unmatched data handling capabilities.
  • Copies DBF tables to CSV (Comma Separated Value) and System Data (fixed field length) text files as well as importing those formats directly into a DBF table. For all functionality see the User Guide referenced below.

This version of Python CodeBaseTools was updated as of July, 2026. Supplementary files have been updated more recently.

Installation

Windows users having versions of Python 3.6 and later (either 32-bit or 64-bit versions of Python 3.10 and up) may install this module easily using PIP:

pip install Code-Base-Tools

To get started using Code-Base-Tools see the Getting Started and Usage section below.

Versions and Features

An older version of the module suitable for Python version 2.7, 32-bit compile, is available by downloading files directly from the GitHub repository: Python CodeBase Tools. That repository also contains source code for the Python C API based .PYD modules and instructions for recompiling them using Microsoft Visual Studio 2022.

Python versions 3.1 through 3.5 are not supported, as they are effectively obsolete. Versions 3.6, 3.7, 3.8 and 3.9 are supported with version-specific PYD files that are included in the distribution directory. For versions 3.10 and above, the PYD file which implements all the functionality was compiled from an upgraded version of the .C source that allows creation of a cross-version PYD file using the Python "Limited API" functions. PYD files supporting 64-bit Python have been compiled using the cross-version library as well, so 32-bit and 64-bit versions 3.10, 3.11, 3.12, 3.13, 3.14 and beyond are supported.

The Excel read and write features are currently only available for 32-bit Python.

Note that you do NOT need to download any files from the CodeBase-for-DBF repository which contains the underlying open-source C4DLL.DLL and C4DLL64.DLL files, as the required compiled Windows DLL files are included in this repository. Of course, you are free to customize the .C source and recompile the CodeBase-for-DBF DLLS should you need to do so. To access that underlying open source CodeBase(tm) for DBF repository see CodeBase-for-DBF

Python CodeBaseTools Licensing

This package is copyright M-P Systems Services, Inc., and is released to Open Source under the GNU Lesser GPL V.3.0 license, a copy of which is found in this repository. The CodeBase-for-DBF module, is covered by this same license. The CodeBase package, including the core library c4dll.dll and c4dll64.dll is copyright Sequiter, Inc., and is licensed under the GNU Lesser GPL v.3.0. There is an old demo version of libxl.dll included for testing purposes for the DBF to Excel module. However, that is commercial software and no license information is included in the LibXLLicenseInfo.TXT file. To use this module without the size limits and demo messages injected into the output, you'll need to acquire your own libxl license from https://libxl.com and paste the appropriate codes into the license info file.

Integration with Visual FoxPro Applications

DBF tables can be opened simultaneously both by Visual FoxPro applications and Python applications using this package. Record and table locking and buffering work correctly to support multi-user applications where both Python and VFP applications are accessing the tables. For more information on how to integrate Python components with existing Visual FoxPro applications, see our white paper at https://mpss-pdx.com/white-paper. For details on record locking see the User Guide referenced below.

OS Compatibility

The Python .pyd files which wrap the CodeBase(tm) c4dll.dll and c4dll64.dll modules were compiled for Windows. The 32-bit modules will run properly on either 32-bit or 64-bit Windows version 7 or later. The 64-bit modules will run only on 64-bit Windows. The COM functionality in ExcelComTools and DBFXLStools2 is specific to Microsoft Windows. As of October, 2018, the LibXL product, upon which the ExcelTools module is based (also required for the DBFXLStools2 module) is a Windows-specific component. A 64-bit version of ExcelTools is not provided in this release, but may be added in the future. The Python implementation you are running will determine which 32-bit or 64-bit version of this package you will be running.

As of summer, 2026, the open source CodeBase(tm) product is only available for Windows. However, Sequiter released their source code to open source in both Windows and Linux versions. A future version of this Python module may be made available in Linux versions, if demand warrants and volunteer time is available for compiling and testing those versions.

Getting Started and Usage

A Users' Manual is available in the GitHub repository in .PDF format with detailed explanation of how to manipulate data quickly and easily with this product. See UsersGuideToPythonCodeBaseTools.PDF

Other Optional components

The .PYD files (like CodeBasePYWrapper3X.pyd) provide native Python API access directly to the functions in c4dll.dll or c4dll64.dll without need for ctypes to access the raw .DLL C functions. There is a significant speed and simplicity benefit from moving more program functionality directly into a compiled C program using the Python C API library, enabling direct access to the contained functions from the Python interpreter. However, before we had developed the .PYD file(s) we developed "wrapper" DLLs that could be accessed directly by Python using ctypes. We have not obsoleted these components, and they and their C source code are found in the underlying GitHub repository referenced above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_base_tools-1.1.4.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

code_base_tools-1.1.4-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

Details for the file code_base_tools-1.1.4.tar.gz.

File metadata

  • Download URL: code_base_tools-1.1.4.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for code_base_tools-1.1.4.tar.gz
Algorithm Hash digest
SHA256 c61621a5efffa39af456046a3b384220a3e2b1d946ed034d18ff5086c38250ff
MD5 3859a8de4bc90680cc67974cd2d33dbd
BLAKE2b-256 bde67941ba0c5626359bdee455b155be5f247219a971bc005daa051fcd47c788

See more details on using hashes here.

File details

Details for the file code_base_tools-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for code_base_tools-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b4d15e5eaa9f98aef2493c4b85409a40431e40e3fde4461b7124ee33dbcc8d70
MD5 5a86936822da8902444adeb8d596ce07
BLAKE2b-256 5c849549e075bdb4579137fa32f7d6e56fd02a8fb49cb0ecc6746e8030d6dd78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page