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

Not on PyPI yet (see the roadmap). Install from GitHub:

pip install git+https://github.com/kilianvega-dev/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.1.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.1.0
File Size Uploaded Provenance Actions
colombia_utils-0.1.0.tar.gz 7.6 kB Without provenance Details for colombia_utils-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 13.4 kB

Release files / colombia_utils-0.1.0.tar.gz

Download URL colombia_utils-0.1.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
88e1f6cb89626ac9efc2b6980c3e68a25c4e748c50671d28d810d430c4464202
BLAKE2b-256 checksum
How to use checksums
554c8cd080900ce4debc4305856b5287ab1e1f37bea602aeca820b71a0689f85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

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

Download URL colombia_utils-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c87ca4d273d26f7d9c0800b8fd1b511572c330e3b3b1dca81607dc965446708d
BLAKE2b-256 checksum
How to use checksums
0fd561a827f7048139629a568b1c4ebedb20906696e12d021603a7f248380e76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for colombia-utils 0.1.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.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No 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