Python client library to connect to the VDX Core API
This repository provides a wrapper for every call made to VDX Core Api.
How it works
This helper first needs to be authorized by wielding valid token from the authentication server, then use that token for further requests as long as it has not expired.
Each method also allows one to include their own custom mappers, enabling the method to return the result in the format the user wishes.
- Python Poetry
- Docker + Docker-compose
- api_url: The url leading to Core API server
- auth_url: The url leading to authentication server
- client_secret: The authentication secret
- client_id: The ID of the client / partner
vdx_helper = VDXHelper(api_url='https://vizidox-core-api.com', auth_url='https://auth.com', client_secret=secret, client_id=client_id)
A mapper will receive a json-formatted parameter as their input. The following example mapper will add a field
def example_mapper(json_file): returned_json = copy.deepcopy(json_file) returned_json['additional_field'] = 'additional_value' return returned_json
Running the tests
You can run the tests with poetry if you like. You can also obtain the code coverage.
poetry run pytest --cov=vdx_helper
poetry run mypy --config-file conf/mypy.ini vdx_helper
poetry run coverage run --source=vdx_helper -m pytest poetry run coverage report
Run the test locally with docker-compose step-by-step
- Spin up the docker-containers
docker-compose up -d
- Run the tests via the vdx-helper docker container
docker-compose run vdx-helper pytest tests
To build the documentation locally:
cd docs make html
The build files can be found in docs/build. Open the generated index.html file in the html folder, and you can now navigate the documentation. Repeat the above command and refresh your browser every time you update the documentation. All source files are in docs/source, with vdx_helper containing the documentation generated from docstrings.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for vdx_helper-3.2.4-py3-none-any.whl