Skip to main content

colombia-utils

CI · English · Español

Small, dependency-free Python helpers for things every Colombian app ends up needing: public holidays, business days and NIT check digits.

For developers building invoicing, scheduling, payroll or e-commerce software for Colombia who are tired of hard-coding next year's holidays or copying the DIAN check-digit formula from a forum.

Features

  • Public holidays for any year from 1984, computed from the law instead of a hard-coded list: fixed dates, holidays moved to Monday by Ley 51 de 1983 ("Ley Emiliani") and the ones that depend on Easter. Names in Spanish.
  • Business days: is_business_day() and business_days(start, end) (Monday to Friday, skipping holidays).
  • NIT check digit (dígito de verificación) with the official DIAN weights.
  • Pure standard library, Python 3.10+, fully tested.

Install

Install from PyPI:

pip install colombia-utils

Usage

from datetime import date
from colombia_utils import holidays, is_holiday, business_days, nit_check_digit

holidays(2027)[:3]
# [(date(2027, 1, 1), 'Año Nuevo'), (date(2027, 1, 11), 'Reyes Magos'), (date(2027, 3, 22), 'San José')]

is_holiday(date(2027, 1, 11))                          # True: Reyes Magos moved to Monday
business_days(date(2027, 3, 1), date(2027, 3, 31))     # 20: both ends included
nit_check_digit("800.197.268")                         # 4
Function Returns
holidays(year) Sorted list of (date, name). Two holidays can share a date (June 30, 2025). Raises ValueError before 1984.
is_holiday(d) True if d is a public holiday.
is_business_day(d) True for Monday to Friday that is not a holiday.
business_days(start, end) Business days from start to end, both included.
easter(year) Easter Sunday (Gregorian).
nit_check_digit(nit) Check digit of a NIT given without it. Accepts dots and spaces; rejects anything else.

How holidays are computed

Rule Holidays
Fixed date Año Nuevo, Día del Trabajo, Independencia (Jul 20), Batalla de Boyacá (Aug 7), Inmaculada Concepción, Navidad
Moved to the next Monday (Ley 51 de 1983) Reyes Magos, San José, San Pedro y San Pablo, Asunción, Día de la Raza, Todos los Santos, Independencia de Cartagena
Relative to Easter Jueves and Viernes Santo; Ascensión, Corpus Christi and Sagrado Corazón (already on Monday)

The tests check the result against the official 2025 and 2026 calendars.

Development

pip install -e . pytest
pytest

See CONTRIBUTING.md. Planned work (validators, peso formatting, DANE codes, CLI, PyPI release) is in ROADMAP.md.

License

MIT

Metadata

Release files for colombia-utils 0.2.0

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

Source distribution (sdist)

Source distribution for colombia-utils 0.2.0
File Size Uploaded Provenance Actions
colombia_utils-0.2.0.tar.gz 7.9 kB With provenance Details for colombia_utils-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for colombia-utils 0.2.0
File Interpreter ABI Platform Actions
colombia_utils-0.2.0-py3-none-any.whl Python 3 none any Details for colombia_utils-0.2.0-py3-none-any.whl

Total release size: 13.9 kB

Release files / colombia_utils-0.2.0.tar.gz

Download URL colombia_utils-0.2.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c966b2a8408b2fd997fc89701d6a15a6e97d1a581763a7ad4f203e57a6f1dcf1
BLAKE2b-256 checksum
How to use checksums
585a396be0c156849354d85c97164a4a8bb6781bb329a8fdbed43ff37db962a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / colombia_utils-0.2.0-py3-none-any.whl

Download URL colombia_utils-0.2.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02bce9107f2a6a4650fe999cf80dc6a1336fc6eb8bafb2127daea90cf3d9df8d
BLAKE2b-256 checksum
How to use checksums
9c71cbfd9dba79c87d9a48664850e0ace54dac67c805f69e1e2f310374cebbe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for colombia-utils 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for colombia_utils-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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