Anitra • Anitra API documentation • Anitra data model • Python library
Sample implementation of the Anitra data API in Python.
This code provides a reference implementation of an Anitra API-based application, a command line interface to export device list and device data. This code is only sample code to indicate how to work with the API, the code purposefully does not handle exceptions, does not check for inputs and contains some code duplication. If possible, it is preferrable to use the official API client library available on PyPi using pip install animaltrackingdata
.
This project was developed and tested in Python 3.11.
Install the required libraries using requirements.txt.
pip install -r requirements.txt
To utilize the API, you will need to generate an API key in the Anitra platform. Further instructions are available on the user guide website.
Exports all data you can access from the given device. This code uses the Anitra data scroll API endpoint to ensure data scroll consistency in case any new data is received.
Sample usage:
python3 anitra-cli.py --clientid=YOUR_CLIENTID --clientkey=YOUR_CLIENT_KEY device-data 9999 --format csv --output 9999.csv
Exports the list of devices your user account can access.
Sample usage:
python3 anitra-cli.py --clientid=YOUR_CLIENTID --clientkey=YOUR_CLIENT_KEY device-data 9999 --format csv --output 9999.csv