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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.8.tar.gz
Algorithm Hash digest
SHA256 9476e7dcbe108d1e5821c2e37b8277931866d77b1389f6e482cc2c440b23a062
MD5 08d65df9c4c5aa8843208634ce6bef1d
BLAKE2b-256 a50c39ea5175f3a61b3f28bdaa83c1b39b2f2500b575905f24759b2433c7c8fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 01d0d2919916031ab90eca8cc4581f4ace6862d5de7670d2f2e876ff6bf70f60
MD5 aaaf1b918400eb9e10557bc682f8c904
BLAKE2b-256 6c7302acbe390b279b234449ed6abd013a5345bc88c2ba6a3026fe4af179bf34

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