You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

bcn-rainfall-api-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bcn-rainfall-api-client

Client who serves routes from the Barcelona Rainfall API.

1.0.9
pipPyPI
Maintainers
1

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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts