Setting up

Prerequisite You should have created an account on Rho web app.

In the web app, go to account settings to get an API key.

Install the Python SDK:

pip install rho-store --upgrade --no-cache

Import and initialize the client:

main.py
from rho_store import RhoClient

rho_client = RhoClient(api_key="$YOUR_API_KEY")

List available tables:

main.py
tables = rho_client.list_tables()

for table in tables:
    print(table)

Fetch data for a table:

main.py
table = tables[0]
df = table.data

print(df.head())

Upload a dataset

Make sure pandas is installed:

pip install pandas

Upload a dataframe with one line of code:

main.py
import pandas as pd

# example data
emissions_df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/Emissions%20Data.csv")

table = rho_client.store_df(emissions_df, name="emissions_data")
print(table.client_url)  # the URL of the table on Rho web app

Summary

That’s it! You have uploaded and downloaded data from rho using one-liners.

In the next section, we will learn how to use different types of upload and merge strategies.