tina4-python 3.10.41__tar.gz → 3.10.43__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tina4_python-3.10.41 → tina4_python-3.10.43}/PKG-INFO +2 -2
- {tina4_python-3.10.41 → tina4_python-3.10.43}/README.md +1 -1
- {tina4_python-3.10.41 → tina4_python-3.10.43}/pyproject.toml +4 -1
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/__init__.py +1 -1
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/ai/__init__.py +264 -115
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/__init__.py +2 -2
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/server.py +69 -70
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/dev_admin/__init__.py +9 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/dev_admin/metrics.py +18 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/.gitignore +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/CLAUDE.md +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/HtmlElement.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/Testing.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/api/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/auth/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/cache/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/cli/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/container/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/cache.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/constants.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/events.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/middleware.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/request.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/response.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/core/router.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/crud/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/adapter.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/connection.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/firebird.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/mssql.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/mysql.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/odbc.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/postgres.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/database/sqlite.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/debug/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/debug/error_overlay.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/dev_reload.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/dotenv/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/frond/FROND.md +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/frond/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/frond/engine.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/auth/meta.json +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/auth/src/routes/api/gallery_auth.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/database/meta.json +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/database/src/routes/api/gallery_db.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/error-overlay/meta.json +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/error-overlay/src/routes/api/gallery_crash.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/orm/meta.json +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/orm/src/orm/Product.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/orm/src/routes/api/gallery_products.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/queue/meta.json +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/queue/src/routes/api/gallery_queue.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/rest-api/meta.json +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/rest-api/src/routes/api/gallery_hello.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/templates/meta.json +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/templates/src/routes/gallery_page.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/gallery/templates/src/templates/gallery_page.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/graphql/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/i18n/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/mcp/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/mcp/protocol.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/mcp/tools.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/messenger/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/migration/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/migration/runner.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/orm/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/orm/fields.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/orm/model.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/css/tina4.css +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/css/tina4.min.css +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/favicon.ico +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/images/logo.svg +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/images/tina4-logo-icon.webp +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/js/frond.min.js +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/js/tina4-dev-admin.min.js +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/js/tina4.min.js +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/js/tina4js.min.js +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/swagger/index.html +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/query_builder/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/queue/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/queue_backends/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/queue_backends/kafka_backend.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/queue_backends/mongo_backend.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/queue_backends/rabbitmq_backend.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_alerts.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_badges.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_buttons.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_cards.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_forms.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_grid.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_modals.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_nav.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_reset.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_tables.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_typography.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_utilities.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/_variables.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/base.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/colors.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/scss/tina4css/tina4.scss +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/seeder/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/service/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/session/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/session_handlers/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/session_handlers/mongodb_handler.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/session_handlers/redis_handler.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/session_handlers/valkey_handler.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/swagger/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/components/crud.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/docker/distroless/Dockerfile +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/docker/poetry/Dockerfile +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/docker/python/Dockerfile +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/docker/uv/Dockerfile +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/302.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/401.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/403.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/404.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/500.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/502.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/503.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/errors/base.twig +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/frontend/README.md +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/templates/readme.md +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/test_client/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/af/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/af/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/es/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/es/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/ja/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/ja/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/zh/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/translations/zh/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/validator/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/websocket/__init__.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/websocket/backplane.py +0 -0
- {tina4_python-3.10.41 → tina4_python-3.10.43}/tina4_python/wsdl/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tina4-python
|
|
3
|
-
Version: 3.10.
|
|
3
|
+
Version: 3.10.43
|
|
4
4
|
Summary: Tina4 for Python — 54 built-in features, zero dependencies
|
|
5
5
|
Author-email: Andre van Zuydam <andrevanzuydam@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
|
|
43
43
|
<p align="center">
|
|
44
44
|
<a href="https://pypi.org/project/tina4-python/"><img src="https://img.shields.io/pypi/v/tina4-python?color=7b1fa2&label=PyPI" alt="PyPI"></a>
|
|
45
|
-
<img src="https://img.shields.io/badge/tests-2%
|
|
45
|
+
<img src="https://img.shields.io/badge/tests-2%2C068%20passing-brightgreen" alt="Tests">
|
|
46
46
|
<img src="https://img.shields.io/badge/features-54-blue" alt="Features">
|
|
47
47
|
<img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="Zero Deps">
|
|
48
48
|
<a href="https://tina4.com"><img src="https://img.shields.io/badge/docs-tina4.com-7b1fa2" alt="Docs"></a>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://pypi.org/project/tina4-python/"><img src="https://img.shields.io/pypi/v/tina4-python?color=7b1fa2&label=PyPI" alt="PyPI"></a>
|
|
13
|
-
<img src="https://img.shields.io/badge/tests-2%
|
|
13
|
+
<img src="https://img.shields.io/badge/tests-2%2C068%20passing-brightgreen" alt="Tests">
|
|
14
14
|
<img src="https://img.shields.io/badge/features-54-blue" alt="Features">
|
|
15
15
|
<img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="Zero Deps">
|
|
16
16
|
<a href="https://tina4.com"><img src="https://img.shields.io/badge/docs-tina4.com-7b1fa2" alt="Docs"></a>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tina4-python"
|
|
3
|
-
|
|
3
|
+
dynamic = ["version"]
|
|
4
4
|
description = "Tina4 for Python — 54 built-in features, zero dependencies"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Andre van Zuydam", email = "andrevanzuydam@gmail.com"}
|
|
@@ -55,6 +55,9 @@ dev = [
|
|
|
55
55
|
requires = ["hatchling"]
|
|
56
56
|
build-backend = "hatchling.build"
|
|
57
57
|
|
|
58
|
+
[tool.hatch.version]
|
|
59
|
+
path = "tina4_python/__init__.py"
|
|
60
|
+
|
|
58
61
|
[tool.hatch.build]
|
|
59
62
|
include = ["tina4_python/**/*"]
|
|
60
63
|
|
|
@@ -74,10 +74,9 @@ def install_selected(root: str, selection: str) -> list[str]:
|
|
|
74
74
|
except ValueError:
|
|
75
75
|
pass
|
|
76
76
|
|
|
77
|
-
context = generate_context()
|
|
78
|
-
|
|
79
77
|
for idx in indices:
|
|
80
78
|
tool = AI_TOOLS[idx]
|
|
79
|
+
context = generate_context(tool["name"])
|
|
81
80
|
files = _install_for_tool(root_path, tool, context)
|
|
82
81
|
created.extend(files)
|
|
83
82
|
|
|
@@ -173,139 +172,289 @@ def _install_claude_skills(root: Path) -> list[str]:
|
|
|
173
172
|
return created
|
|
174
173
|
|
|
175
174
|
|
|
176
|
-
def generate_context() -> str:
|
|
177
|
-
"""Generate
|
|
178
|
-
|
|
175
|
+
def generate_context(tool_name: str = "claude-code") -> str:
|
|
176
|
+
"""Generate tool-specific Tina4 context. Each tool gets content suited to its format."""
|
|
177
|
+
from tina4_python import __version__
|
|
178
|
+
v = __version__
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
# Shared building blocks
|
|
181
|
+
_route_example = '''from tina4_python.core.router import get, post, noauth, secured
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
@get("/api/users")
|
|
184
|
+
async def list_users(request, response):
|
|
185
|
+
return response({{"users": []}})
|
|
184
186
|
|
|
185
|
-
|
|
187
|
+
@post("/api/users")
|
|
188
|
+
@noauth()
|
|
189
|
+
async def create_user(request, response):
|
|
190
|
+
return response({{"created": request.body["name"]}}, 201)'''
|
|
186
191
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
_orm_example = '''from tina4_python.orm import ORM, IntegerField, StringField
|
|
193
|
+
|
|
194
|
+
class User(ORM):
|
|
195
|
+
table_name = "users"
|
|
196
|
+
id = IntegerField(primary_key=True, auto_increment=True)
|
|
197
|
+
name = StringField(required=True)
|
|
198
|
+
email = StringField()'''
|
|
199
|
+
|
|
200
|
+
_conventions = """1. Routes return response() — always response(data) not response.json()
|
|
201
|
+
2. GET routes are public, POST/PUT/PATCH/DELETE require auth by default
|
|
202
|
+
3. Use @noauth() to make write routes public, @secured() to protect GET routes
|
|
203
|
+
4. Decorator order: @noauth/@secured then @description/@tags then @get/@post (route innermost)
|
|
204
|
+
5. Every template extends base.twig
|
|
205
|
+
6. All schema changes via migrations — never create tables in route code
|
|
206
|
+
7. Use built-in features — never install packages for things Tina4 already provides"""
|
|
207
|
+
|
|
208
|
+
_features_compact = (
|
|
209
|
+
"Router, ORM, Database (SQLite/PostgreSQL/MySQL/MSSQL/Firebird), "
|
|
210
|
+
"Frond templates (Twig-compatible), JWT auth, Sessions (File/Redis/Valkey/MongoDB/DB), "
|
|
211
|
+
"GraphQL + GraphiQL, WebSocket + Redis backplane, WSDL/SOAP, Queue (File/RabbitMQ/Kafka/MongoDB), "
|
|
212
|
+
"HTTP client, Messenger (SMTP/IMAP), FakeData/Seeder, Migrations, SCSS compiler, "
|
|
213
|
+
"Swagger/OpenAPI, i18n, Events, Container/DI, HtmlElement, Inline testing, "
|
|
214
|
+
"Error overlay, Dev dashboard, Rate limiter, Response cache, Logging, MCP server"
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
_project_structure = """src/routes/ — Route handlers (auto-discovered)
|
|
218
|
+
src/orm/ — ORM models
|
|
219
|
+
src/templates/ — Twig templates
|
|
220
|
+
src/app/ — Service classes
|
|
221
|
+
src/scss/ — SCSS (auto-compiled)
|
|
222
|
+
src/public/ — Static assets
|
|
223
|
+
src/seeds/ — Database seeders
|
|
224
|
+
migrations/ — SQL migration files
|
|
225
|
+
tests/ — pytest tests"""
|
|
226
|
+
|
|
227
|
+
# ── Cursor: compact key patterns ──
|
|
228
|
+
if tool_name == "cursor":
|
|
229
|
+
return f"""# tina4-python — Cursor Rules
|
|
230
|
+
|
|
231
|
+
Tina4 Python v{v}. 54 built-in features, zero dependencies. Python 3.12+.
|
|
232
|
+
|
|
233
|
+
## Key Patterns
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
{_route_example}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
{_orm_example}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Critical Rules
|
|
244
|
+
|
|
245
|
+
{_conventions}
|
|
246
|
+
|
|
247
|
+
## Built-in Features
|
|
248
|
+
|
|
249
|
+
{_features_compact}
|
|
250
|
+
|
|
251
|
+
## Docs
|
|
252
|
+
|
|
253
|
+
https://tina4.com
|
|
254
|
+
"""
|
|
255
|
+
|
|
256
|
+
# ── Copilot: short instructions ──
|
|
257
|
+
if tool_name == "copilot":
|
|
258
|
+
return f"""# tina4-python Copilot Instructions
|
|
259
|
+
|
|
260
|
+
Tina4 Python v{v}. 54 features, zero dependencies.
|
|
261
|
+
|
|
262
|
+
## Route Pattern
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
{_route_example}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Critical Rules
|
|
269
|
+
|
|
270
|
+
{_conventions}
|
|
271
|
+
|
|
272
|
+
## Built-in (use these, don't install alternatives)
|
|
273
|
+
|
|
274
|
+
{_features_compact}
|
|
275
|
+
"""
|
|
276
|
+
|
|
277
|
+
# ── Windsurf: same format as Cursor ──
|
|
278
|
+
if tool_name == "windsurf":
|
|
279
|
+
return f"""# tina4-python — Windsurf Rules
|
|
280
|
+
|
|
281
|
+
Tina4 Python v{v}. 54 built-in features, zero dependencies. Python 3.12+.
|
|
282
|
+
|
|
283
|
+
## Key Patterns
|
|
284
|
+
|
|
285
|
+
```python
|
|
286
|
+
{_route_example}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
```python
|
|
290
|
+
{_orm_example}
|
|
193
291
|
```
|
|
194
292
|
|
|
293
|
+
## Conventions
|
|
294
|
+
|
|
295
|
+
{_conventions}
|
|
296
|
+
|
|
297
|
+
## Built-in Features
|
|
298
|
+
|
|
299
|
+
{_features_compact}
|
|
300
|
+
|
|
195
301
|
## Project Structure
|
|
196
302
|
|
|
197
303
|
```
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
304
|
+
{_project_structure}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Docs
|
|
308
|
+
|
|
309
|
+
https://tina4.com
|
|
310
|
+
"""
|
|
311
|
+
|
|
312
|
+
# ── Aider (CONVENTIONS.md): concise conventions ──
|
|
313
|
+
if tool_name == "aider":
|
|
314
|
+
return f"""# Tina4 Python — Conventions
|
|
315
|
+
|
|
316
|
+
v{v} — 54 built-in features, zero dependencies.
|
|
317
|
+
|
|
318
|
+
## Rules
|
|
319
|
+
|
|
320
|
+
{_conventions}
|
|
321
|
+
|
|
322
|
+
## Route Pattern
|
|
323
|
+
|
|
324
|
+
```python
|
|
325
|
+
{_route_example}
|
|
208
326
|
```
|
|
209
327
|
|
|
210
|
-
##
|
|
211
|
-
|
|
212
|
-
| Feature | Module | Import |
|
|
213
|
-
|---------|--------|--------|
|
|
214
|
-
| Routing | router | `from tina4_python.core.router import get, post, put, delete` |
|
|
215
|
-
| ORM | orm | `from tina4_python.orm import ORM, IntegerField, StringField` |
|
|
216
|
-
| Database | database | `from tina4_python.database import Database` |
|
|
217
|
-
| Templates | template | `response.render("page.twig", data)` |
|
|
218
|
-
| JWT Auth | auth | `from tina4_python.auth import Auth, hash_password, check_password` |
|
|
219
|
-
| REST API Client | api | `from tina4_python.api import Api` |
|
|
220
|
-
| GraphQL | graphql | `from tina4_python.graphql import GraphQL, Schema` |
|
|
221
|
-
| WebSocket | websocket | `from tina4_python.websocket import WebSocketServer` |
|
|
222
|
-
| SOAP/WSDL | wsdl | `from tina4_python.wsdl import WSDL, wsdl_operation` |
|
|
223
|
-
| Email (SMTP+IMAP) | messenger | `from tina4_python.messenger import Messenger` |
|
|
224
|
-
| Background Queue | queue | `from tina4_python.queue import Queue` |
|
|
225
|
-
| SCSS Compilation | scss | Auto-compiled from src/scss/ |
|
|
226
|
-
| Migrations | migration | `tina4python migrate` CLI command |
|
|
227
|
-
| Seeder | seeder | `from tina4_python.seeder import FakeData, seed_table` |
|
|
228
|
-
| i18n | localization | `from tina4_python.localization import Localization` |
|
|
229
|
-
| Swagger/OpenAPI | swagger | Auto-generated at /swagger |
|
|
230
|
-
| Sessions | session | `request.session.get(key)` / `.set(key, value)` |
|
|
231
|
-
| Middleware | middleware | `@middleware(MyMiddleware)` decorator |
|
|
232
|
-
| HTML Builder | html_element | `from tina4_python.html_element import HTMLElement` |
|
|
233
|
-
| Form Tokens | template | `{{{{ form_token() }}}}` in Twig |
|
|
234
|
-
|
|
235
|
-
## Key Conventions
|
|
236
|
-
|
|
237
|
-
1. **Routes return `response()`** — always use `response(data)` not `response.json()`
|
|
238
|
-
2. **GET routes are public**, POST/PUT/PATCH/DELETE require auth by default
|
|
239
|
-
3. **Use `@noauth()`** to make write routes public, `@secured()` to protect GET routes
|
|
240
|
-
4. **Decorator order**: `@noauth/@secured` → `@description/@tags` → `@get/@post` (route decorator innermost)
|
|
241
|
-
5. **Every template extends `base.twig`** — no standalone HTML pages
|
|
242
|
-
6. **No inline styles** — use SCSS in `src/scss/` with CSS variables
|
|
243
|
-
7. **No hardcoded colors** — use `var(--primary)`, `var(--text)`, etc.
|
|
244
|
-
8. **All schema changes via migrations** — never create tables in route code
|
|
245
|
-
9. **Service pattern** — complex logic goes in `src/app/` service classes, routes stay thin
|
|
246
|
-
10. **Use built-in features** — never install packages for things Tina4 already provides
|
|
247
|
-
|
|
248
|
-
## AI Workflow — Available Skills
|
|
249
|
-
|
|
250
|
-
When using an AI coding assistant with Tina4, these skills are available:
|
|
251
|
-
|
|
252
|
-
| Skill | Description |
|
|
253
|
-
|-------|-------------|
|
|
254
|
-
| `/tina4-route` | Create a new route with proper decorators and auth |
|
|
255
|
-
| `/tina4-orm` | Create an ORM model with migration |
|
|
256
|
-
| `/tina4-crud` | Generate complete CRUD (migration, ORM, routes, template, tests) |
|
|
257
|
-
| `/tina4-auth` | Set up JWT authentication with login/register |
|
|
258
|
-
| `/tina4-api` | Create an external API integration |
|
|
259
|
-
| `/tina4-queue` | Set up background job processing |
|
|
260
|
-
| `/tina4-template` | Create a server-rendered template page |
|
|
261
|
-
| `/tina4-graphql` | Set up a GraphQL endpoint |
|
|
262
|
-
| `/tina4-websocket` | Set up WebSocket communication |
|
|
263
|
-
| `/tina4-wsdl` | Create a SOAP/WSDL service |
|
|
264
|
-
| `/tina4-messenger` | Set up email send/receive |
|
|
265
|
-
| `/tina4-test` | Write tests for a feature |
|
|
266
|
-
| `/tina4-migration` | Create a database migration |
|
|
267
|
-
| `/tina4-seed` | Generate fake data for development |
|
|
268
|
-
| `/tina4-i18n` | Set up internationalization |
|
|
269
|
-
| `/tina4-scss` | Set up SCSS stylesheets |
|
|
270
|
-
| `/tina4-frontend` | Set up a frontend framework |
|
|
271
|
-
|
|
272
|
-
## Common Patterns
|
|
273
|
-
|
|
274
|
-
### Route
|
|
328
|
+
## ORM Pattern
|
|
329
|
+
|
|
275
330
|
```python
|
|
276
|
-
|
|
277
|
-
|
|
331
|
+
{_orm_example}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Structure
|
|
278
335
|
|
|
279
|
-
@noauth()
|
|
280
|
-
@description("Create a widget")
|
|
281
|
-
@tags(["widgets"])
|
|
282
|
-
@post("/api/widgets")
|
|
283
|
-
async def create_widget(request, response):
|
|
284
|
-
data = request.body
|
|
285
|
-
return response({{"created": True}}, 201)
|
|
286
336
|
```
|
|
337
|
+
{_project_structure}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## Built-in Features
|
|
341
|
+
|
|
342
|
+
{_features_compact}
|
|
343
|
+
"""
|
|
344
|
+
|
|
345
|
+
# ── Cline: same as Cursor ──
|
|
346
|
+
if tool_name == "cline":
|
|
347
|
+
return f"""# tina4-python — Cline Rules
|
|
348
|
+
|
|
349
|
+
Tina4 Python v{v}. 54 built-in features, zero dependencies. Python 3.12+.
|
|
350
|
+
|
|
351
|
+
## Key Patterns
|
|
287
352
|
|
|
288
|
-
### ORM Model
|
|
289
353
|
```python
|
|
290
|
-
|
|
354
|
+
{_route_example}
|
|
355
|
+
```
|
|
291
356
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
357
|
+
```python
|
|
358
|
+
{_orm_example}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Conventions
|
|
362
|
+
|
|
363
|
+
{_conventions}
|
|
364
|
+
|
|
365
|
+
## Built-in Features
|
|
366
|
+
|
|
367
|
+
{_features_compact}
|
|
368
|
+
"""
|
|
369
|
+
|
|
370
|
+
# ── Codex (AGENTS.md): task-oriented ──
|
|
371
|
+
if tool_name == "codex":
|
|
372
|
+
return f"""# Tina4 Python — Agent Instructions
|
|
373
|
+
|
|
374
|
+
v{v}. 54 built-in features, zero dependencies. Python 3.12+.
|
|
375
|
+
|
|
376
|
+
## Framework
|
|
377
|
+
|
|
378
|
+
This project uses Tina4 Python. All features are built in — do not install external packages for routing, ORM, auth, templates, GraphQL, WebSocket, email, queues, or any other feature listed below.
|
|
379
|
+
|
|
380
|
+
## Conventions
|
|
381
|
+
|
|
382
|
+
{_conventions}
|
|
383
|
+
|
|
384
|
+
## Route Pattern
|
|
385
|
+
|
|
386
|
+
```python
|
|
387
|
+
{_route_example}
|
|
295
388
|
```
|
|
296
389
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
{
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
390
|
+
## ORM Pattern
|
|
391
|
+
|
|
392
|
+
```python
|
|
393
|
+
{_orm_example}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
## Available Features
|
|
397
|
+
|
|
398
|
+
{_features_compact}
|
|
399
|
+
|
|
400
|
+
## Project Structure
|
|
401
|
+
|
|
308
402
|
```
|
|
403
|
+
{_project_structure}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## CLI
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
tina4python serve # Dev server on port 7145
|
|
410
|
+
tina4python migrate # Run migrations
|
|
411
|
+
tina4python test # Run tests
|
|
412
|
+
tina4python routes # List routes
|
|
413
|
+
```
|
|
414
|
+
"""
|
|
415
|
+
|
|
416
|
+
# ── Claude Code (CLAUDE.md): full developer guide — defer to existing CLAUDE.md ──
|
|
417
|
+
# For claude-code, read the existing CLAUDE.md from the framework repo
|
|
418
|
+
# as it's the most detailed and maintained file
|
|
419
|
+
if tool_name == "claude-code":
|
|
420
|
+
framework_claude = Path(__file__).parent.parent.parent / "CLAUDE.md"
|
|
421
|
+
if framework_claude.exists():
|
|
422
|
+
return framework_claude.read_text(encoding="utf-8")
|
|
423
|
+
|
|
424
|
+
# Fallback: universal context
|
|
425
|
+
return f"""# Tina4 Python — AI Context
|
|
426
|
+
|
|
427
|
+
Tina4 Python v{v}. 54 built-in features, zero dependencies.
|
|
428
|
+
|
|
429
|
+
## Conventions
|
|
430
|
+
|
|
431
|
+
{_conventions}
|
|
432
|
+
|
|
433
|
+
## Route Pattern
|
|
434
|
+
|
|
435
|
+
```python
|
|
436
|
+
{_route_example}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
## ORM Pattern
|
|
440
|
+
|
|
441
|
+
```python
|
|
442
|
+
{_orm_example}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
## Built-in Features
|
|
446
|
+
|
|
447
|
+
{_features_compact}
|
|
448
|
+
|
|
449
|
+
## Project Structure
|
|
450
|
+
|
|
451
|
+
```
|
|
452
|
+
{_project_structure}
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
## Docs
|
|
456
|
+
|
|
457
|
+
https://tina4.com
|
|
309
458
|
"""
|
|
310
459
|
|
|
311
460
|
|
|
@@ -19,7 +19,7 @@ from tina4_python.core.router import (
|
|
|
19
19
|
from tina4_python.core.middleware import CorsMiddleware, RateLimiter
|
|
20
20
|
from tina4_python.core.cache import Cache
|
|
21
21
|
from tina4_python.core.events import on, off, emit, emit_async, once, listeners, events, clear as clear_events
|
|
22
|
-
from tina4_python.core.server import run, resolve_config
|
|
22
|
+
from tina4_python.core.server import run, resolve_config, handle
|
|
23
23
|
|
|
24
24
|
__all__ = [
|
|
25
25
|
"Request", "Response", "Router",
|
|
@@ -28,5 +28,5 @@ __all__ = [
|
|
|
28
28
|
"CorsMiddleware", "RateLimiter",
|
|
29
29
|
"Cache",
|
|
30
30
|
"on", "off", "emit", "emit_async", "once", "listeners", "events", "clear_events",
|
|
31
|
-
"run", "resolve_config",
|
|
31
|
+
"run", "resolve_config", "handle",
|
|
32
32
|
]
|