dars-framework


Namedars-framework JSON
Version 1.1.1 PyPI version JSON
download
home_pageNone
SummaryDars is a Python UI framework for building modern, interactive web apps with only Python code. Write your interface in Python, export it to static HTML/CSS/JS, and deploy anywhere.
upload_time2025-08-31 20:14:56
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License Copyright (c) 2025 ZtaDev 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
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Dars Framework

Dars is a Python UI framework for building modern, interactive web apps with Python code. Write your interface in Python, export it to static HTML/CSS/JS, and deploy anywhere.

> Some Javascript or frontend stack required.

```bash
pip install dars-framework
```

## How It Works
- Build your UI using Python classes and components (like Text, Button, Container, Page, etc).
- Preview instantly with hot-reload using `app.rTimeCompile()`.
- Export your app to static web files with a single CLI command.
- Use multipage, layouts, scripts, and more—see docs for advanced features.
- For mor information visit the [Documentation](dars/docs/index.md)

## Quick Example: Your First App
> Note: this is an single page example but you can build multipage apps with Page component see the [Components Documentation](dars/docs/components.md) to know more.

```python
from dars import App, Container, Text, Button, InlineScript

app = App()

# Crear aplicación con sintaxis nueva (v1.0.3)
container = Container(
    Text(
        "Hola Dars",
        style={'font-size': '32px', 'color': '#333'}
    ),
    Button(
        "Hacer clic",
        style={'background-color': '#007bff', 'color': 'white'}
    ),
    style={
        'display': 'flex',
        'flex-direction': 'column',
        'align-items': 'center',
        'padding': '40px'
    }
)

# Script para interactividad
script = InlineScript("""
document.addEventListener('DOMContentLoaded', function() {
    const boton = document.querySelector('button');
    boton.addEventListener('click', function() {
        alert('Hola desde Dars.');
    });
});
""")

# Ensamblar aplicación
app.set_root(container)
app.add_script(script)

if __name__ == "__main__":
    app.rTimeCompile()  # Live preview at http://localhost:8000

```

## CLI Usage
| Command                                 | What it does                               |
|-----------------------------------------|--------------------------------------------|
| `dars export my_app.py --format html`   | Export app to HTML/CSS/JS in `./my_app_web` |
| `dars preview ./my_app_web`             | Preview exported app locally                |
| `dars init my_project`                  | Create a new Dars project                   |
| `dars info my_app.py`                   | Show info about your app                    |
| `dars formats`                          | List supported export formats               |
| `dars --help`                           | Show help and all CLI options               |

## More
- [Project Roadmap](ROADMAP.md)
- [Getting Started](dars/docs/getting_started.md)
- [Components Documentation](dars/docs/components.md)
- [Custom Components](dars/docs/custom_components.md)
- [Event Handling](dars/docs/events.md)
- [Exporters](dars/docs/exporters.md)
- [Scripts System](dars/docs/scripts.md)
- [CLI usage and commands](dars/docs/cli.md)
- [Project Structure](STRUCTURE.md)
- [Architecture](DARS_ARCHITECTURE.md)
- [Installation Guide](INSTALL.md)

## Local Execution and Live Preview

To test your app locally before exporting, use the hot-reload preview from any Python file that defines your app:

```python
if __name__ == "__main__":
    app.rTimeCompile()
```

Then run your file directly:

```bash
python my_app.py
```

This will start a local server at http://localhost:8000 so you can view your app in the browser—no manual export needed. You can change the port with:

```bash
python my_app.py --port 8088
```

---

You can also use the CLI preview command on an exported app:

```bash
dars preview ./my_exported_app
```

