SQLAlchemyIO (saio)
Module hack for autoloading table definitions.
Also provides a helper function as_pandas to read an sqlalchemy.orm.query.Query into a (Geo)Pandas dataframe.
Usage
After
import saio
saio.register_schema("model_draft", engine)
one can import table declarations easily using
from saio.model_draft import lis_charging_poi as LisChargingPoi
Note that ipython and Jupyter Notebook, allow using <TAB> to auto-complete
table names.
The helper function as_pandas reads a query into a GeoDataFrame:
saio.register_schema("boundaries", engine)
from saio.boundaries import bkg_vg250_2_lan as BkgLan
df = saio.as_pandas(session.query(BkgLan))
df.plot()
Installation
The package is registered on pypi, so install with
pip install saio
or get it directly from github
pip install git+https://github.com/coroa/saio.git#egg=saio
Implementation details
saio.register_schema instantiates a declarative base using
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base(bind=engine)
# The Base can be imported using from saio.model_draft import Base
and then whenever one imports any table from saio.model_draft, ie. by calling
from saio.model_draft import lis_charging_poi as LisChargingPoi, saio does
approximately
class LisChargingPoi(Base):
__tablename__ = 'lis_charging_poi'
__table_args__ = {'schema': 'model_draft', 'autoload': True}
Metadata
Release files for saio 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| saio-0.2.1.tar.gz | 4.4 kB | Without provenance | Details for saio-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| saio-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for saio-0.2.1-py3-none-any.whl |
Total release size: 9.9 kB
Release files / saio-0.2.1.tar.gz
| Download URL | saio-0.2.1.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fc0635c160a341ecf3a5b8d3b6bf83bf4cb7d410ecb6ec63ead1c9246808d87
|
|
BLAKE2b-256 checksum How to use checksums |
198aaeb8f8f712c0b26071afbeff0b66e06007d924027938a14f653d58611562
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.5
|
Release files / saio-0.2.1-py3-none-any.whl
| Download URL | saio-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e737f7595e938c2a19a5aca4896ac7df5834417e1be54686b926112393e6d89
|
|
BLAKE2b-256 checksum How to use checksums |
0dc87871e89596adb4a4096d76e057a431752e315a5319fd7c9519045e698e7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.5
|
Security for saio 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.