Skip to main content

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)

Source distribution for dfdb 0.1.9
File Size Uploaded
dfdb-0.1.9.tar.gz 29.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dfdb 0.1.9
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page