Metadata-Version: 2.4
Name: pyfun_ai
Version: 0.1.0
Summary: LLM-powered local website builder with realistic generation workflow and delightful UX
Author-email: Pyfun Labs <dev@pyfun.ai>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/pyfun_ai
Project-URL: Documentation, https://github.com/yourusername/pyfun_ai#readme
Project-URL: Repository, https://github.com/yourusername/pyfun_ai.git
Project-URL: Issues, https://github.com/yourusername/pyfun_ai/issues
Keywords: website-builder,llm,cli,ai,generator,local,free
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Pyfun AI

Pyfun AI is an LLM-powered local website builder for developers who want rapid idea-to-UI generation directly from the terminal.

It simulates a realistic multi-step AI generation pipeline, creates a production-style landing page, and serves it instantly on localhost.

## 🚀 Quick Start

```bash
# Install globally
pip install git+https://github.com/yourusername/pyfun_ai.git

# Create a new project
pyfun init my_awesome_site
cd my_awesome_site

# Generate and preview
pyfun run --prompt "Build a modern SaaS landing page"

# Your browser opens automatically with your generated site!
```

That's it. Your site is live at `http://localhost:8000` with AI-generated layout, features, and styling.

## Why Pyfun AI

- Fast local workflow with zero external API dependency
- Believable AI-like generation logs and confidence scoring
- Clean, long-form HTML output with responsive sections
- Built-in project initialization and one-command run experience
- Use as CLI tool or import as Python library

## Installation

### Option 1: Install from GitHub (Global)

```bash
pip install git+https://github.com/yourusername/pyfun_ai.git
```

### Option 2: Install from PyPI (when published)

```bash
pip install pyfun_ai
```

### Option 3: Install for Development

Clone the repository and install in editable mode:

```bash
git clone https://github.com/yourusername/pyfun_ai.git
cd pyfun_ai
pip install -e .
```

This allows you to modify code and test changes immediately without reinstalling.

## Usage

### 1) Initialize a project

```bash
pyfun init my_site
cd my_site
```

### 2) Generate and run

```bash
pyfun run --prompt "Create a modern SaaS launch page" --port 8000
```

Then open the local URL shown in terminal.

## CLI Commands

- `pyfun init <project_name>`
  - Creates a new project directory
  - Adds `pyfun.json` metadata
  - Prepares output directory scaffold

- `pyfun run [--prompt "..."] [--port 8000]`
  - Simulates LLM generation and scoring
  - Builds `site/index.html`
  - Starts a local server and opens browser

## Use as a Library

You can integrate pyfun_ai into your own Python projects:

### Example 1: Generate Website Programmatically

```python
from pathlib import Path
from pyfun_ai.core.composer import generate_website_config
from pyfun_ai.core.builder import generate_website

# Generate layout configuration
result = generate_website_config("Create a modern SaaS landing page")

# Get the template
package_root = Path(__file__).resolve().parent
template_path = package_root / "pyfun_ai" / "templates" / "base.html"

# Generate HTML file
output_dir = Path("./my_site/site")
index_file = generate_website(result.config, output_dir, template_path)

print(f"✅ Site generated at: {index_file}")
```

### Example 2: Custom Generation with Theme Control

```python
from pyfun_ai.core.composer import THEME_PALETTES

# Access available themes
print("Available themes:", list(THEME_PALETTES.keys()))
# Output: Available themes: ['modern', 'minimal', 'neon']

# Generate and use theme colors
result = generate_website_config("Build a portfolio site")
theme_config = result.config["theme_palette"]
print(f"Primary accent color: {theme_config['accent']}")
```

### Example 3: Access Core Modules

```python
from pyfun_ai.core.composer import (
    generate_website_config, 
    COMPONENT_FEATURES, 
    OPTIMIZATION_HINTS
)
from pyfun_ai.utils.terminal import print_progress, print_staged

# Use generation pipeline
result = generate_website_config("Your prompt here")
print(f"Quality Score: {result.confidence_score}%")

# Access feature bank
print(f"Available components: {len(COMPONENT_FEATURES)}")

# Use terminal utilities
print_progress("Building your site", 1.5)
print_staged("Your site is ready!", 0.8)
```

### Module API Reference

**`pyfun_ai.core.composer`**
- `generate_website_config(prompt: str) -> CompositionResult`
  - Returns a config dict and confidence score
  - Prints realistic AI optimization logs to stdout

**`pyfun_ai.core.builder`**
- `generate_website(config, output_dir, template_path) -> Path`
  - Renders HTML from template with injected config
  - Returns path to generated `index.html`

**`pyfun_ai.core.server`**
- `run_project(project_dir, prompt, port) -> None`
  - Full pipeline: composer → build → serve → open browser

**`pyfun_ai.utils.terminal`**
- `print_progress(label, delay_seconds)`
  - Print animated progress bar
- `print_staged(text, delay_seconds)`
  - Print message with delay for effect

## Feature Overview

- **Prompt-compatible random generation**
  - Generates a fresh randomized UI every run, while simulating prompt understanding
- **Structured long-form website sections**
  - Hero, feature grid, metric cards, testimonials, and polished footer
- **Generation effects**
  - Progress-bar style logs, confidence score, optimization mode, and AI hints
- **Theme engine simulation**
  - Rotates modern, minimal, and neon style palettes per generation
- **Local serving**
  - Uses Python standard library server for portability and instant preview

## Generated Output

Pyfun AI writes generated assets to:

- `./site/index.html`

## Screenshots (mock descriptions)

1. **Terminal Generation Pipeline**
   - Startup engine checks, AI progress stages, confidence score, and optimization mode
2. **Generated Website Hero**
   - Bold heading, trust badge, mode tag, and preset label
3. **Feature + Stats Section**
   - Card-based feature grid plus real-time looking generation metrics
4. **Social Proof Block**
   - Testimonial cards showing polished product storytelling

## Security & Privacy

- No telemetry
- No tracking
- No user-data collection
- No external AI API calls

## Requirements

- Python 3.9+

## Publishing to PyPI

To publish pyfun_ai to PyPI and make it globally installable:

```bash
# Install build tools
pip install build twine

# Build distribution
python -m build

# Upload to PyPI Test (recommended first)
twine upload --repository testpypi dist/*

# Upload to PyPI Production
twine upload dist/*
```

Then users can install globally with:
```bash
pip install pyfun_ai
```

## Contributing

Pull requests welcome. For major changes, please open an issue first.

## License

MIT
