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 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"]

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.3.tar.gz (19.3 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.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ecec6d4b6cc6711ca7bcaf9ba89e42be3b95e891a3a454050bf30dd7a410f5fe
MD5 cf04b66b13a5f207dcf55f1d31db32f4
BLAKE2b-256 6485859c9753ec32111c88eedf605d20f64ba758ffbd2debdda22853df027cf4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b02086a44ed3e307e4e6d9b0c0ee3c9e3ef6398ffe5e56d12b05b78367c716dd
MD5 0f60ab62500fefeed85465628e2be00d
BLAKE2b-256 f0c71d4edeee1f2db7411d04b8620aec0794c33a087813b7c55dc6b0d8549108

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