Utility for unified querying across data sources
Project description
Spackl
Abstracting data source idiosyncrasies so you can stop reading Q&A forums and start reading your data.
Installation
pip install spackl
Usage Overview
Query Data
from spackl import db, file
conf = db.Config()
pg = db.Postgres(**conf.default)
bq = db.BigQuery(**conf.bq_datalake)
csv = file.CSV('/path/to/file.csv')
# Same method for all sources
pg_results = pg.query('SELECT id FROM schema.some_table')
bq_results = bq.query('SELECT id FROM dataset.some_table')
csv_results = csv.query()
Access Query Results
by index
results[0]
# (1234,)
by attribute
results.id
# (1234, 1235, 1236)
by key
results['id']
# (1234, 1235, 1236)
index by index
results[0][0]
# 1234
attribute by index
results.id[0]
# 1234
key by index
results['id'][0]
# 1234
index by attribute
results[0].id
# 1234
index by key
results[0]['id']
# 1234
Other Data Formats
# Pandas Dataframe
results.df()
# JSON String
results.json()
# List of tuples
results.list()
# Vertical dictionary
results.dict()
CHANGELOG
0.1.0 (2019-03-09)
- initial release
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spackl-0.1.0.tar.gz.
File metadata
- Download URL: spackl-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43b552d0dc39d7a3a7fb7bf36f5db475b5f5311232965e39b3004dad57f89283
|
|
| MD5 |
5a2bbc0b2776e0127f10ed78348f13a3
|
|
| BLAKE2b-256 |
4f6076d7352fd6d3b3f440f9a1aa8642585e231f8669a84f5bc5e537ef905d8a
|
File details
Details for the file spackl-0.1.0-py3.7.egg.
File metadata
- Download URL: spackl-0.1.0-py3.7.egg
- Upload date:
- Size: 35.6 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3096e751d1ce27be8a5c6312b48f7ecb2bdc765a5898f86e125ef847be9af8ae
|
|
| MD5 |
aaa5fb8f6d1e7a710a005f477f8d7cce
|
|
| BLAKE2b-256 |
e7c5eb8fb3a88a9cc3ed71ed19c4e2c24edb1f74128d5ebbc4706dfcd6171635
|
File details
Details for the file spackl-0.1.0-py3.6.egg.
File metadata
- Download URL: spackl-0.1.0-py3.6.egg
- Upload date:
- Size: 35.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e35a22508e8fd1365b1dad834ee2219328b51cb37be94c9963f0c1ae4676353e
|
|
| MD5 |
5b7e7b7d2c43607c4557fca31f506e6e
|
|
| BLAKE2b-256 |
e7922177eb783741f574bd5c93826f3b308ac8c03f149c06baeefd9349c47015
|
File details
Details for the file spackl-0.1.0-py2.7.egg.
File metadata
- Download URL: spackl-0.1.0-py2.7.egg
- Upload date:
- Size: 34.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b3d5c0d9170ad45d4fb0aa1b7b84b9176f31119537829df8ec8ff7999cfef8c
|
|
| MD5 |
b7abfe96cd305ebb186ac5780faf34af
|
|
| BLAKE2b-256 |
fa5683e1c120f8ed48592bab8f6aad8a238995cec92fc0d5b5ba48fa140b5e01
|