Skip to main content

Python library for generating business dates for fast date operations and rich functionality.

Project description

Python library businessdate

Codeship Read the Docs GitHub GitHub release PyPI Version PyPI - Python Version PyPI Downloads PyPI Downloads

A fast, efficient Python library for generating business dates for simple and fast date operations.

>>> from businessdate import BusinessDate

>>> BusinessDate(2017,12,31) + '2 weeks'

>>> BusinessDate(20171231) + '2w'  # same but shorter

>>> BusinessDate(20180114).to_date(), 1, 14)

Typical banking business features are provided like holiday adjustments to move dates away from weekend days or holidays. As well as functionality to get year fractions depending on day count conventions as the lengths of interest payment periods.

Beside dates business periods can be created for time intervals like 10Y, 3 Months or 2b. Those periods can easily be added to or subtracted from business dates.

Moreover range style schedule generator are provided to systematic build a list of dates. Such are used to set up a payment schedule of loan and financial derivatives.

Example Usage

>>> from datetime import date
>>> from businessdate import BusinessDate, BusinessPeriod

>>> BusinessDate(year=2014, month=1, day=11)

>>> BusinessDate(date(2014,1,11))

>>> BusinessDate(20140111)

>>> BusinessDate('20140111')

>>> BusinessDate('2015-12-31')

>>> BusinessDate('31.12.2015')

>>> BusinessDate('12/31/2015')

>>> BusinessDate(42369)

>>> BusinessDate(20140101) + BusinessPeriod('1Y3M')

>>> BusinessDate(20140101) + '1Y3M'

>>> BusinessDate(20170101) - '1Y1D'

>>> BusinessDate() == BusinessDate(

>>> BusinessDate('1Y3M20140101')

For more examples see the documentation.


The latest stable version can always be installed or updated via pip:

$ pip install businessdate

Development Version

The latest development version can be installed directly from GitHub:

$ pip install --upgrade git+

or downloaded from


  1. decide which base class or inheritance for BusisnessDate is better:
    1. BaseDateFloat (float inheritance)
    2. BaseDateDatetimeDate ( inheritance)

2. store businessdays adjustment convention and holidays as private property of BusinessDate. The information should not get lost under BusinessPeriod operation. Decide which date determines convention and holidays of a BusinessRange.


Issues and Pull Requests are always welcome.


Code and documentation are available according to the Apache Software License (see LICENSE).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (45.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page