{"id":21314464,"url":"https://github.com/polyconseil/bizdatim","last_synced_at":"2025-07-12T01:31:18.899Z","repository":{"id":6556311,"uuid":"7798040","full_name":"Polyconseil/bizdatim","owner":"Polyconseil","description":"Library for business hour arithmetic. Fork from https://bitbucket.org/shelldweller/python-bizdatetime.","archived":false,"fork":false,"pushed_at":"2016-11-22T23:39:44.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":46,"default_branch":"master","last_synced_at":"2024-10-03T21:15:50.284Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Polyconseil.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-24T13:01:54.000Z","updated_at":"2016-11-22T23:27:07.000Z","dependencies_parsed_at":"2022-08-27T18:10:19.348Z","dependency_job_id":null,"html_url":"https://github.com/Polyconseil/bizdatim","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fbizdatim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fbizdatim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fbizdatim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fbizdatim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Polyconseil","download_url":"https://codeload.github.com/Polyconseil/bizdatim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225778840,"owners_count":17522710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T18:13:10.052Z","updated_at":"2024-11-21T18:13:10.763Z","avatar_url":"https://github.com/Polyconseil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"ABOUT\n=====\n\n.. image:: https://secure.travis-ci.org/Polyconseil/bizdatim.png?branch=master\n    :target: http://travis-ci.org/Polyconseil/bizdatim/\n\n.. image:: https://img.shields.io/pypi/v/bizdatim.svg\n    :target: https://pypi.python.org.pypi/bizdatim/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/pyversions/bizdatim.svg\n    :target: https://pypi.python.org/pypi/bizdatim/\n    :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/wheel/bizdatim.svg\n    :target: https://pypi.python.org/pypi/bizdatim/\n    :alt: Wheel status\n\n.. image:: https://img.shields.io/pypi/l/bizdatim.svg\n    :target: https://pypi.python.org/pypi/bizdatim/\n    :alt: License\n\nbizdatim is a simple library for performing business day arithmetic.\n\nSource is hosted at https://github.com/Polyconseil/bizdatim.\n\n\nKNOWN LIMITATIONS\n=================\n\nRotating weekends/holidays are not supported (e.g., two days working, third day\noff).\n\nThe business hour arithmetic is limited to additions.\n\n\nDEFINITIONS\n===========\n\nWeekend\n    Weekly repeating non-business day. Weekend does not have to be at the end\n    (or beginning) or the week. Weekends do not have to be consecutive days.\n\nHoliday\n    Like weekend, holiday is a non-business day. Unlike weekend, holiday does\n    not have weekly regularity. It is just a date. Holiday can coincide with\n    weekend.\n\nWorking hours\n    The starting and ending time of a business day.\n\nPolicy\n    Is a (possibly empty) collection of weekends, holidays and working hours. All calculations\n    are performed within a policy.\n\n\nSAMPLE USAGE\n============\n\nAll business day arithmetic is performed in the context of policy::\n    \n    \u003e\u003e\u003e from bizdatim import Polycy, SAT, SUN\n    \u003e\u003e\u003e from datetime import date\n    \u003e\u003e\u003e policy = Policy(weekends=(SAT, SUN), holidays=(date(2011,7,1),))\n    \u003e\u003e\u003e day = date(2011, 6, 29) # Wednesday\n    \u003e\u003e\u003e print(policy.add(day, 2))  # add 2 business dates -\u003e Monday after the long weekend\n    datetime.date(2011, 7, 4)\n    \u003e\u003e\u003e print(policy.biz_day_delta(date(2011, 7, 4), date(2011, 6, 30)))  # one holiday, one weekend between\n    1\n\nThere is also the possibility to do arithmetic on business hours::\n\n    \u003e\u003e\u003e policy = Policy(weekends=(SAT, SUN), holidays=(date(2011,7,1)), hours=(time(8), time(20)))\n    \u003e\u003e\u003e day = datetime(2011, 6, 29, 14, 30)\n    \u003e\u003e\u003e policy.add(day, timedelta(days=1, hours=5))  # The day after, in the afternoon\n    datetime.datetime(2011, 6, 29, 19, 30)\n    \u003e\u003e\u003e policy.add(day, timedelta(days=1, hours=10))  # Too many hours, will finish the monday after the long weekend\n    datetime.datetime(2011, 7, 4, 12, 30)\n\nPolicy method docstrings contain more examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyconseil%2Fbizdatim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyconseil%2Fbizdatim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyconseil%2Fbizdatim/lists"}