Shimoku docs
Search…
Cube.dev
One can create a Data App directly from Cube.dev with Pandas, SQLAlchemy and Shimoku in barely 10 lines of code:
from os import getenv
import pandas
from sqlalchemy import create_engine
import shimoku_api_python as Shimoku
shimoku = Shimoku.Client(
config={'access_token': getenv('SHIMOKU_TOKEN')},
universe_id=getenv('UNIVERSE_ID'),
)
# Get data from a SQL database
connection_string = 'mysql+pymysql://user:[email protected]/db'
conn = create_engine(connection_string)
df = pandas.read_sql_query('SELECT MEASURE(total_sum) total, status from orders GROUP BY status', conn)
# Load data to Shimoku
shimoku.plt.line(
data=df, x='status', y=['total'],
menu_path='Cube',
)
Last modified 3mo ago
Copy link