A python client library for the Indico IPA Platform.
See the full Documentation.
Required: Python 3.6, 3.7, or 3.8
From PyPI:
pip3 install indico-client
From source:
git clone https://github.com/IndicoDataSolutions/indico-client-python.git
python3 setup.py install
Running in a Docker container:
docker build -t indico-client .
docker run -it indico-client bash
The Indico Platform and Client Libraries use JSON Web Tokens (JWT) for user authentication. Details on acquiring this token can be found at this documentation
The following environment variables are used for authentication in the default IndicoClient
object
INDICO_HOST
: URL of the IPA instanceINDICO_API_TOKEN
: user token downloaded from these directions
from indico import IndicoClient, IndicoConfig
config = IndicoConfig(
host='try.indico.io', # or your custom app location
api_token_path='./indico_api_token.txt' # path to your API token
)
client = IndicoClient(config=config)
from indico import IndicoClient
from indico.client.request import GraphQLRequest
client = IndicoClient()
response = client.call(GraphQLRequest(
query="""
query modelGroupQueries($ids: [Int]) {
modelGroups(modelGroupIds: $ids){
modelGroups{
id
}
}
}
""",
variables={"ids": [1]}
))
model_groups = response["model_groups"]["model_groups"]
To run the tests associated with this repo perform the following:
Ensure you have set the environment variables detailed here
You will also need the following env variables set for the Exchange integration tests:
EXCH_TENANT_ID
EXCH_CLIENT_ID
EXCH_CLIENT_SECRET
EXCH_USER_ID
- Create a virtual environment
python3 -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install the client
python3 setup.py install
- Install pytest
pip3 install pytest
- Run tests
pytest -sv --host <indico_host> tests/
_ Only run unit testspytest -sv --host <indico_host> tests/unit/
_ Only run integration testspytest -sv --host <indico_host> tests/integration/
This repository adheres (as best as possible) to the following standards:
- Python Black Formatter
- Line Width=88
- Google Docstrings