Metadata-Version: 2.2
Name: bcn-rainfall-api-client
Version: 1.0.3
Summary: Client who serves routes from the Barcelona Rainfall API.
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: api-session~=1.4.2
Requires-Dist: pre-commit~=4.0.1
Requires-Dist: pydantic~=2.8.2
Requires-Dist: pyyaml~=6.0.2

# bcn-rainfall-api-client

[![PyPI version](https://badge.fury.io/py/bcn-rainfall-api-client.svg)](https://badge.fury.io/py/bcn-rainfall-api-client)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)

Client who serves routes from the Barcelona Rainfall API; it is recommended to use it to retrieve rainfall data instead of directly calling the API code.

## Usage

```python
from bcn_rainfall_api_client import APIClient
from bcn_rainfall_api_client.utils import APIClientSettings

# With configuration file in default path `config.yml`
api_clt = APIClient.from_config()

# With configuration file in other path
api_clt_with_path = APIClient.from_config(path="new/path/to/config.yml")

# With your own configuration
api_clt_with_cfg = APIClient.from_config(
    cfg=APIClientSettings(host="localhost", port=8080, root_path="/api")
)

# Have fun with client!
data = api_clt.get_rainfall_average(time_mode="yearly", begin_year=1991, end_year=2020)
print(data)
...
```

1. `time_mode` argument should be one of:
   1. `["yearly", "seasonal", "monthly"]`
2. `month` argument should be one of:
   1. `["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]`
3. `season` argument should be one of 
   1. `["winter", "spring", "summer", "fall"]`
