All Projects → mmamaev → Timeboard

mmamaev / Timeboard

Licence: other
Calendar calculations over business days and work shifts

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Timeboard

Period
Complex period comparisons
Stars: ✭ 1,001 (+931.96%)
Mutual labels:  schedule
Hproxy
hproxy - Asynchronous IP proxy pool, aims to make getting proxy as convenient as possible.(异步爬虫代理池)
Stars: ✭ 62 (-36.08%)
Mutual labels:  schedule
Ioabstraction
Library for Arduino and mbed that abstracts pins and i2c expanders (8574, 23017), supports AVR and I2c AT24 EEPROMs, Rotary encoders, fully debounced switches and simple task management.
Stars: ✭ 84 (-13.4%)
Mutual labels:  schedule
Yesterday I Learned
Brainfarts are caused by the rupturing of the cerebral sphincter.
Stars: ✭ 50 (-48.45%)
Mutual labels:  business
Business 5min Notes
📖 5 分钟商学院精细笔记
Stars: ✭ 58 (-40.21%)
Mutual labels:  business
Wp Missed Schedule
Find only missed schedule posts, every 15 minutes, and republish correctly 10 items each session. The Original plugin (only this) no longer available on WordPress.org for explicit author request! Compatible with WP 2.1+ to 4.9+ and 5.0-beta3 (100.000+ installs 300.000+ downloads 2016-04-13) Please: do not install unauthorized malware cloned forked!
Stars: ✭ 69 (-28.87%)
Mutual labels:  schedule
Gantt Schedule Timeline Calendar
Gantt Gantt Gantt Timeline Schedule Calendar [ javascript gantt, js gantt, projects gantt, timeline, scheduler, gantt timeline, reservation timeline, react gantt, angular gantt, vue gantt, svelte gantt, booking manager ]
Stars: ✭ 990 (+920.62%)
Mutual labels:  schedule
Qt Client
This repository contains the source code for the Desktop client. The Desktop client is built using the Qt framework for C++. The client can be extended or customized using JavaScript. This client is used by all editions of xTuple ERP.
Stars: ✭ 93 (-4.12%)
Mutual labels:  business
Tensorhive
A user-friendly GPU management tool for distributed machine learning workloads
Stars: ✭ 61 (-37.11%)
Mutual labels:  schedule
Tui.calendar
🍞📅A JavaScript calendar that has everything you need.
Stars: ✭ 9,537 (+9731.96%)
Mutual labels:  schedule
Forcal
📅 Das AddOn ist ein variabel einsetzbarer Kalender(-Generator), Skedule, Newssystem, Event- und Terminplaner für REDAXO 5.x.
Stars: ✭ 52 (-46.39%)
Mutual labels:  schedule
React Native Timeline Listview
Timeline component for React Native App
Stars: ✭ 1,070 (+1003.09%)
Mutual labels:  schedule
Sleeptimepicker
Stars: ✭ 74 (-23.71%)
Mutual labels:  schedule
Node Hue Api
Node.js Library for interacting with the Philips Hue Bridge and Lights
Stars: ✭ 1,034 (+965.98%)
Mutual labels:  schedule
Davos
Web-based FTP automation for Linux servers.
Stars: ✭ 90 (-7.22%)
Mutual labels:  schedule
Opening Hours
Query and format a set of opening hours
Stars: ✭ 997 (+927.84%)
Mutual labels:  schedule
Crontab
Parse Cron Expressions, Compose Cron Expression Strings and Caluclate Execution Dates.
Stars: ✭ 62 (-36.08%)
Mutual labels:  schedule
Quick Plan
Defines and schedules Garmin workouts
Stars: ✭ 93 (-4.12%)
Mutual labels:  schedule
Forsun Laravel
高性能的定时调度服务。
Stars: ✭ 91 (-6.19%)
Mutual labels:  schedule
Jobber
An alternative to cron, with sophisticated status-reporting and error-handling
Stars: ✭ 1,217 (+1154.64%)
Mutual labels:  schedule

.. image:: https://timeboard.readthedocs.io/en/latest/_static/timeboard_logo.png :align: center :alt: timeboard logo

.. image:: https://img.shields.io/travis/mmamaev/timeboard.svg :alt: Travis build status :target: https://travis-ci.org/mmamaev/timeboard

.. image:: https://ci.appveyor.com/api/projects/status/github/mmamaev/timeboard?svg=true :alt: AppVeyor build status :target: https://ci.appveyor.com/project/mmamaev/timeboard

.. image:: https://img.shields.io/readthedocs/timeboard.svg :alt: Readthedocs build status :target: https://timeboard.readthedocs.io/

.. image:: https://img.shields.io/pypi/v/timeboard.svg :alt: Version available on PyPI :target: https://pypi.python.org/pypi/timeboard

.. image:: https://img.shields.io/github/release/mmamaev/timeboard.svg :alt: Release on Github :target: https://github.com/mmamaev/timeboard/releases


