Skip to main content

Client who serves routes from the Barcelona Rainfall API.

Project description

bcn-rainfall-api-client

PyPI version License: MIT Ruff uv mypy

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

from bcn_rainfall_api_client import APIClient
from bcn_rainfall_api_client.utils import APIServerSettings

# 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=APIServerSettings(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)
...

About time-related parameters

time_mode in ["yearly", "seasonal", "monthly"]
month in ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
season in ["winter", "spring", "summer", "fall"]

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

bcn_rainfall_api_client-1.0.4.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

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

bcn_rainfall_api_client-1.0.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file bcn_rainfall_api_client-1.0.4.tar.gz.

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.4.tar.gz
Algorithm Hash digest
SHA256 9023a930b144f2063a55bb8669d6df34cc929e557c1d11aa88824e731de18054
MD5 700453cfd517b16c69c11660b746b6c1
BLAKE2b-256 15a815c6f04f7c3546eb984b1e0330b1ddda852e8ea3f3d773ae8f7b6b1ad504

See more details on using hashes here.

File details

Details for the file bcn_rainfall_api_client-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 eff720264b614552bb8eae1d69f401db435182477be21b759eaef792aff77cd1
MD5 59897a6b1c29f69b8f0502596f244efd
BLAKE2b-256 3df328a4ce546ff1ba2c50e441f8a9f2926718cfa225914e9d1d775f8e72dd86

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