Dynamic building of filtered database queries
Project description
Datasiphon
Package for applying dictionary filter to some form of query on database to retrieve filtered data or acquire filtered query
Installation
Use the package manager pip to install datasiphon.
pip install datasiphon
Usage
from siphon import build, sql
import sqlalchemy as sa
# Create a filter
filter_ = {
"name": {"eq": "John"},
}
table = sa.Table("users", sa.MetaData(), autoload=True, autoload_with=engine)
# Build a query
query = table.select()
# apply filter using build function
query = build(query, sql.SQl, filter_)
# execute query
result = engine.execute(query)
...
Currently Supported Databases
- SQL (using sqlalchemy)
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
datasiphon-0.2.1.tar.gz
(9.3 kB
view hashes)
Built Distribution
Close
Hashes for datasiphon-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb860898ef4f014b3b8041db8d6810f2cce6b20f90b4d67b2fb0a906ca57d5f1 |
|
MD5 | 887a93c9e03bf51265f3b9cb397b0a9b |
|
BLAKE2b-256 | ea0a65662a8e032ea12daae5e22db05ba0231d14902da9fc18bd209df29ce9ab |