Skip to main content

Calcula el periodo actual según las Tarifas Españolas TD 2.0 y 3.0

Project description

Tariff TD

Tariff TD es una biblioteca para Python que permite determinar el periodo de las tarifas 2.0 TD y 3.0 TD españolas en una fecha determinada así como obtener el precio correspondiente.

Esta biblioteca usa los festivos proporcionados por la biblioteca hollidays pero elimina los Viernes Santos, puesto que dicho festivo, al cambiar de fecha cada año, no es considerado valle.

Ejemplo de suo

from datetime import datetime

from src.tariff_td import Tariff20TD

FORMAT = "%Y-%m-%d %H:%M:%S"

# Creamos la instancia especificando los precios.
# En caso de la Tarifa 3.0, se usaría Tariff30TD
tariff = Tariff20TD(p1=0.17, p2=0.15, p3=0.10)

# Creamos una fecha
date = datetime.strptime("2024-01-02 06:00:00", FORMAT)

# Obtenemos el periodo
period = tariff.get_period(date)

# Obtenemos el precio
price = tariff.get_price(date)

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

tariff_td-1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tariff_td-1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file tariff_td-1.1.tar.gz.

File metadata

  • Download URL: tariff_td-1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tariff_td-1.1.tar.gz
Algorithm Hash digest
SHA256 6e255094a31de8c19cc0da6d4704df851965e1e2599de78da68e6ae61d54a797
MD5 189f94617b4214f4c97446959e3f2c68
BLAKE2b-256 c2ffdd95d4915a3f307da981dc88d7b94b2e2a2cea7d21d633dd0a855e8e1dcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for tariff_td-1.1.tar.gz:

Publisher: main.yml on MiguelAngelLV/python-tariff-td

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tariff_td-1.1-py3-none-any.whl.

File metadata

  • Download URL: tariff_td-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tariff_td-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2e37e6117f6a0b779fe8ad57be16fcae73295b8891e170a280cc0467c48b544
MD5 4969b87c78488e1e56cee38770c9fb19
BLAKE2b-256 96bfd3e47f2e9d08f780da586bcde6ed6d68e6995b2ba63abebf38cf2da46c31

See more details on using hashes here.

Provenance

The following attestation bundles were made for tariff_td-1.1-py3-none-any.whl:

Publisher: main.yml on MiguelAngelLV/python-tariff-td

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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