Name | z8ter JSON |
Version |
0.1.4
JSON |
| download |
home_page | None |
Summary | Minimal Starlette-powered app framework with pages, APIs, and a DX-first CLI. |
upload_time | 2025-08-26 04:16:33 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | MIT License
Copyright (c) 2025 Ashesh Nepal
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 |
starlette
asgi
framework
uvicorn
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Z8ter.py
**Z8ter** is a lightweight, Laravel-inspired full-stack Python web framework built on [Starlette], designed for rapid development with tight integration between backend logic and frontend templates—plus small client-side “islands” where they make sense.
---
## ✨ Features (Current)
### 1) File-Based Views (SSR)
- Files under `views/` become routes automatically.
- Each view pairs Python logic with a Jinja template in `templates/`.
- A stable `page_id` (derived from `views/` path) is injected into templates and used by the frontend loader to hydrate per-page JS.
### 2) Jinja2 Templating
- Template inheritance with `{% extends %}` / `{% block %}`.
- Templates live in `templates/` (default extension: `.jinja`).
### 3) Small CSR “Islands”
- A tiny client router lazy-loads `/static/js/pages/<page_id>.js` and runs its default export.
- Great for interactive bits (theme toggles, pings, clipboard, etc.) without going full SPA.
### 4) Decorator-Driven APIs
- Classes under `api/` subclass `API` and register endpoints with a decorator.
- Each class mounts under `/api/<id>` (derived from module path).
> Example shape (conceptual):
> ```
> api/hello.py → /api/hello
> views/about.py → /about
> templates/about.jinja + static/js/pages/about.js (island)
> ```
---
## 🚀 Getting Started
### Prerequisites
- Python 3.11+ and `pip`
- Node 18+ and `npm`
### Install & Run (dev)
```bash
# 1) Python deps (in a venv)
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\Activate.ps1
pip install -r requirements.txt # or: pip install -e .
# 2) Frontend deps
npm install
# 3) Dev server(s)
npm run dev
````
> `npm run dev` runs the dev workflow (backend + assets). Check the terminal for the local URL.
---
## 📁 Project Structure
```
.
├─ api/ # API classes (@API.endpoint)
│ └─ hello.py
├─ views/ # File-based pages (SSR)
│ └─ index.py
├─ templates/ # Jinja templates
│ ├─ base.jinja
│ └─ index.jinja
├─ static/
│ └─ js/
│ └─ pages/ # Per-page islands: about.js, app/home.js, ...
│ └─ common.js
├─ z8ter/ # Framework core (Page, API, router)
└─ main.py # App entrypoint
```
---
## 🧩 Usage Examples
### View + Template (SSR)
```jinja
{# templates/index.jinja #}
{% extends "base.jinja" %}
{% block content %}
<h1>{{ title }}</h1>
<div id="api-response"></div>
{% endblock %}
```
### Client Island (runs when `page_id` matches)
```ts
// static/js/pages/common.ts (or a specific page module)
export default async function init() {
// hydrate interactive bits, fetch data, etc.
}
```
### Minimal API Class
```python
# api/hello.py
from z8ter.api import API
class Hello(API):
@API.endpoint("GET", "/hello")
async def hello(self, request):
return {"ok": True, "message": "Hello from Z8ter"}
```
---
## 🛣️ Planned
* **CLI scaffolding**: `z8 new`, `z8 dev`, `z8 create_page <name>`
* **Auth scaffolding**: login/register/logout + session helpers
* **Stripe integration**: pricing page, checkout routes, webhooks
* **DB adapters**: SQLite default, Postgres option
* **HTMX + Tailwind/DaisyUI** polish out of the box
---
## 🧠 Philosophy
* Conventions over configuration
* SSR-first with tiny CSR islands
* Small surface area; sharp, pragmatic tools
Raw data
{
"_id": null,
"home_page": null,
"name": "z8ter",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "starlette, asgi, framework, uvicorn",
"author": null,
"author_email": "Ashesh Nepal <you@example.com>",
"download_url": "https://files.pythonhosted.org/packages/33/10/0740df847f0e51ab1ff28003bc0c9062dbd4bcfe20ca45e82c3f9ed53af3/z8ter-0.1.4.tar.gz",
"platform": null,
"description": "# Z8ter.py\n\n**Z8ter** is a lightweight, Laravel-inspired full-stack Python web framework built on [Starlette], designed for rapid development with tight integration between backend logic and frontend templates\u2014plus small client-side \u201cislands\u201d where they make sense.\n\n---\n\n## \u2728 Features (Current)\n\n### 1) File-Based Views (SSR)\n- Files under `views/` become routes automatically.\n- Each view pairs Python logic with a Jinja template in `templates/`.\n- A stable `page_id` (derived from `views/` path) is injected into templates and used by the frontend loader to hydrate per-page JS.\n\n### 2) Jinja2 Templating\n- Template inheritance with `{% extends %}` / `{% block %}`.\n- Templates live in `templates/` (default extension: `.jinja`).\n\n### 3) Small CSR \u201cIslands\u201d\n- A tiny client router lazy-loads `/static/js/pages/<page_id>.js` and runs its default export.\n- Great for interactive bits (theme toggles, pings, clipboard, etc.) without going full SPA.\n\n### 4) Decorator-Driven APIs\n- Classes under `api/` subclass `API` and register endpoints with a decorator.\n- Each class mounts under `/api/<id>` (derived from module path).\n\n> Example shape (conceptual):\n> ```\n> api/hello.py \u2192 /api/hello\n> views/about.py \u2192 /about\n> templates/about.jinja + static/js/pages/about.js (island)\n> ```\n\n---\n\n## \ud83d\ude80 Getting Started\n\n### Prerequisites\n- Python 3.11+ and `pip`\n- Node 18+ and `npm`\n\n### Install & Run (dev)\n```bash\n# 1) Python deps (in a venv)\npython -m venv .venv\nsource .venv/bin/activate # Windows: .\\.venv\\Scripts\\Activate.ps1\npip install -r requirements.txt # or: pip install -e .\n\n# 2) Frontend deps\nnpm install\n\n# 3) Dev server(s)\nnpm run dev\n````\n\n> `npm run dev` runs the dev workflow (backend + assets). Check the terminal for the local URL.\n\n---\n\n## \ud83d\udcc1 Project Structure\n\n```\n.\n\u251c\u2500 api/ # API classes (@API.endpoint)\n\u2502 \u2514\u2500 hello.py\n\u251c\u2500 views/ # File-based pages (SSR)\n\u2502 \u2514\u2500 index.py\n\u251c\u2500 templates/ # Jinja templates\n\u2502 \u251c\u2500 base.jinja\n\u2502 \u2514\u2500 index.jinja\n\u251c\u2500 static/\n\u2502 \u2514\u2500 js/\n\u2502 \u2514\u2500 pages/ # Per-page islands: about.js, app/home.js, ...\n\u2502 \u2514\u2500 common.js\n\u251c\u2500 z8ter/ # Framework core (Page, API, router)\n\u2514\u2500 main.py # App entrypoint\n```\n\n---\n\n## \ud83e\udde9 Usage Examples\n\n### View + Template (SSR)\n\n```jinja\n{# templates/index.jinja #}\n{% extends \"base.jinja\" %}\n{% block content %}\n <h1>{{ title }}</h1>\n <div id=\"api-response\"></div>\n{% endblock %}\n```\n\n### Client Island (runs when `page_id` matches)\n\n```ts\n// static/js/pages/common.ts (or a specific page module)\nexport default async function init() {\n // hydrate interactive bits, fetch data, etc.\n}\n```\n\n### Minimal API Class\n\n```python\n# api/hello.py\nfrom z8ter.api import API\n\nclass Hello(API):\n @API.endpoint(\"GET\", \"/hello\")\n async def hello(self, request):\n return {\"ok\": True, \"message\": \"Hello from Z8ter\"}\n```\n\n---\n\n## \ud83d\udee3\ufe0f Planned\n\n* **CLI scaffolding**: `z8 new`, `z8 dev`, `z8 create_page <name>`\n* **Auth scaffolding**: login/register/logout + session helpers\n* **Stripe integration**: pricing page, checkout routes, webhooks\n* **DB adapters**: SQLite default, Postgres option\n* **HTMX + Tailwind/DaisyUI** polish out of the box\n\n---\n\n## \ud83e\udde0 Philosophy\n\n* Conventions over configuration\n* SSR-first with tiny CSR islands\n* Small surface area; sharp, pragmatic tools\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Ashesh Nepal\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Minimal Starlette-powered app framework with pages, APIs, and a DX-first CLI.",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/ashesh808/Z8ter",
"Issues": "https://github.com/ashesh808/Z8ter/issues"
},
"split_keywords": [
"starlette",
" asgi",
" framework",
" uvicorn"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5d196da59889d03715d71804fdcf8d31bc6818c70924a13931017277ca5f9fb4",
"md5": "83044dbfca02613422f3498a91acc21c",
"sha256": "5df8c0413d64ff82b3f842498b6300f78d0684d09c9c3173cabf3528946a42c7"
},
"downloads": -1,
"filename": "z8ter-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "83044dbfca02613422f3498a91acc21c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 14305,
"upload_time": "2025-08-26T04:16:32",
"upload_time_iso_8601": "2025-08-26T04:16:32.290341Z",
"url": "https://files.pythonhosted.org/packages/5d/19/6da59889d03715d71804fdcf8d31bc6818c70924a13931017277ca5f9fb4/z8ter-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "33100740df847f0e51ab1ff28003bc0c9062dbd4bcfe20ca45e82c3f9ed53af3",
"md5": "433b110317563f4a9e1b4d4b30cebcb3",
"sha256": "414904e41f0ada22f541cfd3e5f92060f72033384d3d1b922bed647356198658"
},
"downloads": -1,
"filename": "z8ter-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "433b110317563f4a9e1b4d4b30cebcb3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 14147,
"upload_time": "2025-08-26T04:16:33",
"upload_time_iso_8601": "2025-08-26T04:16:33.194440Z",
"url": "https://files.pythonhosted.org/packages/33/10/0740df847f0e51ab1ff28003bc0c9062dbd4bcfe20ca45e82c3f9ed53af3/z8ter-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-26 04:16:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ashesh808",
"github_project": "Z8ter",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "z8ter"
}