Skip to main content

A tiny little library for handling business days with dates

Project description

business-days

This is a handful of functions that make working with business days easier. In this context, "business days" are Monday thru Friday, excluding certain bank holidays.

Install

pip install business-days

Usage

import business_days

# Simple day manipulation.
two_business_days_ago = business_days.days_to_now(timezone.now(), 2)

# More complex business hour calculations.
# Mon 07:00 -> Mon 18:30 (expected: 8 business hours)
assertEqual(8 * 3600, business_days.business_timediff(
    datetime(2016, 10, 17, 7),
    datetime(2016, 10, 17, 18, 30),
).total_seconds())

See the tests for more examples.

Note about developing this: If you are going to release a new version, don't forget to tag the release as v0.x.y (or whatever) so that it's easy to refer to specific versions from requirements.txt files.

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

business_days-0.0.8.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

business_days-0.0.8-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file business_days-0.0.8.tar.gz.

File metadata

  • Download URL: business_days-0.0.8.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for business_days-0.0.8.tar.gz
Algorithm Hash digest
SHA256 c915e090db051390a0d444021bd2ecb38cd5ee7c090c88f1bb807670f7e25a7e
MD5 0ca791ddd545d8e0b841e25a4476f2ee
BLAKE2b-256 cd29e3444d0a3bc3fa4f9ac0acfc29e716c6a40b56c13fc81796b25867d6399a

See more details on using hashes here.

Provenance

The following attestation bundles were made for business_days-0.0.8.tar.gz:

Publisher: publish.yml on FundersClub/business-days

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

File details

Details for the file business_days-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: business_days-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for business_days-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d231c09b85a258be9851cdd3ba52530d1e86cf48818e358074ee1abf0698b0d3
MD5 0a4443162c95560238a37c3cb084e112
BLAKE2b-256 592bbfa61d94240591ff51687aa04ea6aa1fd09fa34b3134f62b0a3cf35bf635

See more details on using hashes here.

Provenance

The following attestation bundles were made for business_days-0.0.8-py3-none-any.whl:

Publisher: publish.yml on FundersClub/business-days

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