Metadata-Version: 2.4
Name: business-days
Version: 0.0.8
Summary: A tiny little library for handling business days with dates
Author: FundersClub
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/FundersClub/business-days
Project-URL: Repository, https://github.com/FundersClub/business-days
Project-URL: Issues, https://github.com/FundersClub/business-days/issues
Keywords: business-days,workdays,dates,holidays,datetime
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# business-days

This is a handful of functions that make working with [business days](https://en.wikipedia.org/wiki/Business_day) easier. In this context, "business days" are Monday thru Friday, excluding [certain bank holidays](https://www.svb.com/holiday-schedule/).

## Install

```
pip install business-days
```

## Usage

```python
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](https://github.com/FundersClub/business-days/blob/master/tests/test_business_days.py).

*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.

