Skip to main content

EHESO API

Project description

EHESO API Client for Python

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Package version: 0.0.1.dev6
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

pip install eheso-api-client

Post-Installation Setup

After installing the package, you need to create a .env file in the source folder containing the API key for server access.

Steps to Create the .env File:

  1. Navigate to the folder where the package is installed or the source folder of your project.
  2. Create a file named .env.
  3. Add the following line to the .env file:
API_KEY="your_api_key_here"

Replace your_api_key_here with the actual API key provided to you.

For example:

API_KEY="abcd1234efgh5678ijkl"

Save the .env file.

Note

  • The package uses the .env file to securely load the API key into the application.
  • Please make sure the .env file is not included in version control systems like Git (add .env to your .gitignore).

Getting Started

After installing the package and creating the .env file, run the following code:

import json
import time
import os
import eheso_api_client
from eheso_api_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://observatory.local:3001/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = eheso_api_client.Configuration(
    host = "https://dev.observatory.eter-project.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with eheso_api_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = eheso_api_client.AdminCountryApi(api_client)
    cc = 'HR' # str | The country code

    try:
        # Get data of a single country by country code
        api_response = api_instance.country_cc_get(cc)
        print("The response of AdminCountryApi->country_cc_get:\n")
        pprint(api_response)

        with open('data.json', 'w', encoding='utf-8') as f:
            json.dump(api_response, f, ensure_ascii=False, indent=4)
    except Exception as e:
        print("Exception when calling AdminCountryApi->country_cc_get: %s\n" % e)

License

This project is licensed under the MIT License.

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

eheso_api_client-0.1.12.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eheso_api_client-0.1.12-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

Details for the file eheso_api_client-0.1.12.tar.gz.

File metadata

  • Download URL: eheso_api_client-0.1.12.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for eheso_api_client-0.1.12.tar.gz
Algorithm Hash digest
SHA256 9a1f6ba681d8aaef4b5eec906cd18b47c0e559fe07fe402bb1e92289c67c6763
MD5 92a18db7939844f58b93913ece802149
BLAKE2b-256 34d826da6d1dd150126492bf44d611f5f6c6879c9a9ec4f8dfd69304ddb86ebd

See more details on using hashes here.

File details

Details for the file eheso_api_client-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: eheso_api_client-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 52.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for eheso_api_client-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 12dcf437308aeb8208b1b0697350e8f15cff52192220484dda09297822cd6bee
MD5 c7c40f8806e5a5599a1ee80b677fed63
BLAKE2b-256 99baa2d1fee1f1a5a44328e914e79142031cf82987827a0b23ca1530bc7f3aa1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page