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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.7.tar.gz
Algorithm Hash digest
SHA256 3321a2487124b43235070c4913b28d05842510ccfeb167e509cb3843836b1cab
MD5 2091151a1761449747a6dce28f3e261d
BLAKE2b-256 a77772bc6ad13b9b5b1c98e7640ca45bc32e51a9d9600bb05f68ae4d6544521f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1fbeb00efeda4a8ba285cab6630381d72eb43a466529a4c1724cee41caf231f9
MD5 ba1ac8d283cdcafbef4db589f02a2873
BLAKE2b-256 dcff824f9b51de5d6e4c554ba48c2f9dd43d2fe5e77993c8ac514044a5b93234

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