elegantt


Nameelegantt JSON
Version 0.0.9 PyPI version JSON
download
home_pagehttp://github.com/usop4/elegantt
SummaryThis is a gantt chart drawing library
upload_time2024-12-08 01:42:56
maintainerNone
docs_urlNone
authorTakayuki Uehara
requires_python~=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![PyPI - Version](https://img.shields.io/pypi/v/elegantt)
[![Downloads](https://static.pepy.tech/badge/elegantt)](https://pepy.tech/project/elegantt)


# elegantt

## Overview

elegantt is gantt chart drawing library designed for developers and project managers who need to visualize project timeline efficiently. With support for both CSV and Mermaid formats. elegantt provides the flexibility and functionality you need to keep your projects on task.

![elegantt_colab](https://github.com/usop4/github_actions_test/assets/44801/91b86c6b-30a4-42df-aedf-567957f8dabc)

## Features

- Simpe and intuitive API
- Supports both CSV and Mermaid Gantt chart formats
- customizable chat size and colors
- Command line interface for quick usage
- Cross-platform support

## Installation

Install elegantt via pip:
```sh
pip install elegantt
```

## Fonts Installation

To ensure proper rendering of text, install the necessary fonts:

on Ubuntsu
```sh
apt install fonts-noto-cjk
```

on RedHat/RockyLinux
```sh
yum install google-noto-sans-cjk-ttc-fonts.noarch
```

on Mac
```sh
yum install google-noto-sans-cjk-ttc-fonts.noarch
```

## Usage

### Command Line interface

Generate a Gantt chart from CSV file:

```sh
elegantt --fname sample.csv --out sample.png
```

CSV Format Example

```txt
2023-01-01,2023-01-04,Task 1
2023-01-02,2023-01-05,Task 2
2023-01-04,2023-01-06,Task 3
```

generate a Gantt chart from a Mermaid format:

```sh
elegantt --fname sample_mermaid.txt --out sample.png
```

Mermaid Format Example

```
gantt
    section task a
    task b            :active,  des2, 2024-05-20, 4d
    task c            :         des3, after des2, 7d
```

generate a Gantt chart from a Mermaid format:

```sh
elegantt --fname sample_markdown.md --out sample.png
```

Markdown Format Example

```
|2024-06-15|2024-06-18|task a|
|2024-06-20|2d        |task b|
|3d        |          |task c|
```

### As a library

integrate elegantt into your python projects for advanced usage:

```py
import elegantt

# Define chart properties
chartsize = (720,320)
bgcolor = (255,255,255)

# Create a Gant chart object
gchart = elegantt.EleGantt( chartsize, bgcolor, today="2019-10-15")

# Draw calendar and campains
gchart.draw_calendar()
gchart.draw_campain("2019-10-15","2019-10-18","Task 1")
gchart.draw_campain("2019-10-20","2019-10-23","Task 2")
gchart.draw_campain("2019-10-24","2019-10-30","Task 3")
gchart.save("gantt_chart.png")
```

or auto_draw for mermaid or markdown format

```py
import elegantt

s = """
    task a  :done, des1, 2024-06-15, 2024-06-18
    task b  :active, des2, 2024-06-20, 2d
    task c  :         des3, after des2, 3d
"""
gchart = elegantt.EleGantt(today="2024-06-18")
gchart.auto_draw(s, mode="mermaid")
gchart.save("gantt_chart.png")
```

If you want to specify fonts, write `set_font()` before `draw_calendar()` or `auto_draw()`.

```py
import elegantt

s = """
    task a  :done, des1, 2024-06-15, 2024-06-18
    task b  :active, des2, 2024-06-20, 2d
    task c  :         des3, after des2, 3d
"""
gchart = elegantt.EleGantt(today="2024-06-18")
gchart.set_font("C:\Windows\Fonts\meiryo.ttc")
gchart.auto_draw(s, mode="mermaid")
gchart.save("gantt_chart.png")
```

If you want to draw gantt chart on Google colab, import IPython and write like this.

```py
import elegantt
from IPython.display import display

g = elegantt.EleGantt()
s = """
Task A: 2024-07-08,3d
Taks B: 3d
"""
g.auto_draw(s)
display(g.im)
```

You can set holidays like this.

```py
gchart = elegantt.EleGantt(today="2024-06-18")
gchart.set_holidays(["2024-06-19",2024-06-25])
```

You can also set holidays with holidays lib.

```py
import holidays
import pandas as pd

jp_holiday = holidays.country_holidays('JP')
my_holidays = []
days = 10

date_list = pd.date_range(
    start=pd.Timestamp("today").normalize(),
    end=pd.Timestamp("today")+pd.Timedelta(days=days)
).tolist()

for date in date_list:
  if date in jp_holiday:
    print(date, jp_holiday.get(date))
    my_holidays.append(date.strftime('%Y-%m-%d'))
  else:
    print(date)

gchart.set_holidays(my_holidays)
```


## Lisence

This project is licensed under the MIT License, see the LICENSE.txt file for details

## Contributing

We welcome contributions!

## Support

For support or any questions, feel free to open an issue on our Github page.





            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/usop4/elegantt",
    "name": "elegantt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Takayuki Uehara",
    "author_email": "t.uehara@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c7/13/85099be2929164164aa14c6f64014078eaf1a4ef5eae3e225b4cc5f699ed/elegantt-0.0.9.tar.gz",
    "platform": null,
    "description": "![PyPI - Version](https://img.shields.io/pypi/v/elegantt)\n[![Downloads](https://static.pepy.tech/badge/elegantt)](https://pepy.tech/project/elegantt)\n\n\n# elegantt\n\n## Overview\n\nelegantt is gantt chart drawing library designed for developers and project managers who need to visualize project timeline efficiently. With support for both CSV and Mermaid formats. elegantt provides the flexibility and functionality you need to keep your projects on task.\n\n![elegantt_colab](https://github.com/usop4/github_actions_test/assets/44801/91b86c6b-30a4-42df-aedf-567957f8dabc)\n\n## Features\n\n- Simpe and intuitive API\n- Supports both CSV and Mermaid Gantt chart formats\n- customizable chat size and colors\n- Command line interface for quick usage\n- Cross-platform support\n\n## Installation\n\nInstall elegantt via pip:\n```sh\npip install elegantt\n```\n\n## Fonts Installation\n\nTo ensure proper rendering of text, install the necessary fonts:\n\non Ubuntsu\n```sh\napt install fonts-noto-cjk\n```\n\non RedHat/RockyLinux\n```sh\nyum install google-noto-sans-cjk-ttc-fonts.noarch\n```\n\non Mac\n```sh\nyum install google-noto-sans-cjk-ttc-fonts.noarch\n```\n\n## Usage\n\n### Command Line interface\n\nGenerate a Gantt chart from CSV file:\n\n```sh\nelegantt --fname sample.csv --out sample.png\n```\n\nCSV Format Example\n\n```txt\n2023-01-01,2023-01-04,Task 1\n2023-01-02,2023-01-05,Task 2\n2023-01-04,2023-01-06,Task 3\n```\n\ngenerate a Gantt chart from a Mermaid format:\n\n```sh\nelegantt --fname sample_mermaid.txt --out sample.png\n```\n\nMermaid Format Example\n\n```\ngantt\n    section task a\n    task b            :active,  des2, 2024-05-20, 4d\n    task c            :         des3, after des2, 7d\n```\n\ngenerate a Gantt chart from a Mermaid format:\n\n```sh\nelegantt --fname sample_markdown.md --out sample.png\n```\n\nMarkdown Format Example\n\n```\n|2024-06-15|2024-06-18|task a|\n|2024-06-20|2d        |task b|\n|3d        |          |task c|\n```\n\n### As a library\n\nintegrate elegantt into your python projects for advanced usage:\n\n```py\nimport elegantt\n\n# Define chart properties\nchartsize = (720,320)\nbgcolor = (255,255,255)\n\n# Create a Gant chart object\ngchart = elegantt.EleGantt( chartsize, bgcolor, today=\"2019-10-15\")\n\n# Draw calendar and campains\ngchart.draw_calendar()\ngchart.draw_campain(\"2019-10-15\",\"2019-10-18\",\"Task 1\")\ngchart.draw_campain(\"2019-10-20\",\"2019-10-23\",\"Task 2\")\ngchart.draw_campain(\"2019-10-24\",\"2019-10-30\",\"Task 3\")\ngchart.save(\"gantt_chart.png\")\n```\n\nor auto_draw for mermaid or markdown format\n\n```py\nimport elegantt\n\ns = \"\"\"\n    task a  :done, des1, 2024-06-15, 2024-06-18\n    task b  :active, des2, 2024-06-20, 2d\n    task c  :         des3, after des2, 3d\n\"\"\"\ngchart = elegantt.EleGantt(today=\"2024-06-18\")\ngchart.auto_draw(s, mode=\"mermaid\")\ngchart.save(\"gantt_chart.png\")\n```\n\nIf you want to specify fonts, write `set_font()` before `draw_calendar()` or `auto_draw()`.\n\n```py\nimport elegantt\n\ns = \"\"\"\n    task a  :done, des1, 2024-06-15, 2024-06-18\n    task b  :active, des2, 2024-06-20, 2d\n    task c  :         des3, after des2, 3d\n\"\"\"\ngchart = elegantt.EleGantt(today=\"2024-06-18\")\ngchart.set_font(\"C:\\Windows\\Fonts\\meiryo.ttc\")\ngchart.auto_draw(s, mode=\"mermaid\")\ngchart.save(\"gantt_chart.png\")\n```\n\nIf you want to draw gantt chart on Google colab, import IPython and write like this.\n\n```py\nimport elegantt\nfrom IPython.display import display\n\ng = elegantt.EleGantt()\ns = \"\"\"\nTask A: 2024-07-08,3d\nTaks B: 3d\n\"\"\"\ng.auto_draw(s)\ndisplay(g.im)\n```\n\nYou can set holidays like this.\n\n```py\ngchart = elegantt.EleGantt(today=\"2024-06-18\")\ngchart.set_holidays([\"2024-06-19\",2024-06-25])\n```\n\nYou can also set holidays with holidays lib.\n\n```py\nimport holidays\nimport pandas as pd\n\njp_holiday = holidays.country_holidays('JP')\nmy_holidays = []\ndays = 10\n\ndate_list = pd.date_range(\n    start=pd.Timestamp(\"today\").normalize(),\n    end=pd.Timestamp(\"today\")+pd.Timedelta(days=days)\n).tolist()\n\nfor date in date_list:\n  if date in jp_holiday:\n    print(date, jp_holiday.get(date))\n    my_holidays.append(date.strftime('%Y-%m-%d'))\n  else:\n    print(date)\n\ngchart.set_holidays(my_holidays)\n```\n\n\n## Lisence\n\nThis project is licensed under the MIT License, see the LICENSE.txt file for details\n\n## Contributing\n\nWe welcome contributions!\n\n## Support\n\nFor support or any questions, feel free to open an issue on our Github page.\n\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "This is a gantt chart drawing library",
    "version": "0.0.9",
    "project_urls": {
        "Homepage": "http://github.com/usop4/elegantt"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11104c58e66923091ab32ef6feae145ae3e64bed15a01f1e9567a443f0aecdfe",
                "md5": "7df60d84521608013197a8e75d44fc01",
                "sha256": "b1c24325216e0bffea38efa37813669484b41dd7e8fbfa0f1eee0a36f6a5f987"
            },
            "downloads": -1,
            "filename": "elegantt-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7df60d84521608013197a8e75d44fc01",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 8635,
            "upload_time": "2024-12-08T01:42:54",
            "upload_time_iso_8601": "2024-12-08T01:42:54.946250Z",
            "url": "https://files.pythonhosted.org/packages/11/10/4c58e66923091ab32ef6feae145ae3e64bed15a01f1e9567a443f0aecdfe/elegantt-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c71385099be2929164164aa14c6f64014078eaf1a4ef5eae3e225b4cc5f699ed",
                "md5": "107d6109adcd4356759db0277b309cd9",
                "sha256": "36db751ceefb0d7dfe15d1929f4d4dacc8cc0d5ee10bc253a042bd9c85b10fe7"
            },
            "downloads": -1,
            "filename": "elegantt-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "107d6109adcd4356759db0277b309cd9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 9534,
            "upload_time": "2024-12-08T01:42:56",
            "upload_time_iso_8601": "2024-12-08T01:42:56.571237Z",
            "url": "https://files.pythonhosted.org/packages/c7/13/85099be2929164164aa14c6f64014078eaf1a4ef5eae3e225b4cc5f699ed/elegantt-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-08 01:42:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "usop4",
    "github_project": "elegantt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "elegantt"
}
        
Elapsed time: 0.60745s