Skip to main content

Tools to load and manipulate rainfall data from the city of Barcelona, Catalunya.

Project description

bcn-rainfall-core

PyPI version License: MIT coverage badge Ruff uv mypy

Tools to load and manipulate rainfall data from the city of Barcelona, Catalunya; it is the core of the Barcelona Rainfall project and is exposed through the Barcelona Rainfall API.

Usage

from bcn_rainfall_core import Rainfall
from bcn_rainfall_core.utils import DataSettings

# With configuration file in default path `config.yml`
rainfall = Rainfall.from_config()

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

# With your own configuration
rainfall_with_cfg = Rainfall.from_config(
    cfg=DataSettings(file_url="http://...", start_year=1955, rainfall_precision=2)
)

# With your own configuration from local file
rainfall_with_cfg_from_file = Rainfall.from_config(
    cfg=DataSettings(local_file_path="/dir/my_rainfall_data.csv", start_year=1955, rainfall_precision=2),
    from_file=True,
)


# Have fun with class!
from bcn_rainfall_core.utils import TimeMode, Season

rainfall_avg = rainfall.get_rainfall_average(
    TimeMode.SEASONAL,
    begin_year=1975, 
    end_year=1998, 
    season=Season.WINTER
)
print(rainfall_avg)
...

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_core-1.0.2.tar.gz (53.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_core-1.0.2-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file bcn_rainfall_core-1.0.2.tar.gz.

File metadata

  • Download URL: bcn_rainfall_core-1.0.2.tar.gz
  • Upload date:
  • Size: 53.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.8

File hashes

Hashes for bcn_rainfall_core-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f7cf9496ed82cbdb59524faec18214ed4454de1d3d7601417773a8e7fb811e80
MD5 49757a1e59743baf751d90a3ec6a12c1
BLAKE2b-256 6f24f7a9bc4ebebf144c83555fba95409028ee5933342c4fd7960fbda8a646f2

See more details on using hashes here.

File details

Details for the file bcn_rainfall_core-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bcn_rainfall_core-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 efd8dfacf98c0bf3267f8924ad3462fb7ad73045addca7470527feeec7c17c9b
MD5 2889d8b01018589c6fb363e10d8d6d80
BLAKE2b-256 862d5877de76b894580dc305f75596df9d59b11774ca70e8540940dd312adb4e

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