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
from bcn_rainfall_api_client.utils import APIServerSettings

# With configuration file in default path `config.yml`
api_clt = APIClient.from_config()

# With configuration file in other path
api_clt_with_path = APIClient.from_config(path="new/path/to/config.yml")

# With your own configuration
api_clt_with_cfg = APIClient.from_config(
   cfg=APIServerSettings(base_url="http://localhost:8080/api")
)

# 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.5.tar.gz (19.2 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.5-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.5.tar.gz
Algorithm Hash digest
SHA256 d99ac4177e17e468c6195023e354489176e143c4ec91b53909ddfd802660dc78
MD5 1ebc041ff06b5cd745faf8d45a7f6d2a
BLAKE2b-256 52526efd685b79c333e246017b35231d48de87d7047ead2be2cf621044a2fe65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bcn_rainfall_api_client-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ceecceeb6e8349f36b5e0c55da1b43ed0ba32ad7307de020255b59d481c1483f
MD5 1b2a39211a5f36c0ee5906cc41c13b44
BLAKE2b-256 360f7e1ad15db581d84444839a6d3b61e93ee2eba88d835ce8f34e7949579e71

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