Skip to main content

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


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)

Uploaded Source

Built Distribution

subsalt-0.2.2-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page