Skip to main content

Project to Gantt - Convert markdown project plans to GanttProject files

Project description

p2gan - Project to Gantt Converter

PyPI Version Python Versions License: MIT

p2gan (Project to Gantt) is a Python library enabling AI agents (Claude Code, Codex, and other coding assistants) to analyze diverse project materials—PDFs, code, markdown, documentation—and generate preliminary GanttProject (.gan) files based on discovered structure, dependencies, and file timestamps. Create professional Gantt charts programmatically without manual editing.

Note: GanttProject is a free, open-source project management application written in Java and maintained by BarDSoftware. p2gan is an independent tool that generates .gan files compatible with GanttProject, but is not affiliated with or endorsed by the GanttProject team.

Features

  • 🤖 AI-Assisted Analysis - Designed for AI agents to analyze diverse project materials and generate timelines
  • 🔧 Pure Python - Zero external dependencies, uses only Python stdlib
  • 📊 Full GanttProject Support - Tasks, resources, dependencies, milestones
  • 🏗️ Programmatic API - Build projects in Python code
  • 🎯 Project Analysis - Analyze project complexity and stakeholders
  • 🚀 CI/CD Ready - Integrate into automated workflows

Quick Start

Installation

pip install p2gan

Command Line Usage

Convert a project file to GanttProject format (markdown example):

p2gan convert project.md output.gan

Python API Usage

from ganttproject import Project, Task, Resource, GanttGenerator
from datetime import datetime

# Create a project
project = Project(
    name="My Software Project",
    start_date=datetime(2025, 1, 1)
)

# Add resources
developer = Resource(id=0, name="Alice", role="Developer")
project.add_resource(developer)

# Add tasks
task = Task(
    id=0,
    name="Setup Development Environment",
    duration=3,
    start_date=datetime(2025, 1, 1)
)
task.add_allocation(developer, load=100.0)
project.add_task(task)

# Generate GanttProject file
generator = GanttGenerator(project)
generator.save("my_project.gan")

Input Formats

p2gan can process various input formats. Here's an example using markdown for project plans:

# Project: Website Redesign

**Start Date:** 2025-01-15
**Duration:** 8 weeks

## Resources
- Alice Johnson (Frontend Developer)
- Bob Smith (Backend Developer)
- Carol White (Designer)

## Tasks
### Phase 1: Planning
- **Requirements Gathering** (5 days, Alice Johnson)
  - Priority: High
  - Progress: 0%

- **Design Mockups** (7 days, Carol White)
  - Dependencies: Requirements Gathering
  - Priority: High

### Phase 2: Development
- **Frontend Development** (15 days, Alice Johnson)
  - Dependencies: Design Mockups
  - Priority: Medium

## Milestones
- [ ] Planning Complete (2025-01-25)
- [ ] Design Approved (2025-02-03)

Supported Features

Task Management

  • ✅ Hierarchical tasks (unlimited nesting)
  • ✅ Task dependencies (FS, SS, FF, SF)
  • ✅ Task priorities (Low, Medium, High)
  • ✅ Progress tracking
  • ✅ Task constraints and deadlines
  • ✅ Custom fields

Resource Management

  • ✅ Resource roles and rates
  • ✅ Resource allocation percentages
  • ✅ Resource calendars
  • ✅ Vacation/unavailability periods

Dependencies

  • ✅ Finish-to-Start (FS)
  • ✅ Start-to-Start (SS)
  • ✅ Finish-to-Finish (FF)
  • ✅ Start-to-Finish (SF)
  • ✅ Lag/lead time

Examples

Check out the samples/ directory for example projects:

# Simple project
p2gan convert samples/sample_project.md my_gantt.gan

# Complex project with multiple phases
p2gan convert samples/dhg_ecosystem_project.md ecosystem.gan

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/ecphoria/p2gan
cd p2gan

# Install in development mode
pip install -e .[dev]

# Run tests
pytest

# Run linting
black src/p2gan/
flake8 src/p2gan/
mypy src/p2gan/

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=p2gan

# Run specific test file
pytest tests/test_models.py

Documentation

Full documentation is available at https://p2gan.readthedocs.io

Use Cases

  • Agile to Traditional Bridge - Convert sprint plans to Gantt charts
  • Documentation to Timeline - Transform markdown roadmaps to visual schedules
  • CI/CD Integration - Generate project reports in automated pipelines
  • Template-Based Planning - Maintain reusable project templates

Roadmap

  • Core functionality (v0.1.0)
  • Comprehensive test suite (v0.2.0)
  • Import from CSV/Excel (v0.3.0)
  • Export to HTML/PDF (v0.4.0)
  • Web UI (v0.5.0)
  • AI-powered planning (v1.0.0)

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE for details.

Acknowledgments

  • GanttProject by BarDSoftware for creating and maintaining the excellent open-source project management application
  • The GanttProject team for their well-documented .gan XML file format
  • Contributors and early adopters
  • Anthropic Claude for development assistance

Support

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

p2gan-0.1.1.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

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

p2gan-0.1.1-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file p2gan-0.1.1.tar.gz.

File metadata

  • Download URL: p2gan-0.1.1.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for p2gan-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ddf243648c713db2efae403c8e1191e8e376e6f156887ebf12f1c1e5d70a70f8
MD5 ce7cb165047138dd582f4975087296e9
BLAKE2b-256 ccd2ed1cb35f26529e460dbbd5221d51c2681463a9be8088a6692f588d55935b

See more details on using hashes here.

File details

Details for the file p2gan-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: p2gan-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for p2gan-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ecf1cef3ad1482e52dbe941c2266c21bd5f0f66df06f1bf7b2d64afe7c9b9ac
MD5 c44d96e0888c079eb47cf545d57f3b83
BLAKE2b-256 6ba06e828efb1afd8194d2fb99315369be076d27594b8e33724f25a1e4d3e022

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