spry-core 0.1.0__py3-none-any.whl
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.
- spry/__init__.py +95 -0
- spry/app.py +741 -0
- spry/auth.py +264 -0
- spry/cli.py +428 -0
- spry/config.py +167 -0
- spry/controllers.py +97 -0
- spry/cors.py +57 -0
- spry/csrf.py +46 -0
- spry/db/__init__.py +11 -0
- spry/db/backend.py +129 -0
- spry/db/backends/__init__.py +50 -0
- spry/db/backends/mariadb.py +7 -0
- spry/db/backends/mysql.py +72 -0
- spry/db/backends/postgres.py +86 -0
- spry/db/backends/sqlite.py +62 -0
- spry/db/backends/sqlserver.py +91 -0
- spry/db/column_type.py +9 -0
- spry/db/url.py +55 -0
- spry/debug.py +134 -0
- spry/di.py +172 -0
- spry/events.py +48 -0
- spry/http.py +308 -0
- spry/i18n.py +73 -0
- spry/middleware.py +22 -0
- spry/openapi.py +288 -0
- spry/orm.py +737 -0
- spry/results.py +26 -0
- spry/routing.py +149 -0
- spry/scaffold.py +72 -0
- spry/session.py +122 -0
- spry/tasks.py +63 -0
- spry/templates/api/Dockerfile.tmpl +30 -0
- spry/templates/api/README.md.tmpl +29 -0
- spry/templates/api/appsettings.json.tmpl +9 -0
- spry/templates/api/docker-compose.yml.tmpl +17 -0
- spry/templates/api/main.py.tmpl +8 -0
- spry/templates/api/pyproject.toml.tmpl +15 -0
- spry/templates/api/src/__PACKAGE_NAME__/__init__.py.tmpl +3 -0
- spry/templates/api/src/__PACKAGE_NAME__/app.py.tmpl +25 -0
- spry/templates/api/src/__PACKAGE_NAME__/controllers.py.tmpl +44 -0
- spry/templates/api/src/__PACKAGE_NAME__/data.py.tmpl +19 -0
- spry/templates/api/src/__PACKAGE_NAME__/seed.py.tmpl +9 -0
- spry/templates/mvc/Dockerfile.tmpl +30 -0
- spry/templates/mvc/README.md.tmpl +109 -0
- spry/templates/mvc/appsettings.json.tmpl +13 -0
- spry/templates/mvc/docker-compose.yml.tmpl +17 -0
- spry/templates/mvc/main.py.tmpl +8 -0
- spry/templates/mvc/pyproject.toml.tmpl +15 -0
- spry/templates/mvc/src/__PACKAGE_NAME__/__init__.py.tmpl +3 -0
- spry/templates/mvc/src/__PACKAGE_NAME__/app.py.tmpl +36 -0
- spry/templates/mvc/src/__PACKAGE_NAME__/controllers.py.tmpl +130 -0
- spry/templates/mvc/src/__PACKAGE_NAME__/data.py.tmpl +25 -0
- spry/templates/mvc/src/__PACKAGE_NAME__/seed.py.tmpl +19 -0
- spry/templates/mvc/static/site.css.tmpl +352 -0
- spry/templates/mvc/views/account/login.html.tmpl +22 -0
- spry/templates/mvc/views/home/_todo_card.html.tmpl +19 -0
- spry/templates/mvc/views/home/index.html.tmpl +93 -0
- spry/templates/mvc/views/shared/_alert.html.tmpl +1 -0
- spry/templates/mvc/views/shared/_empty_state.html.tmpl +7 -0
- spry/templates/mvc/views/shared/_layout.html.tmpl +13 -0
- spry/testing.py +168 -0
- spry/throttling.py +66 -0
- spry/validation.py +160 -0
- spry/validators.py +122 -0
- spry/views.py +582 -0
- spry_core-0.1.0.dist-info/METADATA +426 -0
- spry_core-0.1.0.dist-info/RECORD +71 -0
- spry_core-0.1.0.dist-info/WHEEL +5 -0
- spry_core-0.1.0.dist-info/entry_points.txt +2 -0
- spry_core-0.1.0.dist-info/licenses/LICENSE +21 -0
- spry_core-0.1.0.dist-info/top_level.txt +1 -0
spry/__init__.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
2
|
+
__all__: list[str] = []
|
|
3
|
+
|
|
4
|
+
from spry.app import AppBuilder, Application, deprecated
|
|
5
|
+
from spry.auth import CookieAuthService, JwtAuthService, PasswordHasher, UserPrincipal, authorize
|
|
6
|
+
from spry.controllers import AuthenticatedController, Controller, ControllerBase, serve_static_file
|
|
7
|
+
from spry.cors import CorsConfig
|
|
8
|
+
from spry.csrf import CsrfService
|
|
9
|
+
from spry.db import DatabaseBackend, get_backend, parse_database_url
|
|
10
|
+
from spry.events import EventDispatcher
|
|
11
|
+
from spry.i18n import I18nService
|
|
12
|
+
from spry.http import Request, Response, UploadedFile
|
|
13
|
+
from spry.middleware import HttpContext
|
|
14
|
+
from spry.openapi import OpenApiBuilder
|
|
15
|
+
from spry.orm import DatabaseMigrator, DbContext, DbSet, column, dbset, foreign_key, key, navigation, navigation_many
|
|
16
|
+
from spry.results import bad_request, created, no_content, not_found, ok
|
|
17
|
+
from spry.routing import controller, delete, get, patch, post, put
|
|
18
|
+
from spry.session import SessionMiddleware, SessionStore
|
|
19
|
+
from spry.throttling import TokenBucket
|
|
20
|
+
from spry.validation import ValidationError, validate
|
|
21
|
+
from spry.testing import TestClient, TestResponse
|
|
22
|
+
from spry.validators import Email, MaxLength, MinLength, Range, Regex, Required, email, max_length, min_length, range_validator, regex, required, validate_model
|
|
23
|
+
from spry.views import HtmlString, SpryTemplateEngine, TemplateEngine, ViewRenderer
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"AppBuilder",
|
|
27
|
+
"Application",
|
|
28
|
+
"AuthenticatedController",
|
|
29
|
+
"CookieAuthService",
|
|
30
|
+
"Controller",
|
|
31
|
+
"ControllerBase",
|
|
32
|
+
"CsrfService",
|
|
33
|
+
"DatabaseBackend",
|
|
34
|
+
"DatabaseMigrator",
|
|
35
|
+
"DbContext",
|
|
36
|
+
"DbSet",
|
|
37
|
+
"HtmlString",
|
|
38
|
+
"HttpContext",
|
|
39
|
+
"Request",
|
|
40
|
+
"Response",
|
|
41
|
+
"UserPrincipal",
|
|
42
|
+
"ValidationError",
|
|
43
|
+
"ViewRenderer",
|
|
44
|
+
"PasswordHasher",
|
|
45
|
+
"authorize",
|
|
46
|
+
"bad_request",
|
|
47
|
+
"column",
|
|
48
|
+
"controller",
|
|
49
|
+
"CorsConfig",
|
|
50
|
+
"created",
|
|
51
|
+
"dbset",
|
|
52
|
+
"delete",
|
|
53
|
+
"foreign_key",
|
|
54
|
+
"get_backend",
|
|
55
|
+
"get",
|
|
56
|
+
"key",
|
|
57
|
+
"navigation",
|
|
58
|
+
"navigation_many",
|
|
59
|
+
"no_content",
|
|
60
|
+
"not_found",
|
|
61
|
+
"ok",
|
|
62
|
+
"OpenApiBuilder",
|
|
63
|
+
"parse_database_url",
|
|
64
|
+
"patch",
|
|
65
|
+
"post",
|
|
66
|
+
"put",
|
|
67
|
+
"serve_static_file",
|
|
68
|
+
"SpryTemplateEngine",
|
|
69
|
+
"TemplateEngine",
|
|
70
|
+
"TestClient",
|
|
71
|
+
"TestResponse",
|
|
72
|
+
"UploadedFile",
|
|
73
|
+
"Email",
|
|
74
|
+
"MaxLength",
|
|
75
|
+
"MinLength",
|
|
76
|
+
"Range",
|
|
77
|
+
"Regex",
|
|
78
|
+
"Required",
|
|
79
|
+
"email",
|
|
80
|
+
"max_length",
|
|
81
|
+
"min_length",
|
|
82
|
+
"range_validator",
|
|
83
|
+
"regex",
|
|
84
|
+
"required",
|
|
85
|
+
"validate",
|
|
86
|
+
"validate_model",
|
|
87
|
+
"SessionMiddleware",
|
|
88
|
+
"SessionStore",
|
|
89
|
+
"TokenBucket",
|
|
90
|
+
"BackgroundTask",
|
|
91
|
+
"BackgroundWorker",
|
|
92
|
+
"EventDispatcher",
|
|
93
|
+
"I18nService",
|
|
94
|
+
"JwtAuthService",
|
|
95
|
+
]
|