Hex
Hex is a collaborative data notebook platform that supports Python and SQL. You can use pyoso in Hex to query the OSO data lake and build interactive analyses.
Get Started
To get started with OSO in Hex:
-
Create a new Hex project or open an existing one.
-
Add your OSO API key as an environment variable:
- Go to the Environment tab in your Hex project.
- Click + Add environment variable.
- Name it
OSO_API_KEYand paste your API key as the value. - Click Save.
-
In a new Python cell, run the following setup code:
import pandas as pdtry:from pyoso import Clientexcept:! pip install pyosofrom pyoso import Clientclient = Client(api_key=OSO_API_KEY)def stringify(arr):return "'" + "','".join(arr) + "'"tipWe use the try/except block to check if the
pyosopackage is already installed. If not, it installs the package and then imports it. This way, you can run the code in a new cell without having to restart the kernel. -
Run a test query:
query = """SELECTproject_id,project_name,display_nameFROM projects_v1WHERE lower(display_name) LIKE lower('%merkle%')"""df = client.to_pandas(query)df.head()
That's it! You're ready to start analyzing the OSO dataset in Hex. Check out our Tutorials for examples of how to analyze the data.