Sqlachemy Query WRapper Library - pandas-like SQL
Project description
sqwrl
Sqlachemy Query WRapper Library
Quickstart
Install is easy via pip install sqwrl.
import pandas as pd
from sqwrl import DB
db = DB('sqlite:///:memory:')
df = pd.DataFrame({"x": [1,2,3,4,5], "y": list("abcdf"), "z": [1.0, 1.5, 1.5, 1.2, 1.3]}).set_index("y")
ans_df = pd.read_csv("tests/anscombe.csv")
db["anscombe"] = ans_df
ans_tbl = db["anscombe"]
ans_tbl
Now you can (mostly) use the sqwrl table object as if it were a pandas dataframe!
ans_tbl[ans_tbl["dataset"].isin(["I", "II"])][["x", "y"]]
Use the .df attribute on sqwrl table objects to read their output into pandas DataFrames for any unsupported features.
>>> (ans_tbl.df == ans_df).all().all()
True
See usage for more usage examples.
Basic Features:
- Smart Pandas like wheres using getitem
-
.locoperations - Indexing (including reset_index, drops, and appending)
- Sorting
- Most arithmetic operations lazily pushed
- Metadata like length and dtypes
Advanced Features:
- Groupby
- Groupby group iteration
- Groupby aggregation
- Groupby aggregation over multiple columns
- Groupby group sizes
- Groupby transform and apply
- Joins
- Pandas-style joins (have the basic framework in place for this)
- Mutation
- Adding, deleting, and editing columns
- Appending existing tables
- Deleting or editing based on conditions
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 sqwrl-0.1.0.tar.gz.
File metadata
- Download URL: sqwrl-0.1.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7e2712a0f46b784178efd63fc32a4ae8e904a9547829cd044926e3ea319f0f0
|
|
| MD5 |
d3391a71929923639909086a32586cfe
|
|
| BLAKE2b-256 |
8d2290883764c5d4f77d7709c57b5958d7e24fea8aa6d51d1f06ffb52180a4cd
|
File details
Details for the file sqwrl-0.1.0-py3.8.egg.
File metadata
- Download URL: sqwrl-0.1.0-py3.8.egg
- Upload date:
- Size: 29.1 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c94e8e09c4d0b22a5e4c4d79e02a92fd8ee10653172b585e046542c81a31d139
|
|
| MD5 |
8f14a7a7973f092a9b550de69ec51a89
|
|
| BLAKE2b-256 |
4a4dd607b0afbf7797157c53ae613f11efd8182a42bb9208c4520b195a1f588f
|
File details
Details for the file sqwrl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sqwrl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
908ca8da06929b556989cdc7871f7885a8ff7ab1768742220ce6ea0855df41cc
|
|
| MD5 |
4767bb426e164dda1c78b9403439454e
|
|
| BLAKE2b-256 |
402495a35b5a22826dc076d3561c0d558663847201a1310bab2dae81494c294d
|