dfdb
Pandas-like interface for manipulating SQL databases
Install
pip install dfdb
Overview
This package is a lightweight wrapper around SQLalchemy. As such, it can be used with a variety of database backends, although as of now the package has only been tested with SQLite.
The dfdb.Database class provides a dict-like interface of manipulating tables in a SQL database. For example, if we create a Database object like
db = dfdb.Database(filename='data.db', drivername='sqlite')
Then we can perform operations on a table called df in data.db by calling, for example
db['df'].groupby('col1').agg(mean=('col2', 'mean')).fetch()
db['df'] is a dfdb.DataFrame object that behaves almost identically as a pandas.DataFrame. The only difference is that you need to call .fetch(), which establishes a connection to the database and performs the corresponding SQL query.
Adding rows to the table is as simple as
db['df'].append({'col1': 1, 'col2': 2})
More detailed documentation to follow in the future.
Release files for dfdb 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dfdb-0.1.9.tar.gz | 29.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dfdb-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:54.2 kB
Release files / dfdb-0.1.9.tar.gz
| Download URL | dfdb-0.1.9.tar.gz |
|---|---|
| Size | 29.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9bc71b894b0b75e8461d17e14cbca217c916b12e6ff152c6b8d30e5f5b199d8
|
|
BLAKE2b-256 checksum How to use checksums |
1f89df271baa6c32eeb6736c0b43dff864f68fb20791e545aab0262e1b1f7ce6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / dfdb-0.1.9-py3-none-any.whl
| Download URL | dfdb-0.1.9-py3-none-any.whl |
|---|---|
| Size | 25.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9dcae7b441072987bfd5b799627bc113126406939abd34eb72b9d666e888890
|
|
BLAKE2b-256 checksum How to use checksums |
db675b97d0b6e42b7811593d438f1e2cff247f979760c0334c799dc8ba4d092d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|