Shimoku docs
Search…
Tinybird
One can create a Real Time Data App directly from Tinybird with Requests and Shimoku in barely 10 lines of code:
from os import getenv
import requests
import json
import shimoku_api_python as Shimoku
shimoku = Shimoku.Client(
config={'access_token': getenv('SHIMOKU_TOKEN')},
universe_id=getenv('UNIVERSE_ID'),
)
# Get data from Tinybird
url = f'https://api.tinybird.co/v0/pipes/hdig_query20211214_pipe_4577.json'
response = requests.get(url, params={'token': getenv('TINY_TOKEN')})
data = json.loads(response.content)
# The complete dataframe
data = pd.DataFrame(data['data'])
# Load data to Shimoku
shimoku.plt.line(
data, x='status', y=['total'],
menu_path='tinybird',
)
Copy link