Giter VIP home page Giter VIP logo

gantt's Introduction

Test

README

Gantt is a python class to produce, well, Gantt charts. The charts are kept (very) simple, using a discreet time scale, unicolor bars and optional milesstones.

Background

Gantt charts are commonly used in project management. I wanted to make one myself and LibreProject was way too involved for the project in question. Hence I used OpenOffice Calc and made a plain horizontal bar chart. That took little time but was ok. Then I needed to add milestones (basically just a marker) to the chart. I completely failed doing this in OpenOffice (and still don't know how to do that ...).

Long story short: I don't know how to excel.

Basic usage

from gantt import Gantt
g = Gantt('./sample.json')
g.render()
g.show()                # or save w/ g.save('foo.png')

Or simply call runner.py

Data structure

All data is provided as a JSON structure that has to contain:

  • a key packages containing an array of package definitions with label, end and start. Start and end values are discreet.
  • a title string (may contain TeX, escaped)
{
  "packages": [
    { "label" : "WP 1-1",
      "start": 0,
      "end": 2,
      "milestones" : [2],
      "legend": "worker one"
    },
    { "label" : "WP 1-2",
      "start": 2,
      "end": 4,
      "milestones" : [3, 4]
    }
  ],
  "title" : " Sample GANTT for \\textbf{myProject}",
  "xlabel" : "time (weeks)",
  "xticks" : [2,4,6,8,10,12]
}

The milestones, colors and legend entry are optional as are the label for the x-axis and the definition of the tickmarks. The title may contain TeX, but make sure your system supports it. For

See sample.json for the data used to produce the image below.

Installation

The requirements are rather limited and can installed from the requirements file. I recommend using a virtual environment for that:

# virtualenv setup, recommended
python3 -m venv .venv
source .venv/bin/activate
# actual install for requirements
pip install -r requirements.txt
# to install dev dependencies too run
# pip install -r requirements-dev.txt

ToDo

  • nicer data structure (JSON) ✅
  • dedicated class for packages ✅
  • dynamic TeX support ✅
  • add parameter object/dict for more control over colors etc 🚧

Screenshot

Sample Gantt with milestone

See sample.json for definition.

Supported Versions

Support is a bit much to say. The initial version was developed on 3.6 and worked just fine. With github-actions I can only test 3.7+ and this works fine (up to 3.12 currently). But basically, if you get numpy/matplotlib to run, all should be fine.

gantt's People

Contributors

signmypublickey avatar stefanpaxlife avatar stefanschinkel avatar thechymera avatar willu47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gantt's Issues

due to Typeerror I can get the graph!

I have used the sample.json

In my case, it gives the following error:
TypeError: object of type 'map' has no len()

and shows only skull of the graph:
foo

No LICENSE file

What is gantt licensed under?

Btw, kudos to you! We're using gantt in our project, an open source multi-level feedback queue simulator. Thanks for making this project!

Matplotlib figure handling

The figures look like they are drawn with matplotlib. Would one be able to capture the figure with:

import matplotlib.pyplot as plt
...
g.render()
a = plt.gcf()

?

setup.py?

Hello, I am looking to package your software and make it available via the package manager of the Gentoo Linux (and derivative) distributions.

Commonly, for Python packages, a setup.py file is expected. Could you please create one? If not, would you be willing to pull one if it was contributed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.