Sample notebooks
Sample code maintained to use and learn from.
To quickly become familiar with the Python client, you can explore some sample notebooks. Each notebook can be executed standalone from top to bottom.
Sample notebooks
You can access the sample notebooks on Google Drive.
Right click a notebook in Google Drive and select Open with -> Google Colaboratory
to open it directly in the browser using Google Colab.
Notebook overview
Execute cells one by one using Shift+Enter
. Most commonly used libraries are pre-installed.
Interactive environments
Jupyter, Google Colab, and JetBrains Datalore are interactive environments that simplify the development and sharing of algorithmic code. They allow users to work with notebooks, which combine code and rich text elements like figures, links, and equations. Notebooks require no setup and can be easily shared.
Since Colab is a hosted free tool that meets all requirements, including Python ≥3.10, it’s recommended for use.
Installing packages
Within your interactive environment, you can install missing packages using pip in “magic” cells, which start with an exclamation mark.
All APIs or commands that require authentication can be accessed through client libraries that hide tokens, allowing notebooks to be shared without exposing personal credentials.
Executing code
Execute code by clicking the play button in the top left corner of the cell or by pressing Shift + Enter
. While the code is running, a spinning icon appears. When the execution finishes, the icon changes to a number, indicating the order of execution. The output displays below the code.
Authorization
When sharing notebooks, avoid directly sharing your Tilebox API key. Instead, use one of two methods to authenticate the Tilebox Python client in interactive environments: through environment variables or interactively.
Interactive authorization is possible using the built-in getpass
module. This prompts the user for the API key when running the code, storing it in memory without sharing it when the notebook is shared.
Was this page helpful?