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 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 .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.3.tar.gz (44.5 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.3-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: p2gan-0.1.3.tar.gz
  • Upload date:
  • Size: 44.5 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.3.tar.gz
Algorithm Hash digest
SHA256 a16dcb0d779a6c4840d4d7b45a0f0a440ab81b7ffaf8106c4d4dd04901bd60f3
MD5 54b9426371cb3c5e5a88ee15efc65449
BLAKE2b-256 df6697de98aa9acd83684a1b61a33a6c6d51dd6ebd751e985925780ae778d554

See more details on using hashes here.

File details

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

File metadata

  • Download URL: p2gan-0.1.3-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

Hashes for p2gan-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 71415626f78defd3fbf0c5d932eec03ec0a04c532e71a179decb39d5f444c29c
MD5 433ba1ab24eb15196fddc256b0553a56
BLAKE2b-256 da48ad7fed93c931ebc79dcb7d299ab3dd79eb2457ee0a176d83e6dbd00ca32a

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