Convenience wrapper for accessing Subsalt datastore
Project description
Subsalt is a synthetic datastore that makes sensitive datasets shareable. This library provides an interface for retrieving data from Subsalt tables for use in other applications.
Installation
pip install subsalt
Usage
This library is a thin convenience wrapper around psycopg2. psycopg2 or similar connectors can also be used directly if more flexibility is required.
Note: this library is currently in beta, and the interface may change significantly over time.
Retrieving data from Subsalt requires valid credentials. For access, contact the data owner or email hello@getsubsalt.com
.
Authentication
client = subsalt.Client(
username=os.getenv('SUBSALT_USERNAME'),
password=os.getenv('SUBSALT_PASSWORD'),
)
# `client` can retrieve data on your behalf
Retrieving data
client = subsalt.Client(
username=os.getenv('SUBSALT_USERNAME'),
password=os.getenv('SUBSALT_PASSWORD'),
)
# Optional - get a list of tables you can access
for table in client.tables():
print('{}.{}'.format(table.schema, table.table)
# Retrieve data via SQL
df = client.sql('select * from my_schema.my_table limit 250')
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
subsalt-0.2.2.tar.gz
(3.1 kB
view hashes)