timeboard - business calendar calculations


timeboard creates schedules of work periods and performs calendar calculations over them. You can build standard business day calendars as well as a variety of other schedules, simple or complex.

.. pypi-start

Examples of problems solved by timeboard:

- If we have 20 business days to complete the project when will be the deadline? 

- If a person was employed from November 15 to December 22 and salary is paid monthly, how many month's salaries has the employee earned?

- The above-mentioned person was scheduled to work Mondays, Tuesdays, Saturdays, and Sundays on odd weeks, and Wednesdays, Thursdays, and Fridays on even weeks. The question is the same.

- A 24x7 call center operates in shifts of varying length starting at 02:00, 08:00, and 18:00. An operator comes in on every fourth shift and is paid per shift. How many shifts has the operator sat in a specific month?

- With employees entering and leaving a company throughout a year, what was the average annual headcount?

Based on pandas timeseries library, timeboard gives more flexibility than pandas's built-in business calendars. The key features of timeboard are:

  • You can choose any time frequencies (days, hours, multiple-hour shifts, etc.) as work periods.

  • You can create sophisticated schedules which can combine periodical patterns, seasonal variations, stop-and-resume behavior, etc.

  • There are built-in standard business day calendars (in this version: for USA, UK, and Russia).

Installation

::

pip install timeboard

timeboard is tested with Python versions 2.7, 3.6, 3.7, and 3.8.

Dependencies:

  • pandas >= 0.22
  • numpy >= 1.13
  • dateutil >= 2.6.1
  • six >= 1.11

The import statement to run all the examples: ::

>>> import timeboard as tb

Quick Start Guide

Set up a timeboard

To get started you need to build a timeboard (calendar). The simplest way to do so is to use a preconfigured calendar which is shipped with the package. Let's take a regular business day calendar for the United States. ::

>>> import timeboard.calendars.US as US
>>> clnd = US.Weekly8x5()

.. note:: If you need to build a custom calendar, for example, a schedule of shifts for a 24x7 call center, Making a Timeboard <https://timeboard.readthedocs.io/en/latest/making_a_timeboard.html>_ section of the documentation explains this topic in details.

Once you have got a timeboard, you may perform queries and calculations over it.

Play with workshifts

Calling a timeboard instance clnd with a single point in time produces an object representing a unit of the calendar (in this case, a day) that contains this point in time. Object of this type is called workshift.

Is a certain date a business day? ::

>>> ws = clnd('27 May 2017')
>>> ws.is_on_duty()
False

Indeed, it was a Saturday.

When was the next business day? ::

>>> ws.rollforward()
Workshift(6359) of 'D' at 2017-05-30

The returned calendar unit (workshift) has the sequence number of 6359 and represents the day of 30 May 2017, which, by the way, was the Tuesday after the Memorial Day holiday.

If we were to finish the project in 22 business days starting on 01 May 2017, when would be our deadline? ::

>>> clnd('01 May 2017') + 22
Workshift(6361) of 'D' at 2017-06-01

This is the same as: ::

>>> clnd('01 May 2017').rollforward(22)
Workshift(6361) of 'D' at 2017-06-01

Play with intervals

Calling clnd() with a different set of parameters produces an object representing an interval on the calendar. The interval below contains all workshifts of the months of May 2017.

How many business days were there in a certain month? ::

>>> may2017 = clnd('May 2017', period='M')
>>> may2017.count()
22

How many days off? ::

>>> may2017.count(duty='off')
9

How many working hours? ::

>>> may2017.worktime()
176.0

An employee was on the staff from April 3, 2017 to May 15, 2017. What portion of April's salary did the company owe them?

Calling clnd() with a tuple of two points in time produces an interval containing all workshifts between these points, inclusively. ::

>>> time_in_company = clnd(('03 Apr 2017','15 May 2017'))
>>> time_in_company.what_portion_of(clnd('Apr 2017', period='M'))
1.0

Indeed, the 1st and the 2nd of April in 2017 fell on the weekend, therefore, having started on the 3rd, the employee checked out all the working days in the month.

And what portion of May's? ::

>>> time_in_company.what_portion_of(may2017)
0.5

How many days had the employee worked in May?

The multiplication operator returns the intersection of two intervals. ::

>>> (time_in_company * may2017).count()
11

How many hours? ::

>>> (time_in_company * may2017).worktime()
88

An employee was on the staff from 01 Jan 2016 to 15 Jul 2017. How many years this person had worked for the company? ::

>>> clnd(('01 Jan 2016', '15 Jul 2017')).count_periods('A')
1.5421686746987953

Links

Documentation: https://timeboard.readthedocs.io/

GitHub: https://github.com/mmamaev/timeboard

PyPI: https://pypi.python.org/pypi/timeboard

.. pypi-end

License

BSD 3 Clause <LICENSE.txt>_

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].