Metadata-Version: 2.4
Name: forgepygen
Version: 1.0.2
Summary: AI-powered project generator that creates complete project structures from natural language descriptions using local Ollama models.
Author: Varanasi Teja
License-Expression: MIT
Project-URL: Homepage, https://github.com/varanasiteja2006/ForgePyGen
Project-URL: Documentation, https://github.com/varanasiteja2006/ForgePyGen
Project-URL: Source, https://github.com/varanasiteja2006/ForgePyGen
Project-URL: Issues, https://github.com/varanasiteja2006/ForgePyGen/issues
Keywords: ai,ollama,project-generator,code-generation,automation,python,developer-tools,scaffolding
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Dynamic: license-file

# ForgePyGen

> **Generate complete, production-ready project structures using local AI models powered by Ollama.**

ForgePyGen transforms natural language descriptions into fully scaffolded, ready-to-use projects — automatically creating folders, files, starter code, documentation, and configuration files. No cloud required. No API keys. Just pure local AI power.

---

## Table of Contents

- [Why ForgePyGen?](#why-forgepygen)
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [How It Works](#how-it-works)
- [Supported Project Types](#supported-project-types)
- [Example Prompts](#example-prompts)
- [API Reference](#api-reference)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
- [License](#license)
- [Author](#author)

---

## Why ForgePyGen?

Setting up a new project is repetitive. You create the same folders, write the same boilerplate, copy the same config files — every single time.

**ForgePyGen eliminates that.**

Describe what you want to build in plain English. ForgePyGen uses a local AI model to understand your intent and generate a complete, opinionated project scaffold in seconds — including starter code, a README, requirements files, and `.gitignore`.

Everything runs **locally** on your machine using [Ollama](https://ollama.com). No data leaves your system. No subscriptions. No limits.

---

## Features

| Feature | Description |
|---|---|
| **AI-Powered Generation** | Understands natural language and generates intelligent project structures |
| **Fully Local** | Powered by Ollama — no internet connection required after setup |
| **Complete Scaffolding** | Creates folders, files, starter code, README, requirements, and `.gitignore` |
| **Multi-Framework Support** | Works with Flask, Django, FastAPI, Data Science, CLI tools, and more |
| **Simple Python API** | Single function call to generate an entire project |
| **Fast & Lightweight** | Minimal dependencies, instant scaffolding |
| **Privacy First** | Your project descriptions never leave your machine |

---

## Requirements

ForgePyGen requires **Ollama** to be installed and running on your machine.

### 1. Install Ollama

Download and install Ollama from the official website:

```
https://ollama.com
```

### 2. Download a Model

Pull the recommended model:

```bash
ollama pull llama3.2:3b
```

> **Tip:** You can use any model supported by Ollama. Larger models (e.g., `llama3.1:8b`) produce richer scaffolds at the cost of speed.

### 3. Start Ollama

```bash
ollama serve
```

> Ollama must be running in the background whenever you use ForgePyGen.

---

## Installation

Install ForgePyGen via pip:

```bash
pip install forgepygen
```

Verify the installation:

```bash
python -c "import forgepygen; print('ForgePyGen ready!')"
```

---

## Quick Start

Generate a complete project with a single function call:

```python
import forgepygen

forgepygen.generate(
    "Create a Student Management System with admin, teacher, and student modules"
)
```

That's it. ForgePyGen will:

1. Send your description to Ollama
2. Receive a structured JSON project plan
3. Create all folders and files on disk
4. Return the generated project name

---

## How It Works

```
Your Description
      │
      ▼
 ForgePyGen Client
      │
      ▼
 Ollama (Local LLM)
      │
      ▼
 JSON Project Blueprint
      │
      ▼
 File & Folder Creation
      │
      ▼
 Ready-to-Use Project
```

### Step-by-Step

1. **You describe** your project in plain English
2. **ForgePyGen sends** the description to a locally running Ollama model
3. **The AI returns** a structured JSON blueprint of the project
4. **ForgePyGen creates** all folders, files, starter code, and documentation
5. **Your project is ready** — open it in your editor and start building

---

## Example

### Input

```python
import forgepygen

forgepygen.generate(
    "Create a Flask blog application with authentication, templates, static files, and database support"
)
```

### Generated Output

```
Flask Blog Application/
│
├── templates/
│   ├── base.html
│   ├── index.html
│   ├── login.html
│   └── post.html
│
├── static/
│   ├── css/
│   └── js/
│
├── database/
│   └── models.py
│
├── app.py
├── config.py
├── requirements.txt
├── README.md
└── .gitignore
```

> **Note:** The exact output varies based on your description and the AI model used. More detailed descriptions produce more detailed scaffolds.

---

## Supported Project Types

ForgePyGen supports a wide range of project types out of the box:

- **Web Applications** — Flask, Django, FastAPI
- **REST APIs** — With authentication, routing, and database layers
- **Data Science Projects** — Notebooks, pipelines, and model directories
- **Machine Learning Projects** — Training scripts, model storage, evaluation
- **Automation Scripts** — Task runners, schedulers, bots
- **CLI Applications** — Argument parsing, command modules
- **Real-Time Applications** — WebSocket-based chat and notification systems
- **E-Commerce Platforms** — Product management, cart, and payment modules
- **Educational Projects** — Management systems, grading tools
- **Custom Software Architectures** — Describe anything; ForgePyGen adapts

---

## Example Prompts

### Hospital Management System

```python
import forgepygen

forgepygen.generate(
    "Create a Hospital Management System with doctors, patients, appointments, and billing modules"
)
```

### Data Science — Churn Prediction

```python
import forgepygen

forgepygen.generate(
    "Create a Data Science project for customer churn prediction using Python"
)
```

### E-Commerce with Flask

```python
import forgepygen

forgepygen.generate(
    "Create an E-Commerce Website using Flask with authentication and product management"
)
```

### Real-Time Chat App

```python
import forgepygen

forgepygen.generate(
    "Create a Real-Time Chat Application using WebSockets"
)
```

### Machine Learning Pipeline

```python
import forgepygen

forgepygen.generate(
    "Create a machine learning pipeline for image classification using PyTorch with training, validation, and inference scripts"
)
```

---

## API Reference

### `forgepygen.generate()`

Generate a complete project structure from a natural language description.

```python
forgepygen.generate(project_description)
```

#### Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `project_description` | `str` | Yes | Plain English description of the project to generate |

#### Returns

| Type | Description |
|---|---|
| `str` | The name of the generated project directory on success |

#### Example

```python
import forgepygen

project_name = forgepygen.generate(
    "Create a REST API for a task manager with user authentication and CRUD operations"
)

print(f"Project created: {project_name}")
```

#### Raises

| Exception | Cause |
|---|---|
| `ConnectionError` | Ollama is not running or unreachable |
| `ModelNotFoundError` | The required model is not downloaded |
| `GenerationError` | The AI failed to produce a valid project structure |

---

## Troubleshooting

### Ollama is not running

**Symptom:** `ConnectionError` or `Failed to connect to Ollama`

**Fix:** Start Ollama in a terminal:

```bash
ollama serve
```

---

### Model not found

**Symptom:** `ModelNotFoundError` or `model 'llama3.2:3b' not found`

**Fix:** Pull the model:

```bash
ollama pull llama3.2:3b
```

---

### Project generation fails or produces incomplete output

**Checklist:**

- [ ] Is Ollama running? (`ollama serve`)
- [ ] Is the required model downloaded? (`ollama list`)
- [ ] Is your project description clear and specific?
- [ ] Does your machine have enough RAM for the model?

**Tip:** Try a more detailed description. Instead of:

```python
forgepygen.generate("Create a web app")
```

Use:

```python
forgepygen.generate(
    "Create a Flask web application with user login, a dashboard page, and a SQLite database"
)
```

---

### Slow generation

Large models produce better output but are slower. For faster results, use the smaller model:

```bash
ollama pull llama3.2:3b
```

---

## Contributing

Contributions are welcome!

### How to Contribute

1. **Fork** the repository
2. **Create** a feature branch: `git checkout -b feature/my-feature`
3. **Commit** your changes: `git commit -m "Add my feature"`
4. **Push** to your branch: `git push origin feature/my-feature`
5. **Open** a Pull Request

### What We Welcome

- Bug reports and fixes
- New project type support
- Improved prompt engineering
- Documentation improvements
- Feature requests via GitHub Issues

If you find ForgePyGen useful, consider **starring the repository** and sharing it with others. It helps the project grow!

---

## License

```
MIT License

Copyright (c) 2024 Varanasi Teja

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
```

---

## Author

**Varanasi Teja**

Developed with the belief that project setup should never slow you down.

---

*ForgePyGen — Forge your projects. Generate your future.*