This will start a local server at http://localhost:8000 to view your exported app in the browser.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dars-framework",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "ztamdev <zondax2009@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/4f/f8888e16cd5dcb8824f3acef1a8bb40ac9b16c54b1fed5c594009f0131db/dars_framework-1.1.1.tar.gz",
    "platform": null,
    "description": "# Dars Framework\r\n\r\nDars is a Python UI framework for building modern, interactive web apps with Python code. Write your interface in Python, export it to static HTML/CSS/JS, and deploy anywhere.\r\n\r\n> Some Javascript or frontend stack required.\r\n\r\n```bash\r\npip install dars-framework\r\n```\r\n\r\n## How It Works\r\n- Build your UI using Python classes and components (like Text, Button, Container, Page, etc).\r\n- Preview instantly with hot-reload using `app.rTimeCompile()`.\r\n- Export your app to static web files with a single CLI command.\r\n- Use multipage, layouts, scripts, and more\u2014see docs for advanced features.\r\n- For mor information visit the [Documentation](dars/docs/index.md)\r\n\r\n## Quick Example: Your First App\r\n> Note: this is an single page example but you can build multipage apps with Page component see the [Components Documentation](dars/docs/components.md) to know more.\r\n\r\n```python\r\nfrom dars import App, Container, Text, Button, InlineScript\r\n\r\napp = App()\r\n\r\n# Crear aplicaci\u00f3n con sintaxis nueva (v1.0.3)\r\ncontainer = Container(\r\n    Text(\r\n        \"Hola Dars\",\r\n        style={'font-size': '32px', 'color': '#333'}\r\n    ),\r\n    Button(\r\n        \"Hacer clic\",\r\n        style={'background-color': '#007bff', 'color': 'white'}\r\n    ),\r\n    style={\r\n        'display': 'flex',\r\n        'flex-direction': 'column',\r\n        'align-items': 'center',\r\n        'padding': '40px'\r\n    }\r\n)\r\n\r\n# Script para interactividad\r\nscript = InlineScript(\"\"\"\r\ndocument.addEventListener('DOMContentLoaded', function() {\r\n    const boton = document.querySelector('button');\r\n    boton.addEventListener('click', function() {\r\n        alert('Hola desde Dars.');\r\n    });\r\n});\r\n\"\"\")\r\n\r\n# Ensamblar aplicaci\u00f3n\r\napp.set_root(container)\r\napp.add_script(script)\r\n\r\nif __name__ == \"__main__\":\r\n    app.rTimeCompile()  # Live preview at http://localhost:8000\r\n\r\n```\r\n\r\n## CLI Usage\r\n| Command                                 | What it does                               |\r\n|-----------------------------------------|--------------------------------------------|\r\n| `dars export my_app.py --format html`   | Export app to HTML/CSS/JS in `./my_app_web` |\r\n| `dars preview ./my_app_web`             | Preview exported app locally                |\r\n| `dars init my_project`                  | Create a new Dars project                   |\r\n| `dars info my_app.py`                   | Show info about your app                    |\r\n| `dars formats`                          | List supported export formats               |\r\n| `dars --help`                           | Show help and all CLI options               |\r\n\r\n## More\r\n- [Project Roadmap](ROADMAP.md)\r\n- [Getting Started](dars/docs/getting_started.md)\r\n- [Components Documentation](dars/docs/components.md)\r\n- [Custom Components](dars/docs/custom_components.md)\r\n- [Event Handling](dars/docs/events.md)\r\n- [Exporters](dars/docs/exporters.md)\r\n- [Scripts System](dars/docs/scripts.md)\r\n- [CLI usage and commands](dars/docs/cli.md)\r\n- [Project Structure](STRUCTURE.md)\r\n- [Architecture](DARS_ARCHITECTURE.md)\r\n- [Installation Guide](INSTALL.md)\r\n\r\n## Local Execution and Live Preview\r\n\r\nTo test your app locally before exporting, use the hot-reload preview from any Python file that defines your app:\r\n\r\n```python\r\nif __name__ == \"__main__\":\r\n    app.rTimeCompile()\r\n```\r\n\r\nThen run your file directly:\r\n\r\n```bash\r\npython my_app.py\r\n```\r\n\r\nThis will start a local server at http://localhost:8000 so you can view your app in the browser\u2014no manual export needed. You can change the port with:\r\n\r\n```bash\r\npython my_app.py --port 8088\r\n```\r\n\r\n---\r\n\r\nYou can also use the CLI preview command on an exported app:\r\n\r\n```bash\r\ndars preview ./my_exported_app\r\n```\r\n\r\nThis will start a local server at http://localhost:8000 to view your exported app in the browser.\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2025 ZtaDev\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 \"Software\"), 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 \"AS IS\", 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": "Dars is a Python UI framework for building modern, interactive web apps with only Python code. Write your interface in Python, export it to static HTML/CSS/JS, and deploy anywhere.",
    "version": "1.1.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "60e2751eb18e6c478c5896f70d9d42d13be391a5977137dcc2da2a270392ca3c",
                "md5": "9ec04a7d12a0e6e978960bc6630c35f3",
                "sha256": "0f8b65fb62c5a3ce3da371863a3c1b206546a5e55e94dc9c42ded89d5191ec86"
            },
            "downloads": -1,
            "filename": "dars_framework-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ec04a7d12a0e6e978960bc6630c35f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 177221,
            "upload_time": "2025-08-31T20:14:55",
            "upload_time_iso_8601": "2025-08-31T20:14:55.401449Z",
            "url": "https://files.pythonhosted.org/packages/60/e2/751eb18e6c478c5896f70d9d42d13be391a5977137dcc2da2a270392ca3c/dars_framework-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "904ff8888e16cd5dcb8824f3acef1a8bb40ac9b16c54b1fed5c594009f0131db",
                "md5": "7ed2592356087c86087b1fb323fb9458",
                "sha256": "82dfe6e9b5c306b70e37d8c947ebaeadc22d35d5484a8572e985c06b5c1fa3f4"
            },
            "downloads": -1,
            "filename": "dars_framework-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7ed2592356087c86087b1fb323fb9458",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 149959,
            "upload_time": "2025-08-31T20:14:56",
            "upload_time_iso_8601": "2025-08-31T20:14:56.811612Z",
            "url": "https://files.pythonhosted.org/packages/90/4f/f8888e16cd5dcb8824f3acef1a8bb40ac9b16c54b1fed5c594009f0131db/dars_framework-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-31 20:14:56",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dars-framework"
}
        
Elapsed time: 1.05895s