A library for reading tables from an Access database into Polars dataframes, using mdbtools
Project description
polars_access_mdbtools
A library for reading tables from an Access database into Polars dataframes, using mdbtools
What is this?
A tiny, subprocess
-based tool for reading a
MS Access
database (.rdb
) as a Python Polars Dataframe.
Installation
To read the database, this package thinly wraps MDBTools.
If you are on OSX
, install it via Homebrew:
$ brew install mdbtools
If you are on Debian
, install it via apt:
$ sudo apt install mdbtools
If you are on Windows
, it's a little tougher. Install mdbtools
for Windows. Manually add to PATH.
- Download the mdb-tools files from Windows link above. Visit the Releases section, then downloadi the part that says "Source Code (zip)".
- Extract that to somewhere like
C:/bin/mdbtools-win/mdbtools-win-1.0.0
. - Follow these instructions to add that folder to your environment path (Method 1, but use the path to the mdbtools executable files).
- Restart your computer or just close and re-open the program you're running it from. You can test that it works by opening a terminal and running
mdb-tables --help
and see that it doesn't fail.
Finally, on all OS's:
$ pip install polars_access_mdbtools
Example Usage
import polars as pl
import polars_access_mdbtools as pl_access
file_path = 'path_to_file.mdb'
pl_access.list_table_names(file_path)
df = pl_access.read_table(file_path, table_name='your_table_name')
Acknowledgements
This code is based heavily on jbn's pandas_access
library.
To Do
- unit tests
- better error messages when subsections (e.g., schema fetching) fail
Contributing
Please Star this repo.
Please submit bug reports as GitHub Issues. Feel free to submit a PR to fix an issue!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for polars_access_mdbtools-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc2667241e770ad05b524cbe8a33afe767799c2844ba572c0dbaf442b25213db |
|
MD5 | 57a95c19b4fe835de3db007a9afbdf24 |
|
BLAKE2b-256 | 8c4752ba610a33e1a51ce321646b1105ef12e0ab587b3424e21320585be9637b |
Hashes for polars_access_mdbtools-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5135eef3bb9908cb576dee287e39842bb2f98787229812a67aad56db2eb56824 |
|
MD5 | 35f13ede43c19ddbf543683944698def |
|
BLAKE2b-256 | 8bc4a3568db489a95991d1b4b8c40845826f8dadc38840a31bb76830cb874612 |