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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c915e090db051390a0d444021bd2ecb38cd5ee7c090c88f1bb807670f7e25a7e
|
|
| MD5 |
0ca791ddd545d8e0b841e25a4476f2ee
|
|
| BLAKE2b-256 |
cd29e3444d0a3bc3fa4f9ac0acfc29e716c6a40b56c13fc81796b25867d6399a
|
Provenance
The following attestation bundles were made for business_days-0.0.8.tar.gz:
Publisher:
publish.yml on FundersClub/business-days
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
business_days-0.0.8.tar.gz -
Subject digest:
c915e090db051390a0d444021bd2ecb38cd5ee7c090c88f1bb807670f7e25a7e - Sigstore transparency entry: 1757115065
- Sigstore integration time:
-
Permalink:
FundersClub/business-days@ac6bf4f61b119ab63375416c548b077e40fce20b -
Branch / Tag:
refs/tags/v0.0.8 - Owner: https://github.com/FundersClub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac6bf4f61b119ab63375416c548b077e40fce20b -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d231c09b85a258be9851cdd3ba52530d1e86cf48818e358074ee1abf0698b0d3
|
|
| MD5 |
0a4443162c95560238a37c3cb084e112
|
|
| BLAKE2b-256 |
592bbfa61d94240591ff51687aa04ea6aa1fd09fa34b3134f62b0a3cf35bf635
|
Provenance
The following attestation bundles were made for business_days-0.0.8-py3-none-any.whl:
Publisher:
publish.yml on FundersClub/business-days
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
business_days-0.0.8-py3-none-any.whl -
Subject digest:
d231c09b85a258be9851cdd3ba52530d1e86cf48818e358074ee1abf0698b0d3 - Sigstore transparency entry: 1757115109
- Sigstore integration time:
-
Permalink:
FundersClub/business-days@ac6bf4f61b119ab63375416c548b077e40fce20b -
Branch / Tag:
refs/tags/v0.0.8 - Owner: https://github.com/FundersClub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac6bf4f61b119ab63375416c548b077e40fce20b -
Trigger Event:
release
-
Statement type: