Skip to main content

Task scheduler with automatic resource leveling.

Project description

Task scheduler with automatic resource leveling

PyPI Build Status

The task scheduler reads one or more YAML or JSON configuration files, that includes:

  • project general information
  • list of resources
  • list of tasks.

The output is a work plan, with the tasks automatically assigned to resources ("resource leveling"), as YAML format (or JSON).

The goal is to find the best possible end date (as soon as possible).

The internal algorithm follows these rules:

  • efficient use of resources, if possible 100%, with no overload at all
  • long tasks may be carried out in parallel by several people.

The work plan can be converted to text or HTML (see examples below).

Dependencies

Tasksched requires Python ≥ 3.7 and:

You can install dependencies in a virtual environment with:

pip install -r requirements.txt

Usage

Input

The input data is written in YAML or JSON format. One or more files are accepted, each one overwrites any file previously loaded.

The main keys in the input are:

  • project: project description (object, required)
  • resources: list of resources (list, required)
  • tasks: list of tasks (list, required)

The project keys are:

  • name: the project name (string, required)
  • start: the start date, auto-adjusted to the next business day if needed (for a JSON file, it must be a string with format YYYY-MM-DD) (default: today)
  • holidays: the country ISO code used to skip holidays in work plan (for the list of valid country ISO codes, see: python-holidays) (string)

For each resource, the keys are:

  • id: the resource id (string, required)
  • name: the resource name (string, default: same as id)

For each task, the keys are:

  • id: the task id (string, required)
  • title: the task title (string, default: same as id)
  • duration: the task duration in days, rounded to the next largest integer (if ≤ 0, the task is ignored) (float, required)
  • priority: the task priority: a higher priority uses the task first in the work plan, a negative number makes the task less urgent than the others (integer, default: 0)
  • max_resources: the max number of resources to use for this task (integer, default: 2)

Content of files can be read from standard input or filenames are allowed as command line arguments. Both can be used at same time.

The command tasksched allows three main actions:

  • workplan: build an optimized work plan using project/resources/tasks info in input; the output is YAML data (or JSON)
  • text: convert output of workplan action to text for display in the terminal (colors and unicode chars are used by default but optional)
  • html: convert output of workplan action to HTML for display in a web browser (template and CSS can be customized).

Two extra actions are available as shortcuts (build and convert work plan in a single action):

  • workplan_text: build the work plan and convert it to text for display in the terminal (colors and unicode chars are used by default but optional)
  • workplan_html: build the work plan and convert it to HTML for display in a web browser (template and CSS can be customized).

See examples of input files in the examples directory.

Examples

Standard input and multiple YAML files

You can pipe content of YAML/JSON files as tasksched input.

The following example uses:

  • another program called extract-tasks to extract tasks from a ticketing tool
  • a project configuration file (project.yaml)
  • a resources configuration file (team.yaml)
  • an extra-tasks configuration file, these tasks are added to the tasks received on standard input (extra_tasks.yaml)

So you can build the work plan and convert it to text for display with this command:

$ extract-tasks | tasksched workplan project.yaml team.yaml extra_tasks.yaml | tasksched text

Or using the shortcut workplan_text:

$ extract-tasks | tasksched workplan_text project.yaml team.yaml extra_tasks.yaml

Build of work plan

Example of YAML work plan:

$ tasksched workplan examples/project_small.yaml
workplan:
  project:
    name: The small project
    start: 2020-12-03
    end: 2020-12-09
    duration: 5
    holidays_iso: FRA
    holidays: []
    resources_use: 70.0
  resources:
  - id: dev1
    name: Developer 1
    assigned:
    - task: '1'
      duration: 5
    assigned_tasks:
    - id: '1'
      title: The first feature
    duration: 5
    end: 2020-12-09
    use: 100.0
  - id: dev2
    name: Developer 2
    assigned:
    - task: '2'
      duration: 2
    assigned_tasks:
    - id: '2'
      title: The second feature
    duration: 2
    end: 2020-12-04
    use: 40.0
  tasks:
  - id: '1'
    title: The first feature
    duration: 5
    priority: 0
    max_resources: 1
  - id: '2'
    title: The second feature
    duration: 2
    priority: 0
    max_resources: 2

Work plan as text

Example of work plan converted to text for display:

Tasksched

Work plan as HTML

The generated HTML and CSS can be customized.

Tasksched comes with one default template and two default CSS:

Example of work plan converted to HTML with the default "dark" theme:

$ tasksched workplan_html examples/project_big.yaml > tasksched.html

With "light" theme (white background):

$ tasksched workplan_html --css light examples/project_big.yaml > tasksched.html

Copyright

Copyright © 2020-2021 Sébastien Helleu

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Project details


Download files

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

Source Distribution

tasksched-0.5.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distributions

tasksched-0.5.0-py3.9.egg (61.1 kB view details)

Uploaded Source

tasksched-0.5.0-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file tasksched-0.5.0.tar.gz.

File metadata

  • Download URL: tasksched-0.5.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.2

File hashes

Hashes for tasksched-0.5.0.tar.gz
Algorithm Hash digest
SHA256 91bbfce6db80f9d6e71b2511801b7ac65339ce744810b576a02a81cf4079a0d7
MD5 9ebfe66bbf5e4bac9806054390c411c9
BLAKE2b-256 8b7b84fbf4ea561d1872d3fa668f9431bccbc9176f375ba341b9e8be67bae45d

See more details on using hashes here.

File details

Details for the file tasksched-0.5.0-py3.9.egg.

File metadata

  • Download URL: tasksched-0.5.0-py3.9.egg
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.2

File hashes

Hashes for tasksched-0.5.0-py3.9.egg
Algorithm Hash digest
SHA256 01ee85bdc89f534c2f010794ba1b71fdadce81ff235bec296194e4e74ebabd2f
MD5 492f6c3a5113d7d94dc126769d01c347
BLAKE2b-256 da09ed107bc3e1c6049bb36be3d30793b6db1dba6eed18fc706c21ac136ffc02

See more details on using hashes here.

File details

Details for the file tasksched-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: tasksched-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 44.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.2

File hashes

Hashes for tasksched-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3dd5c3bbab1185011d4c897fa0728e900b1bd4dd6f0f15e34d3a1e9c59cda08b
MD5 433d88c23d54f0ffb30f957295c272c0
BLAKE2b-256 1e6c48d49a824e47d3e9bb412c8158f333c7d313e1e1623549a61c923451f4a9

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