dias_uteis
Biblioteca feita para facilitar o uso e cálculos de dias úteis no calendário brasileiro.
- Sem dependências externas.
- Testado em todas versões do Python a partir da versão 3.6.
- Fácil uso, API simples.
- Extremamente leve.
Instalação
pip install dias_uteis
Uso
import datetime
import dias_uteis as dus
>>> dus.last_du()
datetime.date(2023, 11, 7)
>>> dus.next_du()
datetime.date(2023, 11, 9)
>>> date = datetime.date(2023, 11, 8)
>>> dus.is_du(date)
True
>>> corpus_christi_2020 = datetime.date(2020, 6, 11)
>>> dus.is_holiday(corpus_christi_2020)
True
>>> dus.delta_du(date, 5) # Soma 5 dias úteis
datetime.date(2023, 11, 16)
>>> dus.delta_du(date, -2) # Subtrai 2 dias úteis
datetime.date(2023, 11, 6)
>>> a = datetime.date(2023,11,6)
>>> b = datetime.date(2023,11,16)
>>> dus.diff_du(a, b)
7
>>> start = datetime.date(2023, 10, 20)
>>> end = datetime.date(2023, 11, 7)
>>> dus.du_range(start, end)
[datetime.date(2023, 10, 20), datetime.date(2023, 10, 23), datetime.date(2023, 10, 24),
datetime.date(2023, 10, 25), datetime.date(2023, 10, 26), datetime.date(2023, 10, 27),
datetime.date(2023, 10, 30), datetime.date(2023, 10, 31), datetime.date(2023, 11, 1),
datetime.date(2023, 11, 3), datetime.date(2023, 11, 6)]
>>> dus.year_holidays(2023) # Lista todos feriados de 2023
[datetime.date(2023, 1, 1), datetime.date(2023, 2, 20), datetime.date(2023, 2, 21),
datetime.date(2023, 4, 7), datetime.date(2023, 4, 21), datetime.date(2023, 5, 1),
datetime.date(2023, 6, 8), datetime.date(2023, 9, 7), datetime.date(2023, 10, 12),
datetime.date(2023, 11, 2), datetime.date(2023, 11, 15), datetime.date(2023, 12, 25)]
Metadata
Release files for dias-uteis 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dias_uteis-0.1.14.tar.gz | 6.6 kB | Without provenance | Details for dias_uteis-0.1.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dias_uteis-0.1.14-py3-none-any.whl | Python 3 | none | any | Details for dias_uteis-0.1.14-py3-none-any.whl |
Total release size: 13.7 kB
Release files / dias_uteis-0.1.14.tar.gz
| Download URL | dias_uteis-0.1.14.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75a5e2ae42f0fab1f7832c26b6950e63339079c6b3ec7dcd56dd5ae4889b092b
|
|
BLAKE2b-256 checksum How to use checksums |
d58ede5b54d41a275694a51038d195f2e6431b5c05d1a0be96d5552ecb99380d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.1 Windows/11
|
Release files / dias_uteis-0.1.14-py3-none-any.whl
| Download URL | dias_uteis-0.1.14-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efccaa93774c9c2db766bed38772d4f9e7aeec3d14e695d2c6e4064b6e6cc923
|
|
BLAKE2b-256 checksum How to use checksums |
a241639a5825e12160d21b7a9c962feac896f88ebf04f57e9b170ce0df18dc2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.1 Windows/11
|
Security for dias-uteis 0.1.14
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.