Name | trunco JSON |
Version |
0.3.1
JSON |
| download |
home_page | None |
Summary | An agile, powerful Python framework for creating dynamic UIs with seamless web integration. |
upload_time | 2024-08-18 23:53:38 |
maintainer | None |
docs_url | None |
author | Ali Tavallaie |
requires_python | <4.0,>=3.8 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Trunco
**Trunco** is a modern Python framework for building dynamic, reusable, and modular HTML components. Designed with web developers in mind, Trunco provides a simple and Pythonic API that integrates seamlessly with popular web frameworks like Django, Flask, and FastAPI. Whether you’re building simple pages or complex web applications, Trunco gives you the tools to create clean, maintainable, and reusable components.
## Features
- **Component-Based Architecture**: Trunco encourages the use of components, making your HTML more modular and easier to manage.
- **Context Support**: Pass dynamic data into your components easily, allowing for flexible and adaptive UI elements.
- **Alpine.js and HTMX Integration**: Build reactive and interactive components with built-in support for Alpine.js and HTMX directives.
- **Seamless Integration**: Trunco works out-of-the-box with Django, Flask, FastAPI, and other popular web frameworks.
- **Extensible**: Easily extend and customize components, or create your own, to fit your specific needs.
- **Custom Directives and Attributes**: Leverage the power of custom HTML attributes and directives to build rich, interactive UIs.
## Installation
To start using Trunco, you can install it directly from PyPI using pip:
```bash
pip install trunco
```
Trunco requires Python 3.6+.
## Basic Usage
Creating components with Trunco is straightforward. Here’s an example of how to create a basic button component:
```python
from trunco.components import ButtonComponent
button = ButtonComponent(label="Click Me", on_click="alert('Hello World!')")
print(button)
```
This will output the following HTML:
```html
<button id="unique-button-id" class="btn" x-on:click="alert('Hello World!')">Click Me</button>
```
## Advanced Usage
Trunco is more than just simple components. It allows for complex layouts and interactions. Here’s an example of a form with multiple inputs:
```python
from trunco.components import FormComponent, InputComponent, ButtonComponent
form = FormComponent(action="/submit", method="post")
form.add_child(InputComponent(input_type="text", placeholder="Enter your name"))
form.add_child(InputComponent(input_type="email", placeholder="Enter your email"))
form.add_child(ButtonComponent(label="Submit", on_click="submitForm()"))
print(form)
```
This will generate the following HTML:
```html
<form id="unique-form-id" action="/submit" method="post">
<input id="input1-id" type="text" placeholder="Enter your name">
<input id="input2-id" type="email" placeholder="Enter your email">
<button id="button-id" class="btn" x-on:click="submitForm()">Submit</button>
</form>
```
## Documentation
Full documentation is available in the `docs` directory, covering everything from installation to advanced component usage.
- [Installation Guide](docs/installation.md)
- [Components](docs/components.md)
- [Usage Examples](docs/usage.md)
## Examples
Check out the `examples` directory for more code samples demonstrating how to use Trunco in different scenarios:
- **basic_usage.py**: Simple examples to get you started.
- **advanced_usage.py**: More complex usage involving forms, tables, and dynamic content.
- **form_example.py**: Demonstrates how to build and handle forms using Trunco.
## Contributing
We welcome contributions from the community! If you'd like to contribute, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Implement your changes.
4. Write tests to ensure your changes work as expected.
5. Submit a pull request with a clear description of your changes.
## License
Trunco is open-source software licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
## Contact
If you have any questions, suggestions, or feedback, feel free to reach out. We’re here to help you get the most out of Trunco.
Raw data
{
"_id": null,
"home_page": null,
"name": "trunco",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Ali Tavallaie",
"author_email": "a.tavallaie@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/93/4a/7f67b24c236aae4501263747e418d0b24d49d89c09efbfe6fcfd996f6e23/trunco-0.3.1.tar.gz",
"platform": null,
"description": " # Trunco\n\n **Trunco** is a modern Python framework for building dynamic, reusable, and modular HTML components. Designed with web developers in mind, Trunco provides a simple and Pythonic API that integrates seamlessly with popular web frameworks like Django, Flask, and FastAPI. Whether you\u2019re building simple pages or complex web applications, Trunco gives you the tools to create clean, maintainable, and reusable components.\n\n ## Features\n\n - **Component-Based Architecture**: Trunco encourages the use of components, making your HTML more modular and easier to manage.\n - **Context Support**: Pass dynamic data into your components easily, allowing for flexible and adaptive UI elements.\n - **Alpine.js and HTMX Integration**: Build reactive and interactive components with built-in support for Alpine.js and HTMX directives.\n - **Seamless Integration**: Trunco works out-of-the-box with Django, Flask, FastAPI, and other popular web frameworks.\n - **Extensible**: Easily extend and customize components, or create your own, to fit your specific needs.\n - **Custom Directives and Attributes**: Leverage the power of custom HTML attributes and directives to build rich, interactive UIs.\n\n ## Installation\n\n To start using Trunco, you can install it directly from PyPI using pip:\n\n ```bash\n pip install trunco\n ```\n\n Trunco requires Python 3.6+.\n\n ## Basic Usage\n\n Creating components with Trunco is straightforward. Here\u2019s an example of how to create a basic button component:\n\n ```python\n from trunco.components import ButtonComponent\n\n button = ButtonComponent(label=\"Click Me\", on_click=\"alert('Hello World!')\")\n print(button)\n ```\n\n This will output the following HTML:\n\n ```html\n <button id=\"unique-button-id\" class=\"btn\" x-on:click=\"alert('Hello World!')\">Click Me</button>\n ```\n\n ## Advanced Usage\n\n Trunco is more than just simple components. It allows for complex layouts and interactions. Here\u2019s an example of a form with multiple inputs:\n\n ```python\n from trunco.components import FormComponent, InputComponent, ButtonComponent\n\n form = FormComponent(action=\"/submit\", method=\"post\")\n form.add_child(InputComponent(input_type=\"text\", placeholder=\"Enter your name\"))\n form.add_child(InputComponent(input_type=\"email\", placeholder=\"Enter your email\"))\n form.add_child(ButtonComponent(label=\"Submit\", on_click=\"submitForm()\"))\n\n print(form)\n ```\n\n This will generate the following HTML:\n\n ```html\n <form id=\"unique-form-id\" action=\"/submit\" method=\"post\">\n <input id=\"input1-id\" type=\"text\" placeholder=\"Enter your name\">\n <input id=\"input2-id\" type=\"email\" placeholder=\"Enter your email\">\n <button id=\"button-id\" class=\"btn\" x-on:click=\"submitForm()\">Submit</button>\n </form>\n ```\n\n ## Documentation\n\n Full documentation is available in the `docs` directory, covering everything from installation to advanced component usage.\n\n - [Installation Guide](docs/installation.md)\n - [Components](docs/components.md)\n - [Usage Examples](docs/usage.md)\n\n ## Examples\n\n Check out the `examples` directory for more code samples demonstrating how to use Trunco in different scenarios:\n\n - **basic_usage.py**: Simple examples to get you started.\n - **advanced_usage.py**: More complex usage involving forms, tables, and dynamic content.\n - **form_example.py**: Demonstrates how to build and handle forms using Trunco.\n\n ## Contributing\n\n We welcome contributions from the community! If you'd like to contribute, please follow these steps:\n\n 1. Fork the repository.\n 2. Create a new branch for your feature or bugfix.\n 3. Implement your changes.\n 4. Write tests to ensure your changes work as expected.\n 5. Submit a pull request with a clear description of your changes.\n\n ## License\n\n Trunco is open-source software licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n ## Contact\n\n If you have any questions, suggestions, or feedback, feel free to reach out. We\u2019re here to help you get the most out of Trunco.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An agile, powerful Python framework for creating dynamic UIs with seamless web integration.",
"version": "0.3.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c557e207f6c762842faf000ccef35eeb0b5768319691cd7e08c269d59debde7d",
"md5": "2e5c3672af0f957383c2290baaed0378",
"sha256": "a6f7e72077d3b04a54dd299e380a565bae893297145b113cc741ed43a90cc5a5"
},
"downloads": -1,
"filename": "trunco-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2e5c3672af0f957383c2290baaed0378",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 15567,
"upload_time": "2024-08-18T23:53:36",
"upload_time_iso_8601": "2024-08-18T23:53:36.394032Z",
"url": "https://files.pythonhosted.org/packages/c5/57/e207f6c762842faf000ccef35eeb0b5768319691cd7e08c269d59debde7d/trunco-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "934a7f67b24c236aae4501263747e418d0b24d49d89c09efbfe6fcfd996f6e23",
"md5": "0edd6d659448187866b7495b39172da5",
"sha256": "f80a76346fdc0a01bc7557d094c793f14abee8412866165c47e0e3ace9dec551"
},
"downloads": -1,
"filename": "trunco-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "0edd6d659448187866b7495b39172da5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 10232,
"upload_time": "2024-08-18T23:53:38",
"upload_time_iso_8601": "2024-08-18T23:53:38.026437Z",
"url": "https://files.pythonhosted.org/packages/93/4a/7f67b24c236aae4501263747e418d0b24d49d89c09efbfe6fcfd996f6e23/trunco-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-18 23:53:38",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "trunco"
}