This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

That version has been completely rewritten and many functions have been redesigned and became slightly different from the earlier version.

In several countries and markets, to account the value of financial instruments, mainly bonds and derivatives, it is necessary the use of different rules to compute the way the days go by. Those rules are related to holidays which are intrinsically related to counties and local markets. Usually you have a list with the holidays and all you want is to find out the number of business days between two dates, nothing more. It is necessary for pricing properly the financial instrument. bizdays was implemented to do that, compute business days between two dates and other collateral effects like adjust a given date for the next or previous business day, and so forth. bizdays is a module without dependencies, what makes it appropriate for simple implementations.

bizdays is a small set of functions to help with calculations which make use of business days. It works based on a list of holidays which is passed as an argument. Its interface is simple and flexible operating on vector of dates. bizdays can be fairly used for fixed income calculations. Many countries make intense use of business days to price financial instruments, like bonds and derivatives.


>>> from bizdays import Calendar, load_holidays
>>> holidays = load_holidays('Brazil.txt') # Brazilian financial market holidays
>>> cal = Calendar(holidays, ['Sunday', 'Saturday'], name='Brazil')
>>> cal
Calendar: Brazil
Start: 2000-01-01
End: 2078-12-25
Holidays: 948

>>> cal.isbizday('2014-01-12')

>>> cal.isbizday('2014-01-13')

>>> cal.bizdays('2014-01-13', '2015-01-13')

>>> cal.adjust_next('2015-12-25'), 12, 28)

>>> cal.adjust_next('2015-12-28'), 12, 28)

>>> cal.adjust_previous('2014-01-01'), 12, 31)

>>> cal.adjust_previous('2014-01-02'), 1, 2)

>>> cal.seq('2014-01-02', '2014-01-07')
<generator object seq at 0x1092b02d0>

>>> list(cal.seq('2014-01-02', '2014-01-07'))
[, 1, 2),, 1, 3),, 1, 6),, 1, 7)]

>>> cal.offset('2014-01-02', 5), 1, 9)

>>> cal.getdate('15th day', 2002, 5), 5, 15)

>>> cal.getdate('15th bizday', 2002, 5), 5, 22)

>>> cal.getdate('last wed', 2002, 5), 5, 29)

>>> cal.getdate('first fri before last day ', 2002, 5), 5, 24)
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bizdays-v0.2.0.tar.gz (7.1 kB) Copy SHA256 Checksum SHA256 Source Oct 19, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting