Skip to main content

python-gantt-csv manage gantt.Task arguments with csv format.

Project description

python-gantt-csv manages the arguments of gantt.Task in csv format and resolves dependencies between tasks.
You will be able to edit tasks without worrying about the order in which you define them.

Requirements

This projects needs the following libraries:

Additionnal requirements

Installation

pip install python-gantt-csv

Definition of Task Arguments in CSV Format

column name

valid value

name

str

start

‘today’ or iso format date (Ex: ‘2014-12-26’)

duration

int

percent_done

int

resources

‘None’ or str or colon separated str (Ex: ‘ANO:JLS’)

depends_of

‘None’ or unique str or colon separated unique str (Ex: ‘1:2’)

color

Hex color (Ex: #FF8080)

id

unique str

Usage

Directory structure

.
├── example1.csv
├── example2.csv
└── example.py

Run example

python example.py

example1.csv

name,start,depends_of,duration,percent_done,resources,color,id
tache1,2014-12-25,None,4,44,ANO,#FF8080,1
tache2,2014-12-28,None,6,0,JLS,#c70039,2
tache3,2014-12-25,1:2:6,5,50,ANO:JLS,#f37121,3
tache4,2015-01-01,1,4,40,JLS,#c0e218,4
tache6,2014-12-25,6,4,0,ANO:JLS,#f37121,5
tache7,2014-12-28,None,6,0,JLS,#c0e218,6
tache8,today,6,4,0,ANO:JLS,#111d5e,7

example2.csv

name,start,depends_of,duration,percent_done,resources,color,id
tache5,2014-12-23,None,3,0,ANO:JLS,#f37121,1

example.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import datetime
from pathlib import Path

import gantt

from gantt_csv import create_project_from_csv, get_resources


YMD_VACATIONS = [
    (2014, 12, 30),
    (2014, 12, 31),
    (2015, 1, 1),
    (2015, 1, 2),
]


# Change font default
gantt.define_font_attributes(fill='black',
                             stroke='black',
                             stroke_width=0,
                             font_family="Verdana")

# Add vacations for everyone
for year, month, date in YMD_VACATIONS:
    gantt.add_vacations(datetime.date(year, month, date))

# Create project from csv files
projects = []
for csv_path in Path('.').glob('*.csv'):
    p1 = create_project_from_csv(csv_path)
    projects.append(p1)

# Create parent project
parent_project = gantt.Project(name='Parent Project')
# which contains the other projects
for project in projects:
    parent_project.add_task(project)

# MAKE DRAW
parent_project.make_svg_for_tasks(filename='test_full.svg',
                                  today=datetime.date.today(),
                                  start=datetime.date(2014, 12, 20),
                                  end=datetime.date(2015, 2, 20))
parent_project.make_svg_for_resources(filename='test_resources.svg',
                                      today=datetime.date.today(),
                                      resources=get_resources())
parent_project.make_svg_for_tasks(filename='test_weekly.svg',
                                  today=datetime.date.today(),
                                  scale=gantt.DRAW_WITH_WEEKLY_SCALE)

Licence

GPL v3 or any later version

Author

Shota Horie (horie.shouta at gmail.com)

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

python-gantt-csv-0.1.0.tar.gz (83.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_gantt_csv-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file python-gantt-csv-0.1.0.tar.gz.

File metadata

  • Download URL: python-gantt-csv-0.1.0.tar.gz
  • Upload date:
  • Size: 83.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.10

File hashes

Hashes for python-gantt-csv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 117bec48a6e081c6cc06349b9a1d4183cd2d2f90af851752cc4f8ef0238e1107
MD5 9443ea6ad7ab90759c7dc80e32440d17
BLAKE2b-256 636421df71fb9290b86e34f9baa60a11ce8429313b57bd03b3299688c3ac7319

See more details on using hashes here.

File details

Details for the file python_gantt_csv-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: python_gantt_csv-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.10

File hashes

Hashes for python_gantt_csv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40326f2cb6a9e35dea26f891657720044d2b0de7ceac045d4a0d1cffb97f80f0
MD5 036903ed9a0ba45ece65124ada3f9cd8
BLAKE2b-256 b4057ceb5b63d54609479ebf4f33ccd0b3f85464ed00ec14905145aca55374c4

See more details on using hashes here.

Supported by

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