Api client maintaining communication to praetorian-api.
Project description
praetorian-api-client
My name is Aurelius and I am emperor's counselor 👨⚖️. My everyday job is to maintain and manage communication 🗣 between praetorian Cornelius 🛡️ and military commander Maximus ⚔️.
Or just for normal people without abstract thinking I am API Client for praetorian-api project.
Introduction
Praetorian API Client is used for creating requests to Praetorian API and for receiving responses which are deserialized to objects.
Installation
# pip
pip install praetorian-api-client
# pipenv
pipenv install praetorian-api-client
# poetry
poetry add praetorian-api-client
Example
1. Create Environment object
from praetorian_api_client.configuration import Environment
environment = Environment(name='praetorian-api', api_url='http://127.0.0.1:8000/', read_only=False)
2. Create Configuration object
from praetorian_api_client.configuration import Configuration
configuration = Configuration(environment=environment, key='api-key', secret='api-secret')
3. Create ApiClient object
from praetorian_api_client.api_client import ApiClient
api_client = ApiClient.create_from_auth(configuration=configuration, username='username', password='password')
3. Create request from ApiClient to Api
This request will return (if successful) list of Remote objects.
remotes = api_client.remote.list()
Tests
To run tests, you need to run command: pytest
Tests require access data to the api. For security reasons, access data is stored in environment variables. To set
environment variables, you need to create an .env
file from the example in the .env.example
file.
Developed with 💙 and ☕️ by Adam Žúrek with the support of BACKBONE s.r.o., 2020 (C)
0.1.0 : 2020-01-12
- Initial release
0.1.1 : 2020-01-12
- ⛄️ Added resources package
0.1.2 : 2020-01-12
- 🌈 Added to remote list possibility to filter by name
0.1.3 : 2020-02-12
- 🎃 Implemented service list
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for praetorian-api-client-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b5342f4ef70dc8bc15f1182f0fd82045dd2fcc8d610e731807577cb115f4ca1 |
|
MD5 | 211bb855c62b3e414090b3c3a77f8685 |
|
BLAKE2b-256 | 316f8d9b3d2403a7bc434e88716a0d63e2a5dce89f465675f95d087594d165e3 |
Hashes for praetorian_api_client-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8112638dfb7c405baeeb5285f90132a007973ebd4b9124dd5122c0517803c08d |
|
MD5 | 27e8db2559cd864cd3bb0f94c4fe36ef |
|
BLAKE2b-256 | 70f4f40de7268ad3a091e29a4925b59873ba33ce1d5f42c926622452d6c53d86 |