Metadata-Version: 2.4
Name: pyfrontkit
Version: 0.9.0
Summary: A Python tool to generate HTML and CSS with programmable syntax.
Author-email: Eduardo Antonio Ferrera Rodríguez <enzoferrera.23@gmail.com>
Project-URL: Homepage, https://github.com/Edybrown/pyfrontkit
Project-URL: Source, https://github.com/Edybrown/pyfrontkit
Project-URL: Issues, https://github.com/Edybrown/pyfrontkit/issues
Keywords: html,css,python,frontend,mlops,data app
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

Perfecto. Te preparo un **README completo en inglés** actualizado para `pyfrontkit`, con todos los puntos que discutimos y el ejemplo usando `import pyfrontkit`. Aquí va:

````markdown
# PYFRONTKIT: Python DSL for Programmatic Web Generation

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)

**PYFRONTKIT** is a Python library designed to **programmatically generate HTML and CSS web structures**.  
It acts as a **Domain-Specific Language (DSL)**, allowing developers to build web pages entirely in Python.

Unlike frontend frameworks like React or Vue, PYFRONTKIT focuses on **rapid prototyping**, styling templates, and automatic CSS generation, rather than dynamic reactivity.

---

## Key Features

- **Pythonic HTML Syntax:** Use classes or functions (`Div`, `div`, `Section`, etc.) to build page elements without writing raw HTML.
- **Accumulative DOM:** Global functions for IDs allow you to add children to any element without deep nesting:
  ```python
  Div(id="container")
  container(Section(ctn_p="Hello World"))
````

* **Automatic CSS Generation:** All `id`, `class`, and tag selectors are collected to generate a ready-to-use `style.css`.
* **Native JS Support (basic):** Inline `<script>` in `<head>` is supported.
* **Template Styles (future-ready):** Ability to apply preset style templates (e.g., `simple_blue`) for a cohesive look.
* **Final Output:** Generates `index.html` and `style.css` ready to open in any browser.

---

## Installation

Install directly from PyPI:

```bash
pip install pyfrontkit
```

Or from GitHub:

```bash
pip install git+https://github.com/Edybrown/pyfrontkit.git
```

---

## 💡 Usage Example

The following Python code generates a semantic page structure with styles:

```python
from pyfrontkit import HtmlDoc, Div, Section, Header, Nav, Ul, Li, Footer

# Create the document
doc = HtmlDoc(title="My Professional Page")

# Header
Header(id="header", ctn_p="Welcome to My Professional Site",
       style="background-color:#2c3e50; color:white; padding:20px 0;")

# Navigation
Nav(id="nav", style="background-color:#34495e; display:flex; justify-content:center;")
nav(
    Div(ctn_p="Home", style="color:white; padding:15px 25px;"),
    Div(ctn_p="Services", style="color:white; padding:15px 25px;")
)

# Introduction Section
Section(id="intro", style="padding:40px 20px; max-width:1000px; margin:auto;")
intro(
    Div(ctn_p="This is the introduction section, generated entirely in Python.")
)

# Services Section
Section(id="services", style="padding:40px 20px; max-width:1000px; margin:auto;")
services(
    Ul(id="service_list")
)
service_list(
    Li(ctn_p="Custom web development"),
    Li(ctn_p="Technology consulting")
)

# Footer
Footer(id="footer", style="background-color:#2c3e50; color:white; text-align:center; padding:20px 0;")
footer(
    Div(ctn_p="© 2025 My Professional Site. All rights reserved.")
)

# Generate files
doc.create_document()
```

This produces `index.html` and `style.css` ready to open in a browser.

---

## Styling Possibilities

PYFRONTKIT provides **three layers of control for styles**:

1. **Inline Styles:** Directly on any block using `style="..."`.
2. **Generated CSS:** Automatic `style.css` is created with all selectors.
3. **Template Styles (future):** Apply pre-defined style templates such as `simple_blue`, controlling colors, fonts, and layout patterns globally.

---

## License

This project is released under the **GNU General Public License version 3 (GPLv3)**.

* Free to use, modify, and redistribute.
* Any derivative work must also be free software (copyleft).

See the `LICENSE` file for full details.

---

## About the Author

Created by **Eduardo Antonio Ferrera Rodríguez** as part of an advanced Python learning journey, exploring **OOP**, library design, and DSL creation.

Contributions and feedback are welcome!

```

