swiftpy-framework 0.1.6__tar.gz → 0.2.1__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.
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/.env.example +3 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/CHANGELOG.md +56 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/PKG-INFO +103 -8
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/README.md +102 -7
- swiftpy_framework-0.2.1/app/http/handler/exceptions.py +16 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/models/user.py +2 -3
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/auth.py +2 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/logging.py +4 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-14-installation-quick-start.md +6 -6
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-ai-subsystem.md +17 -12
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-authentication-and-security.md +57 -18
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-core-application-di-and-config.md +11 -5
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-database-query-builder-and-migrations.md +5 -3
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +14 -2
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-orm-models-and-relationships.md +51 -35
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-validation-and-form-requests.md +32 -24
- swiftpy_framework-0.2.1/documentations/2026-11-19-application-schemas.md +276 -0
- swiftpy_framework-0.2.1/documentations/2026-11-19-cli-and-testing.md +233 -0
- swiftpy_framework-0.2.1/documentations/2026-11-19-database-schema-and-blueprint.md +268 -0
- swiftpy_framework-0.2.1/documentations/2026-11-20-error-handling.md +207 -0
- swiftpy_framework-0.2.1/documentations/2026-11-20-logging.md +177 -0
- swiftpy_framework-0.2.1/documentations/2026-11-20-request-and-responses.md +204 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/pyproject.toml +4 -1
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/__init__.py +10 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/admin/auth.py +16 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/auth/auth_manager.py +277 -69
- swiftpy_framework-0.2.1/swiftpy/auth/exceptions.py +130 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/auth/jwt_guard.py +5 -5
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/auth/jwt_issuer.py +243 -26
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/auth/token_blacklist.py +36 -27
- swiftpy_framework-0.2.1/swiftpy/auth/user_context.py +348 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/new.py +18 -17
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/model.stub +1 -2
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/application.py +176 -24
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/exceptions.py +6 -1
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/migrations/blueprint.py +56 -1
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/migrations/schema.py +47 -7
- swiftpy_framework-0.2.1/swiftpy/http/exceptions.py +81 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/http/request.py +109 -1
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/http/router.py +20 -5
- swiftpy_framework-0.2.1/swiftpy/logging/__init__.py +18 -0
- swiftpy_framework-0.2.1/swiftpy/logging/channels.py +181 -0
- swiftpy_framework-0.2.1/swiftpy/logging/log.py +70 -0
- swiftpy_framework-0.2.1/swiftpy/logging/manager.py +641 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/__init__.py +7 -1
- swiftpy_framework-0.2.1/swiftpy/validation/exceptions.py +88 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/form_request.py +5 -4
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/validator.py +124 -20
- swiftpy_framework-0.2.1/tests/auth/test_auth_context_on_issue.py +317 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_auth_proxy.py +153 -0
- swiftpy_framework-0.2.1/tests/auth/test_refresh_and_logout.py +471 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/test_new_command.py +22 -2
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/test_phase9_cli_remediation.py +1 -1
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/test_stubs_and_make.py +4 -0
- swiftpy_framework-0.2.1/tests/database/test_sequence_gaps.py +128 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/docs/test_readme_examples.py +106 -0
- swiftpy_framework-0.2.1/tests/http/test_request_router_abort.py +329 -0
- swiftpy_framework-0.2.1/tests/logging/__init__.py +1 -0
- swiftpy_framework-0.2.1/tests/logging/test_logging.py +575 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/migrations/test_migrations.py +131 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/orm/test_relationships_hardening.py +34 -1
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/typing/test_orm_typing.py +72 -1
- swiftpy_framework-0.2.1/tests/validation/test_validation_ergonomics.py +257 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_websocket_routing_and_lifecycle.py +3 -3
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/uv.lock +1 -1
- swiftpy_framework-0.1.6/app/http/handler/exceptions.py +0 -25
- swiftpy_framework-0.1.6/swiftpy/auth/exceptions.py +0 -71
- swiftpy_framework-0.1.6/swiftpy/http/exceptions.py +0 -41
- swiftpy_framework-0.1.6/swiftpy/validation/exceptions.py +0 -26
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/.dockerignore +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/.github/workflows/ci.yml +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/.gitignore +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/Dockerfile +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/LICENSE +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/http/middleware/admin_middleware.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/http/middleware/auth_middleware.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/schemas/user_schema.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/app/services/user_service.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/ai.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/app.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/cache.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/cors.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/database.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/events.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/filesystems.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/mail.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/config/queue.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/database/migrations/2026_01_01_000000_create_users_table.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/docker-compose.yml +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-cache-events-and-queues.md +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-filesystem-storage-and-mail.md +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/documentations/2026-11-15-websockets-and-admin.md +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/main.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/red-black.png +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/routes/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/routes/api.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/admin/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/admin/registry.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/admin/views.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/client.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/prompts/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/prompts/loader.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/auth/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/auth/api_key_guard.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/auth_manager.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/cli.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/make.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/queue.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/loader.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/controller.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/repository.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/resource.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/schema.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/console/stubs/service.stub +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/container.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/exceptions.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/identifiers.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/orm/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/orm/model.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/query_builder.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/helpers/helper.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/http/response.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/mail/transports/smtp.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/queue/worker.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/rules/registry.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/validation/rules/unique.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/websockets/connection.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/admin/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/admin/test_admin.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_observability.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_prompts.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_prompts_security.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/app/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/app/test_application_providers.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/app/test_starter_auth.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/cache/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/concurrency/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/conftest.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/core/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/docs/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/e2e/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/events/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/integration/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/migrations/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/orm/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/security/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/stress/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/support/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/testing/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/typing/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/test_db_rules.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/__init__.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/views/admin/dashboard.html +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/views/admin/login.html +0 -0
- {swiftpy_framework-0.1.6 → swiftpy_framework-0.2.1}/views/mail/template.html +0 -0
|
@@ -4,6 +4,62 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.2.1] - 2026-11-20
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **`CurrentUser` and `auth()` after an access token is issued (`swiftpy.auth`):** `JWTIssuer.issue_token(token_type="access")`, `issue_access_token()`, `issue_token_pair()` and `refresh_token_pair()` now bind the user into the request `Context` and `request.state`, so an already-injected `CurrentUser` and `auth().check()` / `id()` / `user()` work immediately (for example inside `/login` or `/refresh`). Refresh tokens never bind a user, and issuing a token for a different subject never replaces an already-authenticated user.
|
|
11
|
+
- `FrameworkServiceProvider` now registers `CurrentUser` as a scoped binding, so injecting `CurrentUser` works with `auto_discover_providers=False`.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- `JWTIssuer` token methods accept a saved `Model`, a mapping with `id`/`sub`, or a plain id as `subject`, plus an optional `user=` keyword (`Model` or mapping). A `user=` that does not match the subject, or a model without a primary key, raises `ValueError`. Sensitive keys and `__hidden__` fields are never bound.
|
|
15
|
+
- Opt-in `auth.hydrate_user` (`AUTH_HYDRATE_USER`, default `false`): `require_jwt()` / `JWTGuard` load the User model by `sub` (one query per request, degrading to token claims with a warning on database errors) so sub-only tokens expose every non-hidden field.
|
|
16
|
+
- Opt-in `auth.passive_resolution` (`AUTH_PASSIVE_RESOLUTION`, default `false`): routes without a guard resolve a valid Bearer access token into `CurrentUser` / `auth()` when the default guard is `jwt`. Revoked, expired or invalid tokens stay guests.
|
|
17
|
+
- New internal module `swiftpy.auth.user_context` shared by `JWTIssuer`, `require_jwt()` and `AuthManager`; `resolve_user_model_class` is still exported from `swiftpy.auth`, `swiftpy.auth.auth_manager` and `swiftpy.auth_manager`.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- `require_jwt()` now returns the bound user dictionary (token claims plus model fields when hydrated) instead of the raw claims dictionary.
|
|
21
|
+
- Generated projects (`swiftpy new`) include `hydrate_user` / `passive_resolution` in `config/auth.py`, matching `.env` keys, and depend on `swiftpy-framework>=0.2.1`.
|
|
22
|
+
|
|
23
|
+
### Documentation
|
|
24
|
+
- Updated [`documentations/2026-11-15-authentication-and-security.md`](documentations/2026-11-15-authentication-and-security.md) with issuing-time context binding, `hydrate_user`, `passive_resolution`, and the `CurrentUser.id` vs `auth().id()` typing note.
|
|
25
|
+
|
|
26
|
+
## [0.2.0] - 2026-11-19
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- **Structured Asynchronous Logging (`swiftpy.logging` / `Log`):**
|
|
30
|
+
- Added the `swiftpy.logging` package (`Log`, `LogManager`, `ChannelLogger`, `DEFAULT_LOG_FORMAT`, `parse_log_level`, `resolve_log_path`) and exported `Log` from top-level `swiftpy`.
|
|
31
|
+
- Wrapped concrete handlers (`single`, `daily` via `TimedRotatingFileHandler`, `stderr` supporting `"stderr"`/`"stdout"`/writable streams, and recursive cycle-checked `stack`) behind bounded `queue.Queue` (`queue_size=10_000` default) + `QueueHandler` + `QueueListener(..., respect_handler_level=True)` so request coroutines never block on file I/O.
|
|
32
|
+
- Added automatic recursive redaction of sensitive credential keys (`password`, `secret`, `token`, `api_key`, `authorization`, `pepper`, etc.) in structured `Log` keyword context.
|
|
33
|
+
- Wired `LogManager` startup first (with failure rollback) and shutdown flush/stop last in `FrameworkServiceProvider`, with per-`Application` isolation for internal channel loggers and framework `swiftpy.*` records.
|
|
34
|
+
- **Validation Ergonomics (`swiftpy.validation`):**
|
|
35
|
+
- Added `ValidatedData` (`dict[str, Any]` subclass with recursive dot attribute access and dict compatibility, keeping bracket access safe for keys matching `dict` method names).
|
|
36
|
+
- Updated `validate(data_or_request, schema, ...)` to extract JSON, form, or query input automatically when given a `Request`, added `ValidationResult.raise_if_failed()`, `ValidationResult.first_errors()`, and `stop_on_first_error` support on both `validate()` and `FormRequest`.
|
|
37
|
+
- Added `ValidationException.first_field()`, `first_error()`, `first_errors()`, `is_single`, and `single()` returning single-error `{"message": ..., "field": ...}` responses cleanly.
|
|
38
|
+
- **HTTP Request, Router & Exception Ergonomics (`swiftpy.http` / `swiftpy.core`):**
|
|
39
|
+
- Added `Request.scheme`, `Request.input()`, `Request.all()`, `Request.get()`, `Request.has()`, and dynamic `request.<field>` attribute lookup over pre-loaded non-multipart input (`Application(..., auto_load_request_input=True)` with opt-out for raw proxy routes, safe pre-load fallback on non-JSON raw webhook bodies, and reserved-attribute protection preventing client input from spoofing `user`, `auth`, `session`, `is_admin`, etc. via `getattr`/`hasattr`).
|
|
40
|
+
- Added `Router(prefix=..., middleware=...)` constructor configuration (validating dynamic `{...}` segments eagerly and composing router middleware cleanly across `include_router`).
|
|
41
|
+
- Added declarative `HttpException` class defaults (`status_code`, `message`) and the `abort(status_code, message=None, *, headers=None)` helper exported from `swiftpy`, `swiftpy.http`, `swiftpy.http.exceptions`, and `swiftpy.core.exceptions`.
|
|
42
|
+
- **Database Migrations (`Blueprint`):**
|
|
43
|
+
- Added `Blueprint.enum(name, values)` compiling PostgreSQL `VARCHAR` columns with named `CHECK` constraints, SQL literal escaping, and enum default validation, plus `Blueprint.medium_text(name)` and `Blueprint.long_text(name)` aliases mapped to PostgreSQL `TEXT`.
|
|
44
|
+
- **PostgreSQL design note:** Column positioning (`after()`) is intentionally not offered on `ColumnDefinition` because PostgreSQL `ALTER TABLE ... ADD COLUMN` appends new columns and does not support positional insertion; `Schema.rename` is similarly omitted from `Schema`.
|
|
45
|
+
- **Authentication Token Refresh & Session Revocation (`swiftpy.auth` / `swiftpy.admin`):**
|
|
46
|
+
- Added `JWTIssuer.refresh_token_pair()` with automatic refresh token verification, `TokenBlacklist` checks, atomic Redis `SET ... NX` rotation (`TokenBlacklist.revoke_if_not_revoked()`, `rotate=True` by default), and `TokenRevokedError` (inheriting from both `AuthenticationError` and `JWTError`, HTTP 401) on reuse or revocation.
|
|
47
|
+
- Added `AuthProxy.logout()` and `AuthProxy.logout_all()` on `auth()`, plus `AdminSessionStore.flush()` epoch-based in-memory admin session invalidation.
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
- **Models & Ruff Defaults:** Removed explicit `ClassVar` boilerplate from `app/models/user.py`, `swiftpy/console/stubs/model.stub`, and `swiftpy new` model templates; added per-file `"app/models/**/*.py" = ["RUF012"]` ignore in `pyproject.toml` and scaffolded project templates.
|
|
51
|
+
- **Scaffolding (`swiftpy new`) & Config:**
|
|
52
|
+
- Shortened generated `app/http/handler/exceptions.py` to demonstrate declarative `HttpException` subclasses without boilerplate handler registration.
|
|
53
|
+
- Added the `"stderr"` channel to `config/logging.py` and `swiftpy new` logging config templates.
|
|
54
|
+
- Bumped generated `pyproject.toml` dependency floor to `swiftpy-framework>=0.2.0` (`tests/console/test_phase9_cli_remediation.py` updated accordingly).
|
|
55
|
+
|
|
56
|
+
### Verified
|
|
57
|
+
- Added PostgreSQL integration tests in `tests/database/test_sequence_gaps.py` verifying non-transactional `BIGSERIAL` / `GENERATED BY DEFAULT AS IDENTITY` sequence gap behavior after failed unique inserts and rolled-back transactions without data loss.
|
|
58
|
+
|
|
59
|
+
### Documentation
|
|
60
|
+
- Added six dedicated user guides in `documentations/`: `2026-11-20-request-and-responses.md`, `2026-11-20-error-handling.md`, `2026-11-19-application-schemas.md` (`app/schemas/`), `2026-11-19-database-schema-and-blueprint.md`, `2026-11-20-logging.md`, and `2026-11-19-cli-and-testing.md`.
|
|
61
|
+
- Updated existing guides (`2026-11-14-installation-quick-start.md`, `2026-11-15-core-application-di-and-config.md`, `2026-11-15-http-routing-middleware-and-exceptions.md`, `2026-11-15-validation-and-form-requests.md`, `2026-11-15-database-query-builder-and-migrations.md`, `2026-11-15-orm-models-and-relationships.md`, `2026-11-15-authentication-and-security.md`, `2026-11-15-ai-subsystem.md`), `README.md`, and `docs/2026-11-14_documentation_plan.md` (linking all 17 sequential guides and replacing nonexistent `StorageFake` references with `VectorStoreFake`).
|
|
62
|
+
|
|
7
63
|
## [0.1.6] - 2026-11-17
|
|
8
64
|
|
|
9
65
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: SwiftPY is a new generation async-first Python framework purpose built for the modern API and AI economy.
|
|
5
5
|
Project-URL: Homepage, https://github.com/obrainwave/swiftpy
|
|
6
6
|
Project-URL: Repository, https://github.com/obrainwave/swiftpy
|
|
@@ -50,11 +50,14 @@ Description-Content-Type: text/markdown
|
|
|
50
50
|
|
|
51
51
|
SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Python ecosystem. It eliminates boilerplate and fragmented third-party glue code by providing a unified, cohesive framework built natively on Python 3.12+ and high-performance [`asyncpg`](https://github.com/MagicStack/asyncpg).
|
|
52
52
|
|
|
53
|
-
- **FastAPI-Grade Simplicity**: Clean, intuitive entrypoint (`app = Application()`), async-first request/response cycle, automatic path parameter type coercion, and scoped route groups with middleware pipelines.
|
|
54
|
-
- **Eloquent-Caliber Active Record ORM**: Typed models declaring class attributes via standard Python type hints, automatic irregular-aware table pluralization, dirty-tracking `save()`, expressive relationships (`HasMany`, `BelongsTo`, `HasOne`, `BelongsToMany`), and eager loading with strict N+1 query prevention (via model-level `prevent_lazy_loading = True`, raising `LazyLoadingDisabledError` on un-eager-loaded accesses).
|
|
53
|
+
- **FastAPI-Grade Simplicity**: Clean, intuitive entrypoint (`app = Application()`), async-first request/response cycle (`Request.input()`, `request.<field>`, `abort()`, declarative `HttpException`), constructor-configured `Router(prefix=..., middleware=...)`, automatic path parameter type coercion, and scoped route groups with middleware pipelines.
|
|
54
|
+
- **Eloquent-Caliber Active Record ORM**: Typed models declaring class attributes via standard Python type hints (no `ClassVar` boilerplate), automatic irregular-aware table pluralization, dirty-tracking `save()`, expressive relationships (`HasMany`, `BelongsTo`, `HasOne`, `BelongsToMany`), and eager loading with strict N+1 query prevention (via model-level `prevent_lazy_loading = True`, raising `LazyLoadingDisabledError` on un-eager-loaded accesses).
|
|
55
55
|
- **Query Builder, GROUP BY & Dynamic Pagination**: Full length-aware `paginate()` and lightweight `simple_paginate()`, `limit()`/`offset()` (with `take()`/`skip()`), group-aware subquery counting, and aggregate selectors (`select_count`, `select_sum`, etc.) with `having` and `or_having` logical filtering.
|
|
56
56
|
- **Multi-Disk Storage & Streaming Engine**: Flysystem-inspired `Storage` abstraction supporting local and S3 disks, high-throughput streaming uploads/downloads, magic-byte validation, and `storage:link`.
|
|
57
|
-
- **
|
|
57
|
+
- **Validation Ergonomics & Input Hardening**: `FormRequest` and `await validate(request, rules)` returning `ValidatedData` (supporting both dict and dot attribute access), `stop_on_first_error`, `ValidationException.single()`, automatic 422 JSON errors, configurable body streaming limits, Content-Length checks, and JSON recursion depth caps.
|
|
58
|
+
- **Authentication, Refresh Rotation & Session Revocation**: `JWTIssuer` with `refresh_token_pair()` rotation and reuse rejection, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`, `ApiKeyGuard`, and `AdminSessionStore.flush()`.
|
|
59
|
+
- **Structured Asynchronous Logging**: Non-blocking `Log` facade and `LogManager` (`single`, `daily`, `stderr`, `stack`) backed by bounded `QueueHandler` / `QueueListener` with clean ASGI startup/shutdown flushing and per-application isolation.
|
|
60
|
+
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops with session memory, prompt templates (`prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
58
61
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
59
62
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
60
63
|
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
@@ -82,10 +85,13 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
82
85
|
| **Phase 8: Validation DSL Hardening** | Fail-closed FormRequest validation, hardened rule composition, input sanitization | ✅ Completed |
|
|
83
86
|
| **Phase 9: Real-time WebSockets** | Handshake validation, same-origin protection (D-14), bounded broadcast fan-out, lifecycle hooks | ✅ Completed |
|
|
84
87
|
| **Phase 10: Infra, CI & Hygiene** | Multi-stage Docker, pinned CI workflow, hardened compose, repo hygiene, CLI options | ✅ Completed |
|
|
88
|
+
| **Phases 11–13: Native AI Subsystem** | Multi-provider `AI` client, SSE streaming, `EmbeddingsClient`, `PgVectorAdapter` & vector stores, `rag()`, `Agent` / `@tool`, prompts, guardrails & `AIFake` | ✅ Completed |
|
|
85
89
|
| **Week 26: Security Audit & Hardening** | SQL injection audit, JWT & bcrypt API keys, JSON depth & streaming limits, traceback suppression | ✅ Completed |
|
|
86
90
|
| **Week 26: Pagination & Aggregation Subsystem** | Limit/offset parameterized SQL, length-aware `paginate()`, `simple_paginate()`, `group_by()` & `having()` | ✅ Completed |
|
|
91
|
+
| **Release v0.2.0: DX, Logging, Auth Refresh & Docs** | `ValidatedData` & `validate(request)`, `Request.input()` & `abort()`, `Router(prefix, middleware)`, `Blueprint.enum`/`medium_text`/`long_text`, `swiftpy.logging` (`Log`), `refresh_token_pair()` & `auth().logout()`, 17 user guides in `documentations/` | ✅ Completed |
|
|
92
|
+
| **Release v0.2.1: Auth Context on Token Issue** | `CurrentUser` / `auth()` available when an access token is issued, `user=` / `Model` subjects, opt-in `auth.hydrate_user` & `auth.passive_resolution` | ✅ Completed |
|
|
87
93
|
|
|
88
|
-
*See [`
|
|
94
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) for the complete step-by-step documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
89
95
|
|
|
90
96
|
---
|
|
91
97
|
|
|
@@ -375,6 +381,87 @@ await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch()
|
|
|
375
381
|
await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch(delay=60.0)
|
|
376
382
|
```
|
|
377
383
|
|
|
384
|
+
### 8. Native AI Subsystem (LLM Client, Streaming, RAG & Agents)
|
|
385
|
+
|
|
386
|
+
Use `swiftpy.ai` to call OpenAI or Anthropic models through one shared connection pool, stream SSE chunks cleanly, query PostgreSQL `pgvector` or cloud vector stores, build grounded `rag()` pipelines, run tool-calling `Agent` sessions, and test deterministically offline with `AIFake`:
|
|
387
|
+
|
|
388
|
+
```python
|
|
389
|
+
# routes/assistant.py
|
|
390
|
+
from swiftpy.http.response import StreamingResponse
|
|
391
|
+
from swiftpy.ai import (
|
|
392
|
+
AI,
|
|
393
|
+
Agent,
|
|
394
|
+
AgentMemory,
|
|
395
|
+
EmbeddingsClient,
|
|
396
|
+
InMemoryMemoryBackend,
|
|
397
|
+
InMemoryVectorStore,
|
|
398
|
+
Retriever,
|
|
399
|
+
XMLBlocksFormatter,
|
|
400
|
+
rag,
|
|
401
|
+
tool,
|
|
402
|
+
)
|
|
403
|
+
from swiftpy.testing import AIFake
|
|
404
|
+
|
|
405
|
+
# 1. Fluent chat & SSE streaming with provider auto-inference
|
|
406
|
+
response = await (
|
|
407
|
+
AI.chat(model="gpt-4o-mini")
|
|
408
|
+
.system("Answer concisely in one paragraph.")
|
|
409
|
+
.user("Summarize SwiftPY's transaction model.")
|
|
410
|
+
.temperature(0.2)
|
|
411
|
+
.max_tokens(300)
|
|
412
|
+
.send()
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
@app.get("/ai/stream")
|
|
417
|
+
async def stream_answer(question: str = "Explain asyncpg pooling") -> StreamingResponse:
|
|
418
|
+
async def chunks():
|
|
419
|
+
client = AI.chat(model="claude-3-5-sonnet-20241022").user(question)
|
|
420
|
+
async for token in client.stream():
|
|
421
|
+
yield token.encode("utf-8")
|
|
422
|
+
|
|
423
|
+
return StreamingResponse(
|
|
424
|
+
chunks(), headers={"content-type": "text/plain; charset=utf-8"}
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
# 2. Embeddings, Vector Stores (swap InMemoryVectorStore -> AI.vectorstore(adapter="pgvector", ...) for PostgreSQL) & RAG
|
|
429
|
+
store = InMemoryVectorStore(dimensions=1536, metric="cosine")
|
|
430
|
+
await store.create_collection("handbook", dimensions=1536, metric="cosine")
|
|
431
|
+
retriever = Retriever(vectorstore=store, embeddings=EmbeddingsClient(), provider="deterministic")
|
|
432
|
+
await retriever.add_documents(["SwiftPY manages asyncpg connections via DatabasePool."])
|
|
433
|
+
|
|
434
|
+
rag_result = await (
|
|
435
|
+
rag()
|
|
436
|
+
.retriever(retriever)
|
|
437
|
+
.top_k(4)
|
|
438
|
+
.formatter(XMLBlocksFormatter())
|
|
439
|
+
.generator(AI.chat(model="gpt-4o-mini"))
|
|
440
|
+
.run("How does SwiftPY manage PostgreSQL connections?")
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
# 3. Typed @tool + Stateful Agent with session memory (testable via AIFake)
|
|
445
|
+
@tool
|
|
446
|
+
async def lookup_order_status(order_id: int) -> dict[str, object]:
|
|
447
|
+
"""Look up fulfillment status for a customer order ID."""
|
|
448
|
+
return {"order_id": order_id, "status": "shipped"}
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
with AIFake("Order #42 is shipped.") as fake:
|
|
452
|
+
agent = Agent(
|
|
453
|
+
name="SupportAssistant",
|
|
454
|
+
system_prompt="Help customers track orders accurately.",
|
|
455
|
+
tools=[lookup_order_status],
|
|
456
|
+
memory=AgentMemory(backend=InMemoryMemoryBackend(), session_id="user-7"),
|
|
457
|
+
model="gpt-4o-mini",
|
|
458
|
+
)
|
|
459
|
+
reply = await agent.run("Where is order #42?", session_id="user-7")
|
|
460
|
+
fake.assert_called_once()
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
See the full [AI Subsystem Guide](./documentations/2026-11-15-ai-subsystem.md) for `PgVectorAdapter` setups, `prompts/` templates + `cache:build` precompilation, rerankers, rate-limit/budget middlewares, observability telemetry, and `VectorStoreFake`.
|
|
464
|
+
|
|
378
465
|
---
|
|
379
466
|
|
|
380
467
|
## Command Line Interface (`swiftpy`)
|
|
@@ -404,12 +491,13 @@ swiftpy migrate:rollback
|
|
|
404
491
|
swiftpy migrate:reset
|
|
405
492
|
swiftpy db:seed
|
|
406
493
|
|
|
407
|
-
# Scaffold migrations, models, requests, API keys, mailables, and more
|
|
494
|
+
# Scaffold migrations, models, requests, schemas, API keys, mailables, and more
|
|
408
495
|
swiftpy make:migration create_posts_table
|
|
409
496
|
swiftpy make:model Post --migration
|
|
410
497
|
swiftpy make:request RegisterRequest
|
|
498
|
+
swiftpy make:schema OrderSchema
|
|
411
499
|
swiftpy make:mail WelcomeEmail
|
|
412
|
-
swiftpy make:api-key --
|
|
500
|
+
swiftpy make:api-key --prefix sk_live_
|
|
413
501
|
|
|
414
502
|
# Create symbolic links from public/storage to storage/app/public
|
|
415
503
|
swiftpy storage:link
|
|
@@ -446,6 +534,11 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
446
534
|
| `DB_SSL_CA_FILE` | `database.connections.postgresql.ssl_ca_file` | `""` | Filepath to CA certificate when `DB_SSL` is `"verify-ca"` or `"verify-full"`. |
|
|
447
535
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). |
|
|
448
536
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
537
|
+
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
538
|
+
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
539
|
+
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
540
|
+
| `OPENAI_MODEL` | `ai.providers.openai.model` | `"gpt-4o"` | Default OpenAI chat model (`ANTHROPIC_MODEL` defaults to `"claude-3-5-sonnet-20241022"`). |
|
|
541
|
+
| `AI_VECTORSTORE_DEFAULT` | `ai.vectorstores.default` | `"in_memory"` | Default vector store adapter (`"in_memory"`, `"pgvector"`, `"qdrant"`, `"pinecone"`, `"chroma"`, `"lancedb"`). |
|
|
449
542
|
|
|
450
543
|
---
|
|
451
544
|
|
|
@@ -521,6 +614,7 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
521
614
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
522
615
|
│ │ ├── app_service_provider.py
|
|
523
616
|
│ │ └── database_service_provider.py
|
|
617
|
+
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
524
618
|
│ └── services/ # Domain business logic
|
|
525
619
|
├── config/ # Environment & framework configuration
|
|
526
620
|
│ ├── ai.py
|
|
@@ -549,10 +643,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
549
643
|
│ ├── filesystem/ # Multi-disk Storage (local, public, s3) and uploads
|
|
550
644
|
│ ├── helpers/ # Inflection (pluralize/snake_case), global helpers
|
|
551
645
|
│ ├── http/ # Router, request/response, middleware pipeline
|
|
646
|
+
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
552
647
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
553
648
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
554
649
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
555
|
-
│ ├── testing/ # TestClient, AIFake, MailFake,
|
|
650
|
+
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
556
651
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
557
652
|
│ └── websockets/ # WebSocket manager, connections, broadcast
|
|
558
653
|
├── tests/ # Automated pytest suite
|
|
@@ -20,11 +20,14 @@
|
|
|
20
20
|
|
|
21
21
|
SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Python ecosystem. It eliminates boilerplate and fragmented third-party glue code by providing a unified, cohesive framework built natively on Python 3.12+ and high-performance [`asyncpg`](https://github.com/MagicStack/asyncpg).
|
|
22
22
|
|
|
23
|
-
- **FastAPI-Grade Simplicity**: Clean, intuitive entrypoint (`app = Application()`), async-first request/response cycle, automatic path parameter type coercion, and scoped route groups with middleware pipelines.
|
|
24
|
-
- **Eloquent-Caliber Active Record ORM**: Typed models declaring class attributes via standard Python type hints, automatic irregular-aware table pluralization, dirty-tracking `save()`, expressive relationships (`HasMany`, `BelongsTo`, `HasOne`, `BelongsToMany`), and eager loading with strict N+1 query prevention (via model-level `prevent_lazy_loading = True`, raising `LazyLoadingDisabledError` on un-eager-loaded accesses).
|
|
23
|
+
- **FastAPI-Grade Simplicity**: Clean, intuitive entrypoint (`app = Application()`), async-first request/response cycle (`Request.input()`, `request.<field>`, `abort()`, declarative `HttpException`), constructor-configured `Router(prefix=..., middleware=...)`, automatic path parameter type coercion, and scoped route groups with middleware pipelines.
|
|
24
|
+
- **Eloquent-Caliber Active Record ORM**: Typed models declaring class attributes via standard Python type hints (no `ClassVar` boilerplate), automatic irregular-aware table pluralization, dirty-tracking `save()`, expressive relationships (`HasMany`, `BelongsTo`, `HasOne`, `BelongsToMany`), and eager loading with strict N+1 query prevention (via model-level `prevent_lazy_loading = True`, raising `LazyLoadingDisabledError` on un-eager-loaded accesses).
|
|
25
25
|
- **Query Builder, GROUP BY & Dynamic Pagination**: Full length-aware `paginate()` and lightweight `simple_paginate()`, `limit()`/`offset()` (with `take()`/`skip()`), group-aware subquery counting, and aggregate selectors (`select_count`, `select_sum`, etc.) with `having` and `or_having` logical filtering.
|
|
26
26
|
- **Multi-Disk Storage & Streaming Engine**: Flysystem-inspired `Storage` abstraction supporting local and S3 disks, high-throughput streaming uploads/downloads, magic-byte validation, and `storage:link`.
|
|
27
|
-
- **
|
|
27
|
+
- **Validation Ergonomics & Input Hardening**: `FormRequest` and `await validate(request, rules)` returning `ValidatedData` (supporting both dict and dot attribute access), `stop_on_first_error`, `ValidationException.single()`, automatic 422 JSON errors, configurable body streaming limits, Content-Length checks, and JSON recursion depth caps.
|
|
28
|
+
- **Authentication, Refresh Rotation & Session Revocation**: `JWTIssuer` with `refresh_token_pair()` rotation and reuse rejection, `auth().logout()` / `auth().logout_all()`, `TokenBlacklist`, `ApiKeyGuard`, and `AdminSessionStore.flush()`.
|
|
29
|
+
- **Structured Asynchronous Logging**: Non-blocking `Log` facade and `LogManager` (`single`, `daily`, `stderr`, `stack`) backed by bounded `QueueHandler` / `QueueListener` with clean ASGI startup/shutdown flushing and per-application isolation.
|
|
30
|
+
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops with session memory, prompt templates (`prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
28
31
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
29
32
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
30
33
|
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
@@ -52,10 +55,13 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
52
55
|
| **Phase 8: Validation DSL Hardening** | Fail-closed FormRequest validation, hardened rule composition, input sanitization | ✅ Completed |
|
|
53
56
|
| **Phase 9: Real-time WebSockets** | Handshake validation, same-origin protection (D-14), bounded broadcast fan-out, lifecycle hooks | ✅ Completed |
|
|
54
57
|
| **Phase 10: Infra, CI & Hygiene** | Multi-stage Docker, pinned CI workflow, hardened compose, repo hygiene, CLI options | ✅ Completed |
|
|
58
|
+
| **Phases 11–13: Native AI Subsystem** | Multi-provider `AI` client, SSE streaming, `EmbeddingsClient`, `PgVectorAdapter` & vector stores, `rag()`, `Agent` / `@tool`, prompts, guardrails & `AIFake` | ✅ Completed |
|
|
55
59
|
| **Week 26: Security Audit & Hardening** | SQL injection audit, JWT & bcrypt API keys, JSON depth & streaming limits, traceback suppression | ✅ Completed |
|
|
56
60
|
| **Week 26: Pagination & Aggregation Subsystem** | Limit/offset parameterized SQL, length-aware `paginate()`, `simple_paginate()`, `group_by()` & `having()` | ✅ Completed |
|
|
61
|
+
| **Release v0.2.0: DX, Logging, Auth Refresh & Docs** | `ValidatedData` & `validate(request)`, `Request.input()` & `abort()`, `Router(prefix, middleware)`, `Blueprint.enum`/`medium_text`/`long_text`, `swiftpy.logging` (`Log`), `refresh_token_pair()` & `auth().logout()`, 17 user guides in `documentations/` | ✅ Completed |
|
|
62
|
+
| **Release v0.2.1: Auth Context on Token Issue** | `CurrentUser` / `auth()` available when an access token is issued, `user=` / `Model` subjects, opt-in `auth.hydrate_user` & `auth.passive_resolution` | ✅ Completed |
|
|
57
63
|
|
|
58
|
-
*See [`
|
|
64
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md) for the complete step-by-step documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
59
65
|
|
|
60
66
|
---
|
|
61
67
|
|
|
@@ -345,6 +351,87 @@ await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch()
|
|
|
345
351
|
await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch(delay=60.0)
|
|
346
352
|
```
|
|
347
353
|
|
|
354
|
+
### 8. Native AI Subsystem (LLM Client, Streaming, RAG & Agents)
|
|
355
|
+
|
|
356
|
+
Use `swiftpy.ai` to call OpenAI or Anthropic models through one shared connection pool, stream SSE chunks cleanly, query PostgreSQL `pgvector` or cloud vector stores, build grounded `rag()` pipelines, run tool-calling `Agent` sessions, and test deterministically offline with `AIFake`:
|
|
357
|
+
|
|
358
|
+
```python
|
|
359
|
+
# routes/assistant.py
|
|
360
|
+
from swiftpy.http.response import StreamingResponse
|
|
361
|
+
from swiftpy.ai import (
|
|
362
|
+
AI,
|
|
363
|
+
Agent,
|
|
364
|
+
AgentMemory,
|
|
365
|
+
EmbeddingsClient,
|
|
366
|
+
InMemoryMemoryBackend,
|
|
367
|
+
InMemoryVectorStore,
|
|
368
|
+
Retriever,
|
|
369
|
+
XMLBlocksFormatter,
|
|
370
|
+
rag,
|
|
371
|
+
tool,
|
|
372
|
+
)
|
|
373
|
+
from swiftpy.testing import AIFake
|
|
374
|
+
|
|
375
|
+
# 1. Fluent chat & SSE streaming with provider auto-inference
|
|
376
|
+
response = await (
|
|
377
|
+
AI.chat(model="gpt-4o-mini")
|
|
378
|
+
.system("Answer concisely in one paragraph.")
|
|
379
|
+
.user("Summarize SwiftPY's transaction model.")
|
|
380
|
+
.temperature(0.2)
|
|
381
|
+
.max_tokens(300)
|
|
382
|
+
.send()
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
@app.get("/ai/stream")
|
|
387
|
+
async def stream_answer(question: str = "Explain asyncpg pooling") -> StreamingResponse:
|
|
388
|
+
async def chunks():
|
|
389
|
+
client = AI.chat(model="claude-3-5-sonnet-20241022").user(question)
|
|
390
|
+
async for token in client.stream():
|
|
391
|
+
yield token.encode("utf-8")
|
|
392
|
+
|
|
393
|
+
return StreamingResponse(
|
|
394
|
+
chunks(), headers={"content-type": "text/plain; charset=utf-8"}
|
|
395
|
+
)
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
# 2. Embeddings, Vector Stores (swap InMemoryVectorStore -> AI.vectorstore(adapter="pgvector", ...) for PostgreSQL) & RAG
|
|
399
|
+
store = InMemoryVectorStore(dimensions=1536, metric="cosine")
|
|
400
|
+
await store.create_collection("handbook", dimensions=1536, metric="cosine")
|
|
401
|
+
retriever = Retriever(vectorstore=store, embeddings=EmbeddingsClient(), provider="deterministic")
|
|
402
|
+
await retriever.add_documents(["SwiftPY manages asyncpg connections via DatabasePool."])
|
|
403
|
+
|
|
404
|
+
rag_result = await (
|
|
405
|
+
rag()
|
|
406
|
+
.retriever(retriever)
|
|
407
|
+
.top_k(4)
|
|
408
|
+
.formatter(XMLBlocksFormatter())
|
|
409
|
+
.generator(AI.chat(model="gpt-4o-mini"))
|
|
410
|
+
.run("How does SwiftPY manage PostgreSQL connections?")
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
# 3. Typed @tool + Stateful Agent with session memory (testable via AIFake)
|
|
415
|
+
@tool
|
|
416
|
+
async def lookup_order_status(order_id: int) -> dict[str, object]:
|
|
417
|
+
"""Look up fulfillment status for a customer order ID."""
|
|
418
|
+
return {"order_id": order_id, "status": "shipped"}
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
with AIFake("Order #42 is shipped.") as fake:
|
|
422
|
+
agent = Agent(
|
|
423
|
+
name="SupportAssistant",
|
|
424
|
+
system_prompt="Help customers track orders accurately.",
|
|
425
|
+
tools=[lookup_order_status],
|
|
426
|
+
memory=AgentMemory(backend=InMemoryMemoryBackend(), session_id="user-7"),
|
|
427
|
+
model="gpt-4o-mini",
|
|
428
|
+
)
|
|
429
|
+
reply = await agent.run("Where is order #42?", session_id="user-7")
|
|
430
|
+
fake.assert_called_once()
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
See the full [AI Subsystem Guide](./documentations/2026-11-15-ai-subsystem.md) for `PgVectorAdapter` setups, `prompts/` templates + `cache:build` precompilation, rerankers, rate-limit/budget middlewares, observability telemetry, and `VectorStoreFake`.
|
|
434
|
+
|
|
348
435
|
---
|
|
349
436
|
|
|
350
437
|
## Command Line Interface (`swiftpy`)
|
|
@@ -374,12 +461,13 @@ swiftpy migrate:rollback
|
|
|
374
461
|
swiftpy migrate:reset
|
|
375
462
|
swiftpy db:seed
|
|
376
463
|
|
|
377
|
-
# Scaffold migrations, models, requests, API keys, mailables, and more
|
|
464
|
+
# Scaffold migrations, models, requests, schemas, API keys, mailables, and more
|
|
378
465
|
swiftpy make:migration create_posts_table
|
|
379
466
|
swiftpy make:model Post --migration
|
|
380
467
|
swiftpy make:request RegisterRequest
|
|
468
|
+
swiftpy make:schema OrderSchema
|
|
381
469
|
swiftpy make:mail WelcomeEmail
|
|
382
|
-
swiftpy make:api-key --
|
|
470
|
+
swiftpy make:api-key --prefix sk_live_
|
|
383
471
|
|
|
384
472
|
# Create symbolic links from public/storage to storage/app/public
|
|
385
473
|
swiftpy storage:link
|
|
@@ -416,6 +504,11 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
416
504
|
| `DB_SSL_CA_FILE` | `database.connections.postgresql.ssl_ca_file` | `""` | Filepath to CA certificate when `DB_SSL` is `"verify-ca"` or `"verify-full"`. |
|
|
417
505
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). |
|
|
418
506
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
507
|
+
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
508
|
+
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
509
|
+
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
510
|
+
| `OPENAI_MODEL` | `ai.providers.openai.model` | `"gpt-4o"` | Default OpenAI chat model (`ANTHROPIC_MODEL` defaults to `"claude-3-5-sonnet-20241022"`). |
|
|
511
|
+
| `AI_VECTORSTORE_DEFAULT` | `ai.vectorstores.default` | `"in_memory"` | Default vector store adapter (`"in_memory"`, `"pgvector"`, `"qdrant"`, `"pinecone"`, `"chroma"`, `"lancedb"`). |
|
|
419
512
|
|
|
420
513
|
---
|
|
421
514
|
|
|
@@ -491,6 +584,7 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
491
584
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
492
585
|
│ │ ├── app_service_provider.py
|
|
493
586
|
│ │ └── database_service_provider.py
|
|
587
|
+
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
494
588
|
│ └── services/ # Domain business logic
|
|
495
589
|
├── config/ # Environment & framework configuration
|
|
496
590
|
│ ├── ai.py
|
|
@@ -519,10 +613,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
519
613
|
│ ├── filesystem/ # Multi-disk Storage (local, public, s3) and uploads
|
|
520
614
|
│ ├── helpers/ # Inflection (pluralize/snake_case), global helpers
|
|
521
615
|
│ ├── http/ # Router, request/response, middleware pipeline
|
|
616
|
+
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
522
617
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
523
618
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
524
619
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
525
|
-
│ ├── testing/ # TestClient, AIFake, MailFake,
|
|
620
|
+
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
526
621
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
527
622
|
│ └── websockets/ # WebSocket manager, connections, broadcast
|
|
528
623
|
├── tests/ # Automated pytest suite
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from swiftpy.core.application import Application
|
|
4
|
+
from swiftpy.core.exceptions import HttpException
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ResourceConflictException(HttpException):
|
|
8
|
+
"""Raised when an operation conflicts with existing server state (HTTP 409)."""
|
|
9
|
+
|
|
10
|
+
status_code = 409
|
|
11
|
+
message = "Resource conflict"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def register_exception_handlers(app: Application) -> None:
|
|
15
|
+
"""Register custom exception renderers onto `app` when non-default JSON shapes are needed."""
|
|
16
|
+
_ = app
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
from typing import ClassVar
|
|
5
4
|
|
|
6
5
|
from swiftpy.database.orm import Model
|
|
7
6
|
|
|
@@ -14,8 +13,8 @@ class User(Model):
|
|
|
14
13
|
|
|
15
14
|
__table__ = "users"
|
|
16
15
|
__primary_key__ = "id"
|
|
17
|
-
__fillable__
|
|
18
|
-
__hidden__
|
|
16
|
+
__fillable__ = ["name", "email", "password", "is_admin"]
|
|
17
|
+
__hidden__ = ["password"]
|
|
19
18
|
|
|
20
19
|
id: int
|
|
21
20
|
name: str
|
|
@@ -2,6 +2,8 @@ from swiftpy.helpers.helper import env, env_bool
|
|
|
2
2
|
|
|
3
3
|
CONFIG: dict[str, object] = {
|
|
4
4
|
"blacklist_enabled": env_bool("AUTH_BLACKLIST_ENABLED", True),
|
|
5
|
+
"hydrate_user": env_bool("AUTH_HYDRATE_USER", False),
|
|
6
|
+
"passive_resolution": env_bool("AUTH_PASSIVE_RESOLUTION", False),
|
|
5
7
|
"defaults": {
|
|
6
8
|
"guard": env("AUTH_GUARD", "jwt"),
|
|
7
9
|
},
|
|
@@ -142,7 +142,7 @@ my_api/
|
|
|
142
142
|
│ ├── models/ # Active Record ORM models (User)
|
|
143
143
|
│ ├── providers/ # Auto-discovered service providers
|
|
144
144
|
│ ├── repositories/ # Data access layer
|
|
145
|
-
│ ├── schemas/ # Typed dataclasses/schemas
|
|
145
|
+
│ ├── schemas/ # Typed dataclasses/schemas (see Application Schemas guide)
|
|
146
146
|
│ └── services/ # Business logic services
|
|
147
147
|
├── config/ # Configuration files loading .env via env() / env_bool()
|
|
148
148
|
├── database/
|
|
@@ -159,7 +159,7 @@ my_api/
|
|
|
159
159
|
├── docker-compose.yml # name: my_api; app, postgres (pgvector:pg16), & redis services
|
|
160
160
|
├── Dockerfile
|
|
161
161
|
├── main.py # Entrypoint: GET /, /api router, register_exception_handlers(app)
|
|
162
|
-
└── pyproject.toml # Configured with swiftpy-framework>=0.1
|
|
162
|
+
└── pyproject.toml # Configured with swiftpy-framework>=0.2.1, setuptools, & mypy strict settings
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
What `swiftpy new my_api` configures automatically:
|
|
@@ -313,7 +313,7 @@ The scaffolded `Dockerfile` reads `[project].dependencies` from your project's `
|
|
|
313
313
|
name = "my_api"
|
|
314
314
|
version = "0.1.0"
|
|
315
315
|
dependencies = [
|
|
316
|
-
"swiftpy-framework>=0.1
|
|
316
|
+
"swiftpy-framework>=0.2.1",
|
|
317
317
|
# ...
|
|
318
318
|
]
|
|
319
319
|
```
|
|
@@ -325,7 +325,7 @@ The scaffolded `Dockerfile` reads `[project].dependencies` from your project's `
|
|
|
325
325
|
docker compose exec app swiftpy --version
|
|
326
326
|
```
|
|
327
327
|
|
|
328
|
-
- If you did **not** edit `pyproject.toml` (for example, keeping `swiftpy-framework>=0.1.
|
|
328
|
+
- If you did **not** edit `pyproject.toml` (for example, keeping `swiftpy-framework>=0.1.6` to pull a newly published `0.2.1` release from PyPI), Docker's `COPY pyproject.toml .` layer stays cached unless you force a rebuild:
|
|
329
329
|
|
|
330
330
|
```bash
|
|
331
331
|
docker compose build --no-cache app
|
|
@@ -343,7 +343,7 @@ If running without Docker, upgrade inside your activated `.venv`:
|
|
|
343
343
|
uv sync --upgrade-package swiftpy-framework
|
|
344
344
|
|
|
345
345
|
# Or with pip
|
|
346
|
-
python -m pip install --upgrade "swiftpy-framework>=0.1
|
|
346
|
+
python -m pip install --upgrade "swiftpy-framework>=0.2.1"
|
|
347
347
|
swiftpy --version
|
|
348
348
|
```
|
|
349
349
|
|
|
@@ -355,4 +355,4 @@ Upgrading `swiftpy-framework` updates the installed framework library only—you
|
|
|
355
355
|
|
|
356
356
|
## Next Step
|
|
357
357
|
|
|
358
|
-
Continue
|
|
358
|
+
Continue to [Application Lifecycle, Configuration & Dependency Injection](2026-11-15-core-application-di-and-config.md) to configure `Application`, `.env` / `config/`, service providers, scoped DI, and `Context`.
|