Metadata-Version: 2.4
Name: agriflux
Version: 1.0.1
Summary: Maiaddy Cloud Essence Agriflux platform for agricultural intelligence and supply chain optimization
License: MIT
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Dynamic: license-file

# Agriflux Python SDK 1.0.1<a id="agrifluxsdk-python-sdk-100"></a>

Welcome to the Agriflux SDK documentation. This guide will help you get started with integrating and using the Agriflux SDK in your project.

## Versions<a id="versions"></a>

- API version: `1.0.1`
- SDK version: `1.0.1`

## About the API<a id="about-the-api"></a>

Maiaddy Cloud Essence Agriflux platform for agricultural intelligence and supply chain optimization

## Table of Contents<a id="table-of-contents"></a>

- [Setup & Configuration](#setup--configuration)
  - [Supported Language Versions](#supported-language-versions)
  - [Installation](#installation)
- [Authentication](#authentication)
  - [API Key Authentication](#api-key-authentication)
- [Setting a Custom Timeout](#setting-a-custom-timeout)
- [Sample Usage](#sample-usage)
- [Services](#services)
- [Models](#models)

# Setup & Configuration<a id="setup--configuration"></a>

## Supported Language Versions<a id="supported-language-versions"></a>

This SDK is compatible with the following versions: `Python >= 3.7`

## Installation<a id="installation"></a>

To get started with the SDK, we recommend installing using `pip`:

```bash
pip install agriflux
```

If you are using Python 3, you can use `pip3` instead:

```bash
pip3 install agriflux
```

## Authentication<a id="authentication"></a>

### API Key Authentication<a id="api-key-authentication"></a>

The AgrifluxSdk API uses an API Key for authentication.

This API key must be provided to authenticate your requests to the API.

#### Setting the API Key<a id="setting-the-api-key"></a>

When you initialize the SDK, you can set the API key as follows:

```py
AgrifluxSdk(
    access_token="YOUR_API_KEY",
    timeout=10000
)
```

If you need to set or update the API key after initializing the SDK, you can use:

```py
sdk.set_access_token("YOUR_API_KEY")
```

## Setting a Custom Timeout<a id="setting-a-custom-timeout"></a>

You can set a custom timeout for the SDK's HTTP requests as follows:

```py
from agriflux_sdk import AgrifluxSdk

sdk = AgrifluxSdk(timeout=10000)
```

# Sample Usage<a id="sample-usage"></a>

Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:

```py
from agriflux_sdk import AgrifluxSdk

sdk = AgrifluxSdk(
    access_token="YOUR_API_KEY",
    timeout=10000
)

result = sdk.health_controller.health()

print(result)

```

# Async Usage<a id="async-usage"></a>

The SDK includes an Async Client for making asynchronous API requests. This is useful for applications that need non-blocking operations, like web servers or apps with a graphical user interface.

```py
import asyncio
from agriflux_sdk import AgrifluxSdkAsync

sdk = AgrifluxSdkAsync(
    access_token="YOUR_API_KEY",
    timeout=10000
)


async def main():
  result = await sdk.health_controller.health()
  print(result)

asyncio.run(main())
```

## Services<a id="services"></a>

The SDK provides various services to interact with the API.

<details> 
<summary>Below is a list of all available services:</summary>

| Name                      |
| :------------------------ |
| yield_prediction          |
| pest_disease_monitoring   |
| supply_chain_optimization |
| health_controller         |
| soil_climate_data         |

</details>

## Models<a id="models"></a>

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

<details> 
<summary>Below is a list of all available models:</summary>

| Name                         | Description |
| :--------------------------- | :---------- |
| SupplyFarmProduceRequestDto  |             |

</details>

<!-- This file was generated by liblab | https://liblab.com/ -->
