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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e255094a31de8c19cc0da6d4704df851965e1e2599de78da68e6ae61d54a797
|
|
| MD5 |
189f94617b4214f4c97446959e3f2c68
|
|
| BLAKE2b-256 |
c2ffdd95d4915a3f307da981dc88d7b94b2e2a2cea7d21d633dd0a855e8e1dcd
|
Provenance
The following attestation bundles were made for tariff_td-1.1.tar.gz:
Publisher:
main.yml on MiguelAngelLV/python-tariff-td
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tariff_td-1.1.tar.gz -
Subject digest:
6e255094a31de8c19cc0da6d4704df851965e1e2599de78da68e6ae61d54a797 - Sigstore transparency entry: 188542340
- Sigstore integration time:
-
Permalink:
MiguelAngelLV/python-tariff-td@d8549c13df74b20ff8907105629e809407942144 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MiguelAngelLV
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@d8549c13df74b20ff8907105629e809407942144 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2e37e6117f6a0b779fe8ad57be16fcae73295b8891e170a280cc0467c48b544
|
|
| MD5 |
4969b87c78488e1e56cee38770c9fb19
|
|
| BLAKE2b-256 |
96bfd3e47f2e9d08f780da586bcde6ed6d68e6995b2ba63abebf38cf2da46c31
|
Provenance
The following attestation bundles were made for tariff_td-1.1-py3-none-any.whl:
Publisher:
main.yml on MiguelAngelLV/python-tariff-td
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tariff_td-1.1-py3-none-any.whl -
Subject digest:
f2e37e6117f6a0b779fe8ad57be16fcae73295b8891e170a280cc0467c48b544 - Sigstore transparency entry: 188542343
- Sigstore integration time:
-
Permalink:
MiguelAngelLV/python-tariff-td@d8549c13df74b20ff8907105629e809407942144 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MiguelAngelLV
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@d8549c13df74b20ff8907105629e809407942144 -
Trigger Event:
push
-
Statement type: