Project to Gantt - Convert markdown project plans to GanttProject files
Project description
p2gan - Project to Gantt Converter
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
.ganfiles 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 p2gan 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/tensorworks-llc/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
- AI-Assisted Project Analysis - Enable AI agents to analyze codebases and generate timelines
AI Integration
p2gan is specifically designed to work with AI coding assistants like Claude Code, GitHub Copilot, and other LLM-based tools.
Using p2gan with AI Agents
See AI_PROMPT_EXAMPLE.md for comprehensive prompts to:
- Analyze any project (code, documentation, PDFs)
- Extract tasks from multiple sources
- Generate timeline based on git history and file dates
- Create preliminary .gan files for project planning
Quick Start with AI
"Analyze this project and create a Gantt chart using p2gan.
Check git history, documentation, and code structure to build
a comprehensive timeline."
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
.ganXML file format - Contributors and early adopters
- Anthropic Claude for development assistance
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Read the Docs
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file p2gan-0.1.2.tar.gz.
File metadata
- Download URL: p2gan-0.1.2.tar.gz
- Upload date:
- Size: 44.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
834a3c7ce5ba6c75fa4ac36e73d151716031362d1e45db2ad59b8fd8428c0eb1
|
|
| MD5 |
e50f79c28a9fb498effceccc0fbb7791
|
|
| BLAKE2b-256 |
671776ab266bbe25d0468b4fa4c49ee0393b6513b54d9677b483a733b208e895
|
File details
Details for the file p2gan-0.1.2-py3-none-any.whl.
File metadata
- Download URL: p2gan-0.1.2-py3-none-any.whl
- Upload date:
- Size: 42.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75ddd892ab7c74991f84ba28902482493570d25b7ef5db6766a760f4c54a1a74
|
|
| MD5 |
bc1995590dab709db13a1bf819ff6f15
|
|
| BLAKE2b-256 |
57343d1abbc675c4b7ffe5a5bf9e24aa5563d15964817993529751c34caeff86
|