beautypy


Namebeautypy JSON
Version 1.0 PyPI version JSON
download
home_pageNone
SummaryReusable Django UI components and tags with Tailwind support
upload_time2025-08-11 15:29:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT License Copyright (c) 2025 Avinash Chaurasiya 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.
keywords django tailwind template tags ui components
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🌸 Beautypy

**Beautypy** is a Django UI component library that provides pre-designed, reusable template tags for building modern, responsive UIs with Bootstrap 5. Create beautiful interfaces in minutes—no HTML or CSS required!

---

## ✨ Features

- ✅ Clean, responsive, accessible Bootstrap 5 components
- ⚡ Lightning-fast integration with Django templates
- 💡 Simple custom template tags: `{% Button %}`, `{% Alert %}`, `{% Navbar %}`, `{% Tooltip %}`, and more
- ☕ Support development via [Buy Me a Coffee](https://www.buymeacoffee.com/avichaurasiya)

---

## 📦 Installation

```bash
pip install beautypy  # (Test version: see below)
```

**Currently under testing phase. Install the test version with:**

```bash
pip install -i https://test.pypi.org/simple/ beautypy
```

---

## 🎨 Bootstrap 5 Integration

Beautypy uses Bootstrap 5 for styling. You can include Bootstrap in your project via following this setup:

## ⚙️ Django Setup

1. **Add to INSTALLED_APPS**

```python
INSTALLED_APPS = [
    ...
    'beautypy',
]
```

2. **Templates Context Processor**
Make sure your TEMPLATES setting includes:

```python
'OPTIONS': {
    'context_processors': [
        ...
        'django.template.context_processors.request',
    ],
}
```

3. **Load Beautypy Tags**
In your templates top of your html page:

```django
{% load Components %}
```

4. **Load Bootstrap CSS/JS (if not already loaded globally)**

```django
{% LoadBeautypyCSS %}   {# Loads Bootstrap CSS #}
{% LoadBeautypyJS %}    {# Loads Bootstrap JS #}
```

---

# 🧩 Components & Template Tags

## 1. `{% LoadBeautypyCSS %}`

Loads Bootstrap CSS. Uses local static if available, otherwise falls back to CDN.

**Usage:**

```django
{% LoadBeautypyCSS %}
```

---

## 2. `{% LoadBeautypyJS %}`

Loads Bootstrap JS. Uses local static if available, otherwise falls back to CDN.

**Usage:**

```django
{% LoadBeautypyJS %}
```

---

## 3. `{% Button %}`

Renders a Bootstrap-styled button.

**Props:**

- `label` (required): Button text
- `type`: Button type (`button`, `submit`, etc.)
- `variant`: Bootstrap color variant (`primary`, `secondary`, `success`, `danger`, `warning`, `info`)
- `css_class`: Additional classes
- `tag_id`: Optional id

**Usage:**

```django
{% Button label="Submit" type="submit" variant="primary" %}
```

---

## 4. `{% Link %}`

Renders a Bootstrap-styled link (anchor).

**Props:**

- `url` (required): Href
- `label` (required): Link text
- `css_class`: Additional classes (default: `btn btn-link`)
- `tag_id`: Optional id

**Usage:**

```django
{% Link url="/home" label="Home" css_class="btn btn-primary" %}
```

---

## 5. `{% Alert %}`

Renders a Bootstrap-styled alert box.

**Props:**

- `message` (required): Alert text
- `alert_type`: `info`, `success`, `warning`, `error`
- `css_class`: Additional classes (default: `alert`)
- `tag_id`: Optional id

**Usage:**

```django
{% Alert message="Success!" alert_type="success" %}
```

---

## 6. `{% InputField %}`

Renders a Bootstrap input field.

**Props:**

- `name` (required)
- `value`: Default value
- `input_type`: Input type (default: `text`)
- `css_class`: Additional classes (default: `form-control`)
- `tag_id`: Optional id

**Usage:**

```django
{% InputField name="email" input_type="email" css_class="form-control" %}
```

---

## 7. `{% InputLabel %}`

Renders a Bootstrap label for an input.

**Props:**

- `name` (required): For attribute
- `label_text` (required): Label text
- `css_class`: Additional classes (default: `form-label`)
- `tag_id`: Optional id (default: `label`)

**Usage:**

```django
{% InputLabel name="email" label_text="Your Email" %}
```

---

## 8. `{% FormGroup %}`

Groups a label and input together in a Bootstrap form group.

**Props:**

- `label` (required): Label text
- `input_field` (required): Input field (rendered separately)

**Usage:**

```django
{% FormGroup label="email" input_field=input_field %}
```

---

## 9. `{% Toast %}`

Renders a Bootstrap-styled toast notification.

**Props:**

- `message` (required)
- `toast_type`: `info`, `success`, `warning`, `error`
- `tag_id`: Optional id

**Usage:**

```django
{% Toast message="Operation successful!" toast_type="success" %}
```

---

## 10. Block Tags

These tags wrap content in Bootstrap containers/sections/footers/navbars, etc.

### Section

```django
{% Section title="Section Title" css_class="mb-4" tag_id="section1" %}
  <!-- Content -->
{% endSection %}
```

### Container

```django
{% Container css_class="container my-4" tag_id="main-container" %}
  <!-- Content -->
{% endContainer %}
```

### Footer

```django
{% Footer css_class="text-center text-muted py-3" tag_id="footer" %}
  &copy; 2025 Beautypy
{% endFooter %}
```

### Navbar

<img src="/beautypy/static/images/nav.png">

```django
{% Navbar css_class="navbar navbar-expand-lg navbar-dark bg-primary p-4" tag_id="main-navbar" %}
  <!-- Logo / Nav links / Buttons -->
{% endNav %}
```

### Tooltip

```django
{% Tooltip title="Helpful info!" css_class="d-inline-block" %}
  <button class="btn btn-secondary">Hover me</button>
{% endTooltip %}
```

### Accordion

```django
{% Accordion title="Click to Expand" css_class="accordion" tag_id="accordion1" %}
  <p>This content is toggled.</p>
{% endAccordion %}
```

---

# 📷 Example Template

```django
{% load Components %}
<!DOCTYPE html>
<html>
  <head>
    <title>Beautypy Example</title>
    {% LoadBeautypyCSS %}
  </head>
  <body>
    {% Navbar css_class="navbar navbar-expand-lg navbar-dark bg-primary p-4" %}
      <!-- Content -->
    {% endNav %}

    {% Section title="Alerts" %}
      {% Alert message="Success!" alert_type="success" %}
    {% endSection %}

    {% Footer css_class="text-center text-muted py-3" %}
      &copy; 2025 Beautypy
    {% endFooter %}

    {% LoadBeautypyJS %}
  </body>
</html>
```

---

# 🤝 Contributing

1. Fork this repository
2. Create your feature branch:

```bash
git checkout -b feature/my-component
```

3. Commit your changes:

```bash
git commit -m 'Add my new component'
```

4. Push to the branch:

```bash
git push origin feature/my-component
```

5. Open a pull request

---

# 💖 Support

Beautypy is open-source. If you like the project, consider supporting it via [Buy Me a Coffee](https://coff.ee/webdevavi96).

# 🔗 License

MIT License © 2025 [webdevavi96 | Avinash](https://github.com/webdevavi96)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "beautypy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "django, tailwind, template tags, ui, components",
    "author": null,
    "author_email": "Avinash Chaurasiya <avinashchaurasiya902@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2a/da/67793881957aaf1af6b3d0987f1d8867cdfb4975ef5db2f654c065e57312/beautypy-1.0.tar.gz",
    "platform": null,
    "description": "# \ud83c\udf38 Beautypy\r\n\r\n**Beautypy** is a Django UI component library that provides pre-designed, reusable template tags for building modern, responsive UIs with Bootstrap 5. Create beautiful interfaces in minutes\u2014no HTML or CSS required!\r\n\r\n---\r\n\r\n## \u2728 Features\r\n\r\n- \u2705 Clean, responsive, accessible Bootstrap 5 components\r\n- \u26a1 Lightning-fast integration with Django templates\r\n- \ud83d\udca1 Simple custom template tags: `{% Button %}`, `{% Alert %}`, `{% Navbar %}`, `{% Tooltip %}`, and more\r\n- \u2615 Support development via [Buy Me a Coffee](https://www.buymeacoffee.com/avichaurasiya)\r\n\r\n---\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n```bash\r\npip install beautypy  # (Test version: see below)\r\n```\r\n\r\n**Currently under testing phase. Install the test version with:**\r\n\r\n```bash\r\npip install -i https://test.pypi.org/simple/ beautypy\r\n```\r\n\r\n---\r\n\r\n## \ud83c\udfa8 Bootstrap 5 Integration\r\n\r\nBeautypy uses Bootstrap 5 for styling. You can include Bootstrap in your project via following this setup:\r\n\r\n## \u2699\ufe0f Django Setup\r\n\r\n1. **Add to INSTALLED_APPS**\r\n\r\n```python\r\nINSTALLED_APPS = [\r\n    ...\r\n    'beautypy',\r\n]\r\n```\r\n\r\n2. **Templates Context Processor**\r\nMake sure your TEMPLATES setting includes:\r\n\r\n```python\r\n'OPTIONS': {\r\n    'context_processors': [\r\n        ...\r\n        'django.template.context_processors.request',\r\n    ],\r\n}\r\n```\r\n\r\n3. **Load Beautypy Tags**\r\nIn your templates top of your html page:\r\n\r\n```django\r\n{% load Components %}\r\n```\r\n\r\n4. **Load Bootstrap CSS/JS (if not already loaded globally)**\r\n\r\n```django\r\n{% LoadBeautypyCSS %}   {# Loads Bootstrap CSS #}\r\n{% LoadBeautypyJS %}    {# Loads Bootstrap JS #}\r\n```\r\n\r\n---\r\n\r\n# \ud83e\udde9 Components & Template Tags\r\n\r\n## 1. `{% LoadBeautypyCSS %}`\r\n\r\nLoads Bootstrap CSS. Uses local static if available, otherwise falls back to CDN.\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% LoadBeautypyCSS %}\r\n```\r\n\r\n---\r\n\r\n## 2. `{% LoadBeautypyJS %}`\r\n\r\nLoads Bootstrap JS. Uses local static if available, otherwise falls back to CDN.\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% LoadBeautypyJS %}\r\n```\r\n\r\n---\r\n\r\n## 3. `{% Button %}`\r\n\r\nRenders a Bootstrap-styled button.\r\n\r\n**Props:**\r\n\r\n- `label` (required): Button text\r\n- `type`: Button type (`button`, `submit`, etc.)\r\n- `variant`: Bootstrap color variant (`primary`, `secondary`, `success`, `danger`, `warning`, `info`)\r\n- `css_class`: Additional classes\r\n- `tag_id`: Optional id\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% Button label=\"Submit\" type=\"submit\" variant=\"primary\" %}\r\n```\r\n\r\n---\r\n\r\n## 4. `{% Link %}`\r\n\r\nRenders a Bootstrap-styled link (anchor).\r\n\r\n**Props:**\r\n\r\n- `url` (required): Href\r\n- `label` (required): Link text\r\n- `css_class`: Additional classes (default: `btn btn-link`)\r\n- `tag_id`: Optional id\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% Link url=\"/home\" label=\"Home\" css_class=\"btn btn-primary\" %}\r\n```\r\n\r\n---\r\n\r\n## 5. `{% Alert %}`\r\n\r\nRenders a Bootstrap-styled alert box.\r\n\r\n**Props:**\r\n\r\n- `message` (required): Alert text\r\n- `alert_type`: `info`, `success`, `warning`, `error`\r\n- `css_class`: Additional classes (default: `alert`)\r\n- `tag_id`: Optional id\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% Alert message=\"Success!\" alert_type=\"success\" %}\r\n```\r\n\r\n---\r\n\r\n## 6. `{% InputField %}`\r\n\r\nRenders a Bootstrap input field.\r\n\r\n**Props:**\r\n\r\n- `name` (required)\r\n- `value`: Default value\r\n- `input_type`: Input type (default: `text`)\r\n- `css_class`: Additional classes (default: `form-control`)\r\n- `tag_id`: Optional id\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% InputField name=\"email\" input_type=\"email\" css_class=\"form-control\" %}\r\n```\r\n\r\n---\r\n\r\n## 7. `{% InputLabel %}`\r\n\r\nRenders a Bootstrap label for an input.\r\n\r\n**Props:**\r\n\r\n- `name` (required): For attribute\r\n- `label_text` (required): Label text\r\n- `css_class`: Additional classes (default: `form-label`)\r\n- `tag_id`: Optional id (default: `label`)\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% InputLabel name=\"email\" label_text=\"Your Email\" %}\r\n```\r\n\r\n---\r\n\r\n## 8. `{% FormGroup %}`\r\n\r\nGroups a label and input together in a Bootstrap form group.\r\n\r\n**Props:**\r\n\r\n- `label` (required): Label text\r\n- `input_field` (required): Input field (rendered separately)\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% FormGroup label=\"email\" input_field=input_field %}\r\n```\r\n\r\n---\r\n\r\n## 9. `{% Toast %}`\r\n\r\nRenders a Bootstrap-styled toast notification.\r\n\r\n**Props:**\r\n\r\n- `message` (required)\r\n- `toast_type`: `info`, `success`, `warning`, `error`\r\n- `tag_id`: Optional id\r\n\r\n**Usage:**\r\n\r\n```django\r\n{% Toast message=\"Operation successful!\" toast_type=\"success\" %}\r\n```\r\n\r\n---\r\n\r\n## 10. Block Tags\r\n\r\nThese tags wrap content in Bootstrap containers/sections/footers/navbars, etc.\r\n\r\n### Section\r\n\r\n```django\r\n{% Section title=\"Section Title\" css_class=\"mb-4\" tag_id=\"section1\" %}\r\n  <!-- Content -->\r\n{% endSection %}\r\n```\r\n\r\n### Container\r\n\r\n```django\r\n{% Container css_class=\"container my-4\" tag_id=\"main-container\" %}\r\n  <!-- Content -->\r\n{% endContainer %}\r\n```\r\n\r\n### Footer\r\n\r\n```django\r\n{% Footer css_class=\"text-center text-muted py-3\" tag_id=\"footer\" %}\r\n  &copy; 2025 Beautypy\r\n{% endFooter %}\r\n```\r\n\r\n### Navbar\r\n\r\n<img src=\"/beautypy/static/images/nav.png\">\r\n\r\n```django\r\n{% Navbar css_class=\"navbar navbar-expand-lg navbar-dark bg-primary p-4\" tag_id=\"main-navbar\" %}\r\n  <!-- Logo / Nav links / Buttons -->\r\n{% endNav %}\r\n```\r\n\r\n### Tooltip\r\n\r\n```django\r\n{% Tooltip title=\"Helpful info!\" css_class=\"d-inline-block\" %}\r\n  <button class=\"btn btn-secondary\">Hover me</button>\r\n{% endTooltip %}\r\n```\r\n\r\n### Accordion\r\n\r\n```django\r\n{% Accordion title=\"Click to Expand\" css_class=\"accordion\" tag_id=\"accordion1\" %}\r\n  <p>This content is toggled.</p>\r\n{% endAccordion %}\r\n```\r\n\r\n---\r\n\r\n# \ud83d\udcf7 Example Template\r\n\r\n```django\r\n{% load Components %}\r\n<!DOCTYPE html>\r\n<html>\r\n  <head>\r\n    <title>Beautypy Example</title>\r\n    {% LoadBeautypyCSS %}\r\n  </head>\r\n  <body>\r\n    {% Navbar css_class=\"navbar navbar-expand-lg navbar-dark bg-primary p-4\" %}\r\n      <!-- Content -->\r\n    {% endNav %}\r\n\r\n    {% Section title=\"Alerts\" %}\r\n      {% Alert message=\"Success!\" alert_type=\"success\" %}\r\n    {% endSection %}\r\n\r\n    {% Footer css_class=\"text-center text-muted py-3\" %}\r\n      &copy; 2025 Beautypy\r\n    {% endFooter %}\r\n\r\n    {% LoadBeautypyJS %}\r\n  </body>\r\n</html>\r\n```\r\n\r\n---\r\n\r\n# \ud83e\udd1d Contributing\r\n\r\n1. Fork this repository\r\n2. Create your feature branch:\r\n\r\n```bash\r\ngit checkout -b feature/my-component\r\n```\r\n\r\n3. Commit your changes:\r\n\r\n```bash\r\ngit commit -m 'Add my new component'\r\n```\r\n\r\n4. Push to the branch:\r\n\r\n```bash\r\ngit push origin feature/my-component\r\n```\r\n\r\n5. Open a pull request\r\n\r\n---\r\n\r\n# \ud83d\udc96 Support\r\n\r\nBeautypy is open-source. If you like the project, consider supporting it via [Buy Me a Coffee](https://coff.ee/webdevavi96).\r\n\r\n# \ud83d\udd17 License\r\n\r\nMIT License \u00a9 2025 [webdevavi96 | Avinash](https://github.com/webdevavi96)\r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2025 Avinash Chaurasiya\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \u201cSoftware\u201d), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in all\r\n        copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n        SOFTWARE.\r\n        ",
    "summary": "Reusable Django UI components and tags with Tailwind support",
    "version": "1.0",
    "project_urls": null,
    "split_keywords": [
        "django",
        " tailwind",
        " template tags",
        " ui",
        " components"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e2a1832982b2c2821c3a6244fdfedcea6e2f82978d77a11f43257dff376dec9d",
                "md5": "e45224c17eb26b50a5e87c97cdeaaf48",
                "sha256": "9b78a0497a3fcbfb0caf7af91cf6412482e36580c2891fda62ba9124cc3c23ec"
            },
            "downloads": -1,
            "filename": "beautypy-1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e45224c17eb26b50a5e87c97cdeaaf48",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 2370958,
            "upload_time": "2025-08-11T15:29:37",
            "upload_time_iso_8601": "2025-08-11T15:29:37.123840Z",
            "url": "https://files.pythonhosted.org/packages/e2/a1/832982b2c2821c3a6244fdfedcea6e2f82978d77a11f43257dff376dec9d/beautypy-1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2ada67793881957aaf1af6b3d0987f1d8867cdfb4975ef5db2f654c065e57312",
                "md5": "1086c83e2272d8d45b77f18d04c94f76",
                "sha256": "e530e5633dfb481d26213ab8aa482f76784ccb29eda39545bf4c5420618b0b63"
            },
            "downloads": -1,
            "filename": "beautypy-1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1086c83e2272d8d45b77f18d04c94f76",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 2124309,
            "upload_time": "2025-08-11T15:29:48",
            "upload_time_iso_8601": "2025-08-11T15:29:48.263584Z",
            "url": "https://files.pythonhosted.org/packages/2a/da/67793881957aaf1af6b3d0987f1d8867cdfb4975ef5db2f654c065e57312/beautypy-1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-11 15:29:48",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "beautypy"
}
        
Elapsed time: 0.57477s