Skip to main content

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 (.mdb, .accdb, .rdb) as a Python Polars Dataframe.

Installation

To read the database, this package thinly wraps MDBTools.

If you are on macOS, 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.

  1. Download the mdb-tools files from Windows link above. Visit the Releases section, then download the part that says "Source Code (zip)".
  2. Extract that to somewhere like C:/bin/mdbtools-win/mdbtools-win-1.0.0.
  3. Follow these instructions to add that folder to your environment path (Method 1, but use the path to the mdbtools executable files).
  4. 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"
print(pl_access.list_table_names(file_path))

df: pl.DataFrame = pl_access.read_table(file_path, table_name="your_table_name")

Acknowledgements

This code is based heavily on jbn's pandas_access library.

Contributing

Please Star this repo.

Please submit bug reports as GitHub Issues. Feel free to submit a PR to fix an issue!

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

polars_access_mdbtools-0.1.0.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

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

polars_access_mdbtools-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file polars_access_mdbtools-0.1.0.tar.gz.

File metadata

File hashes

Hashes for polars_access_mdbtools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3c6e0f0d9cb105273b1942708095de052eac61c8a0e05ea40a6b87769cf3a94
MD5 ddb487916b745488115aa4cc2a1a2531
BLAKE2b-256 04dcb72d9dacb9b78ddc273cb162f8dc0965c80bbfd74b62ae65ba47ccdff63e

See more details on using hashes here.

File details

Details for the file polars_access_mdbtools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for polars_access_mdbtools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 098bd3f861febe7f9bb2d9d5e4f71e4616dd5b8f569f9125691bb37708edbeac
MD5 5129afc8a6cc6096f14c4ab6217da035
BLAKE2b-256 b400d447c007c5017d878e67ade5b99e410dfc86bd61519b1da81183f0b475f8

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