Skip to main content

Worldwide holidays and working days helper and toolkit.

Project description

Overview

Workalendar is a Python module that offers classes able to handle calendars, list legal / religious holidays and gives working-day-related computation functions.

Status

This is barely beta. Please consider this module as a work in progres.

Usage sample

>>> from datetime import date
>>> from workalendar.europe import France
>>> cal = France()
>>> cal.holidays(2012)
[(datetime.date(2012, 1, 1), 'New year'),
 (datetime.date(2012, 4, 9), 'Easter Monday'),
 (datetime.date(2012, 5, 1), 'Labour Day'),
 (datetime.date(2012, 5, 8), 'Victory in Europe Day'),
 (datetime.date(2012, 5, 17), 'Ascension Day'),
 (datetime.date(2012, 5, 28), 'Whit Monday'),
 (datetime.date(2012, 7, 14), 'Bastille Day'),
 (datetime.date(2012, 8, 15), 'Assumption of Mary to Heaven'),
 (datetime.date(2012, 11, 1), "All Saints' Day"),
 (datetime.date(2012, 11, 11), 'Armistice Day'),
 (datetime.date(2012, 12, 25), 'Christmas')]
>>> cal.is_working_day(date(2012, 12, 25))  # it's Christmas
False
>>> cal.is_working_day(date(2012, 12, 30))  # it's Sunday
False
>>> cal.is_working_day(date(2012, 12, 26))
True
>>> cal.add_working_days(date(2012, 12, 23), 5)  # 5 working days after Xmas
datetime.date(2012, 12, 31)

External dependencies

You may want to install python-dev and/or python3-dev on your machine to either run the installation or run tests via tox.

Tests

Travis status:

https://api.travis-ci.org/novapost/workalendar.png

To run test, just install tox with pip install tox and run:

tox

from the command line.

Available Calendars

Europe

  • Belgium

  • Czech Republic

  • Slovakia

  • European Central Bank

  • Finland

  • France

  • France (Alsace / Moselle)

  • Germany

  • Greece

  • Hungary

  • Iceland

  • Italy

  • Norway

  • Poland

  • Portugal

  • Sweden

  • United Kingdom (incl. Northern Ireland)

America

  • Brazil (incl. São Paulo state and city)

  • Chile

  • Colombia

  • Mexico

  • Panama

  • United States of America (including state holidays)

  • Canada (including provincial and territory holidays)

Asia

  • Japan

  • Qatar

  • South Korea

  • Taiwan

Oceania

  • Australia (incl. its different states)

  • Marshall Islands

Africa

  • Algeria

  • Benin

  • Ivory Coast

  • Madagascar

  • São Tomé

  • South Africa

And more to come (I hope!)

Caveats

Please take note that some calendars are not 100% accurate. The most common example is the Islamic calendar, where some computed holidays are not exactly on the same official day decided by religious authorities, and this may vary country by country. Whenever it’s possible, try to adjust your results with the official data provided by the adequate authorities.

Contributing

Please read our CONTRIBUTING.rst document to discover how you can contribute to workalendar. Pull-requests are very welcome.

License

This library is published under the terms of the MIT License. Please check the LICENSE file for more details.

Project details


Release history Release notifications | RSS feed

This version

0.4.1

Download files

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

Source Distribution

workalendar-0.4.1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distributions

workalendar-0.4.1.linux-x86_64.tar.gz (49.3 kB view details)

Uploaded Source

workalendar-0.4.1-py2-none-any.whl (25.2 kB view details)

Uploaded Python 2

File details

Details for the file workalendar-0.4.1.tar.gz.

File metadata

  • Download URL: workalendar-0.4.1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for workalendar-0.4.1.tar.gz
Algorithm Hash digest
SHA256 472c60761c3dd4950e5b5e221d88ba85463be964a5a1d749f5a21eb7a9254b07
MD5 00c61cd27c1ed3894e308f01d0a99e9b
BLAKE2b-256 a7bc386ef0dd368f7b774e1e74d7307be458d1d3a00b60898ebf3ab68f85dca2

See more details on using hashes here.

File details

Details for the file workalendar-0.4.1.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for workalendar-0.4.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 5b78f96e59d44cf2d48787e9e8aed6653390dad12fe1e346e6da920ae11cd84b
MD5 2cd3c0e791f2f1346a3a57794f9952d0
BLAKE2b-256 e1ff73e483a94d4e713c8a54559f5368ebae556c2626059a89d3f41d756b0221

See more details on using hashes here.

File details

Details for the file workalendar-0.4.1-py2-none-any.whl.

File metadata

File hashes

Hashes for workalendar-0.4.1-py2-none-any.whl
Algorithm Hash digest
SHA256 b12b98fce39c36df99d93eee5458cd7ba2c95ac1b4475949dc74024db7529670
MD5 6aaa5408c5bd5e930ed923bd2c45740e
BLAKE2b-256 6fa5e10390202d468c32f003947d788115af6d74e958a49e9d04551c6855f056

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page