Metadata-Version: 2.4
Name: mediloca
Version: 1.0.3
Summary: Healthcare location intelligence: facility search, access scoring, emergency routing, specialist matching, risk analysis, and heatmaps.
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

# Mediloca Python SDK 1.0.3<a id="medilocasdk-python-sdk-102"></a>

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

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

- API version: `1.0.3`
- SDK version: `1.0.3`

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

Healthcare location intelligence: facility search, access scoring, emergency routing, specialist matching, risk analysis, and heatmaps.

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

- [Setup & Configuration](#setup--configuration)
  - [Supported Language Versions](#supported-language-versions)
  - [Installation](#installation)
- [Authentication](#authentication)
  - [Access Token Authentication](#access-token-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 mediloca
```

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

```bash
pip3 install mediloca
```

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

### Access Token Authentication<a id="access-token-authentication"></a>

The Mediloca Sdk API uses an Access Token for authentication.

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

#### Setting the Access Token<a id="setting-the-access-token"></a>

When you initialize the SDK, you can set the access token as follows:

```py
MedilocaSdk(
    access_token="YOUR_ACCESS_TOKEN",
    timeout=10000
)
```

If you need to set or update the access token after initializing the SDK, you can use:

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

## 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 mediloca_sdk import MedilocaSdk

sdk = MedilocaSdk(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 mediloca_sdk import MedilocaSdk

sdk = MedilocaSdk(
    access_token="YOUR_ACCESS_TOKEN",
    timeout=10000
)

result = sdk.health_check.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 mediloca_sdk import MedilocaSdkAsync

sdk = MedilocaSdkAsync(
    access_token="YOUR_ACCESS_TOKEN",
    timeout=10000
)


async def main():
  result = await sdk.health_check.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         |
| :----------- |
| mediloca_ml  |
| health_check |

</details>
