Skip to main content

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.

Requirements

  • Python 3.12
  • Pip

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

Tests & Coverage

uv run coverage run -m pytest
uv run coverage report

Code quality

uv tool run mypy --check-untyped-defs .
uv tool run ruff check
uv tool run ruff format

Metadata

Release files for bcn-rainfall-core 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bcn-rainfall-core 1.0.7
File Size Uploaded Provenance
bcn_rainfall_core-1.0.7.tar.gz 53.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bcn-rainfall-core 1.0.7
File Interpreter ABI Platform
bcn_rainfall_core-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 75.1 kB

Release files / bcn_rainfall_core-1.0.7.tar.gz

Download URL bcn_rainfall_core-1.0.7.tar.gz
Size 53.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c1974ad82876b902a8aaf6f1ef632a87f95cb9a7ee0bd72fee535c108a967594
BLAKE2b-256 checksum
How to use checksums
eef6250e22652281ba2506a6249a69f7ac84eb65cb22c69b38113ac6d2a969d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release files / bcn_rainfall_core-1.0.7-py3-none-any.whl

Download URL bcn_rainfall_core-1.0.7-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b708cc823124269c68ae5b3a8c3eaf5472139ffb12f199b57b3df01072ddc4e
BLAKE2b-256 checksum
How to use checksums
81260a54e41b6977ae97842293475fedd2b4e56223956883e3382439dd5c7e2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Security for bcn-rainfall-core 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page