Metadata-Version: 2.2
Name: Flask-Embed
Version: 0.0.1
Summary: A Flask extension for embedding python code directly in HTML templates.
Author-email: Jaton Justice <jaton@pythonicit.com>
License: MIT License
        
        Copyright (c) 2025 Jaton Justice
        
        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.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/Masterjx9/Flask-Embed
Project-URL: Source, https://github.com/Masterjx9/Flask-Embed
Project-URL: Tracker, https://github.com/yourusername/flask-embed/issues
Keywords: flask,embed,jinja,extension
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# Flask-Embed Project 🚀🐍

![Flask-Embed Logo](https://raw.githubusercontent.com/Masterjx9/Flask-Embed/main/logo.png)

Flask-Embed is a Flask extension that allows you to run Python code directly from your HTML templates. This can be incredibly useful for convience of running python from the HTML templates as a convience. 🎉

## Installation 📦

You can install Flask-Embed using pip:

```sh
pip install Flask-Embed
```

## Usage Example 💻

Here's a simple example of how to use Flask with the Flask-Embed library:

```python
from flask import Flask
from flask_embed import Embed

app = Flask(__name__)
embed = Embed()

@app.route('/')
def hello_world():
    return embed.render_template('index.html', embed=embed)

if __name__ == '__main__':
    app.run(debug=True)
```

## How It Works 🛠️

Flask-Embed allows you to embed Python code within your HTML templates using special tags. The embedded Python code is executed on the server side, and the output is rendered in the HTML.

### Example HTML Template 📄

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reactive Flask</title>
</head>
<body>
    <h1>Python Embed Test</h1>
    <p>Python code:</p>
    <FlaskOutput></FlaskOutput>
</body>
</html>
```

### Embedded Python Code 🐍

```python
<Flask>
import urllib.request
import json

with urllib.request.urlopen("https://jsonplaceholder.typicode.com/posts") as response:
    data = response.read()
    posts = json.loads(data)
    output = posts[:5]
</Flask>
```

The above code fetches data from an API and displays the first five posts in the HTML template. 🌐

## Conclusion 🎯

Flask-Embed makes it easy to integrate Python code into your HTML templates, providing a seamless way to create dynamic web applications. Give it a try and see how it can simplify your Flask projects! 🚀
