Generated Python Client for Humanitec API
Project description
Unofficial Client for Humanitec API
Based on generated client with swagger-codegen. Contains a few tweaks to tackle generation bugs from swagger-codegen. Full generated documentation of generated client.
This is for testing only. If you need to use a python-client in production, rather generate maintain one by yourself.
However, if you just need a python module ready to access Humanitec API, run:
pip install unofficial-humanitec-client
Official Humanitec API Documentation
See official documentation for information provided directly by Humanitec.
License
The original openapi specification is published under Apache 2 license. This generated client is published under EUROPEAN UNION PUBLIC LICENCE v. 1.2
Trouble Shooting
Authentication
Unfortunately, there is mix of missing security schemes in the original Humanitec specification (from version 0.24.1 on) and several bug in the swagger-codegen breaking the use of bearer authentication. As workaround use the folloying snippet:
configuration = Configuration()
configuration.api_key['Authorization']='<your humanitec api token>'
configuration.api_key_prefix['Authorization']='Bearer'
api_client = swagger_client.ApiClient(configuration=configuration)
Use that api_client as base client for every api_instance you create, i.e.
def get_all_apps(org_id: str):
# Use api_client with bearer authentication configured
api_instance = swagger_client.ApplicationApi(api_client=api_client)
try:
# List all Applications in an Organization.
api_response = api_instance.orgs_org_id_apps_get(org_id)
print(api_response)
except ApiException as e:
print("Exception when calling ApplicationApi->orgs_org_id_apps_get: %s\n" % e)
Invalid value for '', must not be 'None'
Some endpoints cannot deal with null values. On the one side nullable fields are missing from the original Humanitec specification (0.24.1), but even when added, swagger-codegen still makes all fields required.
Known endpoints running in to this bug are delta
endpoints. In that case, you have to rely on reuests
module, which begs the question why using a generated client at all...
Project details
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
File details
Details for the file unofficial-humanitec-client-0.1.1.tar.gz
.
File metadata
- Download URL: unofficial-humanitec-client-0.1.1.tar.gz
- Upload date:
- Size: 238.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eda42cbb37365ede2dbc483b18065a12688ab7f16e57dd83cef1c9e5c258e0ea |
|
MD5 | 9055753362d308b63db71c6e58f1c9a5 |
|
BLAKE2b-256 | 7935fea0ae264aab5fc13d0fd5a6d6989a22e02eaaf314b2bbda2240fe592d19 |
File details
Details for the file unofficial_humanitec_client-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: unofficial_humanitec_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d491cdf2003d7c8c8c7983927df094df15567313b4ba30f3d3d188ab69680a26 |
|
MD5 | afaaeac48bda64eea3ce400d8c69941d |
|
BLAKE2b-256 | bb6fb90fa611f2ab2e49f808788f82ffb36023b0dcbf24e2520c1b50553e3653 |