Skip to main content

LLM-powered local website builder with realistic generation workflow and delightful UX

Project description

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

# 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)

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

Option 2: Install from PyPI (when published)

pip install pyfun_ai

Option 3: Install for Development

Clone the repository and install in editable mode:

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

pyfun init my_site
cd my_site

2) Generate and run

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

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

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

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:

# 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:

pip install pyfun_ai

Contributing

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

License

MIT

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

pyfun_ai-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

pyfun_ai-0.1.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file pyfun_ai-0.1.0.tar.gz.

File metadata

  • Download URL: pyfun_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pyfun_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0e000b2aa3a4c58b60dde6b25bf34acd2761a211433c61fbbe4f8a315cc956e1
MD5 d85ad2aeabf46a9d710786c48431809d
BLAKE2b-256 133a31cde0bd49b9c2ffdf5197fbb966e9b8fdf2dc4e548ff75201840fa0fb07

See more details on using hashes here.

File details

Details for the file pyfun_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyfun_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pyfun_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a122f3de3f7a7269b4346614843a1a90b524520ffab5d2a1a52152344d117e3b
MD5 d82d54d708c3d602d8f96c03de30bbe2
BLAKE2b-256 4f5b1f8eb64df70eee0f0c72cae1c2392206a48497a93a7dc65bb06d15710ae5

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