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

# You can replace base_url with your own instance URL if you have one running
base_url = "https://bcn-rainfall-api.onrender.com/rest"

# Instantiate client
api_clt = APIClient(base_url=base_url)

# 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 = "monthly"
month = "may"
season = "winter"

assert time_mode in ["yearly", "seasonal", "monthly"]
assert month in ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
assert 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.6.tar.gz (17.6 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.6-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.6.tar.gz
Algorithm Hash digest
SHA256 5650a9eb6ffcb0088adbb0f6b2f60ee9413cf4b243370431ac07a0cf29c34a54
MD5 92261c6da1c815691e4a211c678eda9a
BLAKE2b-256 b10c22e4a24b955175fc4671901be404e5a79f93f07b04b397f5c454ec7bce02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d597fc10e23dec8ac10e8a9897c0f7da7d9e6855e8d79452102c50242eb6f14d
MD5 195c7ac7e9ec009f7e9d8a31c89bee6a
BLAKE2b-256 9dedc43b650c26b67824edcad081edf0a14e8ead0e884ff2b713ce4bde1fa914

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