Comment on page
Manage your Projects and data with Python
Latest Release: v0.2 on April 6, 2020.
Upgrade your datagym package with
pip install --upgrade datagym
Python Version: Ensure you have one of the following Python versions installed - Python 3.6, 3.7, 3.8
After finishing the initial preparations as described above, we have our first Dummy Project and some labeled images to work with in this tutorial. Feel free to mix in some of your own Projects and labeled data if you already used DataGym.
The DataGym Python API can easily be installed from the Python Package Index (PyPI) via pip. Therefore, you only have to execute the following command on your machine:
user@machine:~$ pip install datagym
In order to connect to your Projects you have to import and initialize the API Client from the datagym package. Just put in your API Key into the Client and you're good to go!
from datagym import Client
client = Client(api_key="<YOUR_API_KEY>")
The Client object is the gateway to the data from your DataGym account. You can use the Client to get your Projects, Datasets, Images, and labeled data.
You can fetch all your Projects including their connected Datasets in a single line.
projects = client.get_projects()
This may raise an API Exception with the Message: ´Forbidden.´. If you see see this error, please sign into your DataGym account and check if your API Token is valid.
Use-Case: If you want to inspect your Projects you can simply write a little script to print a report.
for project in projects:
for dataset in project.datasets:
Your output could look like this:
Description: Labeling Cats Task
Dataset: Cats from Pixabay
Description: Just too many cats
Description: A project that helps to track cars from an arial drone