unofficial-humanitec-client


Nameunofficial-humanitec-client JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://gitlab.com/noordsestern/unofficial-humanitec-client
SummaryGenerated Python Client for Humanitec API
upload_time2023-10-30 18:24:05
maintainer
docs_urlNone
authorMarkus Stahl
requires_python
licenseEUPL 1.2
keywords swagger humanitec api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](src/README.md) 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](https://api-docs.humanitec.com/) 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:

```python
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.

```python
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 '<some method>', 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...

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/noordsestern/unofficial-humanitec-client",
    "name": "unofficial-humanitec-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Swagger,Humanitec API",
    "author": "Markus Stahl",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/79/35/fea0ae264aab5fc13d0fd5a6d6989a22e02eaaf314b2bbda2240fe592d19/unofficial-humanitec-client-0.1.1.tar.gz",
    "platform": null,
    "description": "# Unofficial Client for Humanitec API\n\nBased on generated client with swagger-codegen. Contains a few tweaks to tackle generation bugs from swagger-codegen. [Full generated documentation](src/README.md) of generated client.\n\nThis is for testing only. If you need to use a python-client in production, rather generate maintain one by yourself. \n\nHowever, if you just need a python module ready to access Humanitec API, run:\n\n```\npip install unofficial-humanitec-client\n```\n\n# Official Humanitec API Documentation\n\nSee [official documentation](https://api-docs.humanitec.com/) for information provided directly by Humanitec.\n\n# License\n\nThe original openapi specification is published under Apache 2 license. This generated client is published under EUROPEAN UNION PUBLIC LICENCE v. 1.2 \n\n-----\n\n# Trouble Shooting\n\n## Authentication\n\nUnfortunately, 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:\n\n```python\nconfiguration = Configuration()\nconfiguration.api_key['Authorization']='<your humanitec api token>'\nconfiguration.api_key_prefix['Authorization']='Bearer'\napi_client = swagger_client.ApiClient(configuration=configuration)\n```\n\nUse that api_client as base client for every api_instance you create, i.e.\n\n```python\ndef get_all_apps(org_id: str):\n    # Use api_client with bearer authentication configured\n    api_instance = swagger_client.ApplicationApi(api_client=api_client)\n\n    try:\n        # List all Applications in an Organization.\n        api_response = api_instance.orgs_org_id_apps_get(org_id)\n        print(api_response)\n    except ApiException as e:\n        print(\"Exception when calling ApplicationApi->orgs_org_id_apps_get: %s\\n\" % e)\n```\n\n## Invalid value for '<some method>', must not be 'None'\n\nSome 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.\n\nKnown 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...\n",
    "bugtrack_url": null,
    "license": "EUPL 1.2",
    "summary": "Generated Python Client for Humanitec API",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://gitlab.com/noordsestern/unofficial-humanitec-client"
    },
    "split_keywords": [
        "swagger",
        "humanitec api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb6fb90fa611f2ab2e49f808788f82ffb36023b0dcbf24e2520c1b50553e3653",
                "md5": "afaaeac48bda64eea3ce400d8c69941d",
                "sha256": "d491cdf2003d7c8c8c7983927df094df15567313b4ba30f3d3d188ab69680a26"
            },
            "downloads": -1,
            "filename": "unofficial_humanitec_client-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "afaaeac48bda64eea3ce400d8c69941d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1125456,
            "upload_time": "2023-10-30T18:24:02",
            "upload_time_iso_8601": "2023-10-30T18:24:02.406561Z",
            "url": "https://files.pythonhosted.org/packages/bb/6f/b90fa611f2ab2e49f808788f82ffb36023b0dcbf24e2520c1b50553e3653/unofficial_humanitec_client-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7935fea0ae264aab5fc13d0fd5a6d6989a22e02eaaf314b2bbda2240fe592d19",
                "md5": "9055753362d308b63db71c6e58f1c9a5",
                "sha256": "eda42cbb37365ede2dbc483b18065a12688ab7f16e57dd83cef1c9e5c258e0ea"
            },
            "downloads": -1,
            "filename": "unofficial-humanitec-client-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9055753362d308b63db71c6e58f1c9a5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 238518,
            "upload_time": "2023-10-30T18:24:05",
            "upload_time_iso_8601": "2023-10-30T18:24:05.527590Z",
            "url": "https://files.pythonhosted.org/packages/79/35/fea0ae264aab5fc13d0fd5a6d6989a22e02eaaf314b2bbda2240fe592d19/unofficial-humanitec-client-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-30 18:24:05",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "noordsestern",
    "gitlab_project": "unofficial-humanitec-client",
    "lcname": "unofficial-humanitec-client"
}
        
Elapsed time: 0.61276s