Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Tracker Python API Client

The Tracker Python API Client will provide a Python wrapper for key features of Tracker.

It makes use of GQL, a Python GraphQL client, to query the Tracker API.

Installing Dependencies

Install pipenv if you don't already have it.

pipenv install --dev

If you run into issues, ensure pipenv has installed the most recent GQL version. The most recent version of GQL is only available from their Github, so if you need to install it manually run:

pipenv install -e git+https://github.com/graphql-python/gql.git#egg=gql

Authentication

The client will attempt to draw credentials from its environment in order to obtain an authentication token. Pipenv makes this easy to set up by importing environment variables from a .env file present in this directory whenever pipenv run or pipenv shell are used. The .env file can be created like so:

cat <<'EOF' > .env
TRACKER_UNAME=YOURTRACKEREMAILHERE@EXAMPLE.COM
TRACKER_PASS=YOURPASSWORDHERE
EOF

Testing

Pytest is used for testing. To run tests, run the following in the project root (the folder containing this README.md):

pipenv run pytest

Alternatively, if you are already in a pipenv shell, just run pytest.

If tests are failing with ModuleNotFoundError, make sure tracker_client/ is on your PYTHONPATH. The .env file used to store your credentials is a good way to set this.