Access Database Parser

raw JSON →
0.0.6 verified Fri May 01 auth: no python

A pure-Python library for reading Microsoft Access database files (*.mdb, *.accdb) without requiring the Microsoft Access ODBC driver or any external dependencies. Version 0.0.6, released 2024-07-15, maintained irregularly.

pip install access-parser
error ModuleNotFoundError: No module named 'access_parser'
cause The package is installed as 'access-parser', but the import is 'access_parser'. Ensure you installed the correct package.
fix
Run: pip install access-parser
error AttributeError: module 'access_parser' has no attribute 'AccessParser'
cause Incorrect import; trying to import a submodule instead of the top-level class.
fix
Use: from access_parser import AccessParser
error access_parser.exceptions.InvalidAccessDBError: File is not a valid Access database
cause The file is corrupted, password-protected, or not an Access database.
fix
Verify the file is a valid .mdb or .accdb and is not password-protected.
breaking Removed logging configuration on import: In v0.0.6, the library no longer configures logging on import. If your code relied on the library setting up logging, you must configure logging explicitly.
fix Add your own logging configuration (e.g., logging.basicConfig()) if you need to see library logs.
gotcha File must be a proper .mdb or .accdb file: The library does not handle corrupted or password-protected databases. Trying to open an invalid file raises InvalidAccessDBError.
fix Ensure the file is a valid, unencrypted Access database.
deprecated Python 3.6 support is not actively tested: The library claims requires_python >=3.6, but newer versions may break on Python 3.6 due to dependency updates.
fix Upgrade to Python 3.8+ if encountering compatibility issues.
gotcha NUL characters in parsed strings: Prior to v0.0.6, strings could contain NUL characters. Upgrade to v0.0.6+ to avoid this.
fix Update to access-parser>=0.0.6.

Open an Access database and iterate over table rows.

from access_parser import AccessParser

# Replace with your .mdb or .accdb file path
parser = AccessParser('example.mdb')

# Get list of table names
print(parser.tables())

# Iterate over rows in a table
for row in parser.iter_rows('Table1'):
    print(row)