Metadata-Version: 2.1
Name: eheso-api-client
Version: 0.1.14
Summary: EHESO API
Home-page: UNKNOWN
Author: OpenAPI Generator community
Author-email: team@openapitools.org
License: UNKNOWN
Keywords: OpenAPI,OpenAPI-Generator,EHESO API
Platform: UNKNOWN
Description-Content-Type: text/markdown
Requires-Dist: aenum
Requires-Dist: pydantic (<2,>=1.10.5)
Requires-Dist: python-dateutil
Requires-Dist: urllib3 (<2.1.0,>=1.25.3)

# EHESO API Client for Python

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: v1
- Generator version: 7.7.0
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen

## Requirements.

Python 3.7+

# Installation & Usage
## pip install

```sh
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:

```env
API_KEY="your_api_key_here"
```
Replace `your_api_key_here` with the actual API key provided to you.

For example:
```env
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:

```python

import json
import time
import os
import eheso_api_client
from eheso_api_client.models.format import Format
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.LayerDataApi(api_client)
    layer_id = 'COUNTRY' # str | The ID of the layer
    format = "flat" # Format | 

    try:
        # Get All Layer Data
        api_response = api_instance.layer_query_get(layer_id, format)
        print("The response of LayerDataApi->layer_query_get:\n")
        pprint(api_response)

        # save as json file
        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 LayerDataApi->layer_query_get: %s\n" % e)
 
```

# License
This project is licensed under the MIT License.

