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.9.tar.gz (17.8 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.9-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.9.tar.gz
Algorithm Hash digest
SHA256 5fe55b7109ebad29d635e8dfa10a50fcd812b0d2102dddffa5d72d0375053ab2
MD5 7c7d3cd6fac924d5a35b64155e6fe8aa
BLAKE2b-256 65dfd16b558c3cd5ff3541bb09912cbf38a80df0dc781cfb39800ecd52ad3133

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8a6cf733813e88047bfa3ded1497ab19ebf05a00d3bc34a39b8466035fd0dbb3
MD5 541e63992329b08bf51dce128d557656
BLAKE2b-256 06f6b677cb04c0145c3a79cab80725c5cd8b9ffde6bda66a1215795d152193dd

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