swiftpy-framework 0.1.5__tar.gz → 0.2.0__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.5 → swiftpy_framework-0.2.0}/CHANGELOG.md +52 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/PKG-INFO +102 -8
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/README.md +101 -7
- swiftpy_framework-0.2.0/app/http/handler/exceptions.py +16 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/models/user.py +2 -3
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/logging.py +4 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/documentations/2026-11-14-installation-quick-start.md +6 -6
- swiftpy_framework-0.2.0/documentations/2026-11-15-ai-subsystem.md +862 -0
- swiftpy_framework-0.2.0/documentations/2026-11-15-authentication-and-security.md +417 -0
- swiftpy_framework-0.2.0/documentations/2026-11-15-cache-events-and-queues.md +313 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/documentations/2026-11-15-core-application-di-and-config.md +11 -5
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/documentations/2026-11-15-database-query-builder-and-migrations.md +5 -3
- swiftpy_framework-0.2.0/documentations/2026-11-15-filesystem-storage-and-mail.md +410 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +14 -2
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/documentations/2026-11-15-orm-models-and-relationships.md +51 -35
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/documentations/2026-11-15-validation-and-form-requests.md +32 -24
- swiftpy_framework-0.2.0/documentations/2026-11-15-websockets-and-admin.md +291 -0
- swiftpy_framework-0.2.0/documentations/2026-11-19-application-schemas.md +276 -0
- swiftpy_framework-0.2.0/documentations/2026-11-19-cli-and-testing.md +233 -0
- swiftpy_framework-0.2.0/documentations/2026-11-19-database-schema-and-blueprint.md +268 -0
- swiftpy_framework-0.2.0/documentations/2026-11-20-error-handling.md +207 -0
- swiftpy_framework-0.2.0/documentations/2026-11-20-logging.md +177 -0
- swiftpy_framework-0.2.0/documentations/2026-11-20-request-and-responses.md +204 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/pyproject.toml +4 -1
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/__init__.py +16 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/admin/auth.py +16 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/auth/__init__.py +17 -1
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/auth/api_key_guard.py +2 -0
- swiftpy_framework-0.2.0/swiftpy/auth/auth_manager.py +820 -0
- swiftpy_framework-0.2.0/swiftpy/auth/exceptions.py +130 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/auth/jwt_guard.py +1 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/auth/jwt_issuer.py +193 -19
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/auth/token_blacklist.py +36 -27
- swiftpy_framework-0.2.0/swiftpy/auth_manager.py +25 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/new.py +14 -17
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/model.stub +1 -2
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/application.py +126 -24
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/exceptions.py +6 -1
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/migrations/blueprint.py +56 -1
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/migrations/schema.py +47 -7
- swiftpy_framework-0.2.0/swiftpy/http/exceptions.py +81 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/http/request.py +109 -1
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/http/router.py +20 -5
- swiftpy_framework-0.2.0/swiftpy/logging/__init__.py +18 -0
- swiftpy_framework-0.2.0/swiftpy/logging/channels.py +181 -0
- swiftpy_framework-0.2.0/swiftpy/logging/log.py +70 -0
- swiftpy_framework-0.2.0/swiftpy/logging/manager.py +641 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/__init__.py +7 -1
- swiftpy_framework-0.2.0/swiftpy/validation/exceptions.py +88 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/form_request.py +5 -4
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/validator.py +124 -20
- swiftpy_framework-0.2.0/tests/auth/test_auth_proxy.py +266 -0
- swiftpy_framework-0.2.0/tests/auth/test_refresh_and_logout.py +471 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/test_new_command.py +22 -2
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/test_phase9_cli_remediation.py +1 -1
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/test_stubs_and_make.py +4 -0
- swiftpy_framework-0.2.0/tests/database/test_sequence_gaps.py +128 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/docs/test_readme_examples.py +106 -0
- swiftpy_framework-0.2.0/tests/http/test_request_router_abort.py +329 -0
- swiftpy_framework-0.2.0/tests/logging/__init__.py +1 -0
- swiftpy_framework-0.2.0/tests/logging/test_logging.py +575 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/migrations/test_migrations.py +131 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/orm/test_relationships_hardening.py +34 -1
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/typing/test_orm_typing.py +72 -1
- swiftpy_framework-0.2.0/tests/validation/test_validation_ergonomics.py +257 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_websocket_routing_and_lifecycle.py +3 -3
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/uv.lock +1 -1
- swiftpy_framework-0.1.5/app/http/handler/exceptions.py +0 -25
- swiftpy_framework-0.1.5/swiftpy/auth/auth_manager.py +0 -259
- swiftpy_framework-0.1.5/swiftpy/auth/exceptions.py +0 -71
- swiftpy_framework-0.1.5/swiftpy/http/exceptions.py +0 -41
- swiftpy_framework-0.1.5/swiftpy/validation/exceptions.py +0 -26
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/.dockerignore +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/.env.example +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/.github/workflows/ci.yml +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/.gitignore +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/Dockerfile +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/LICENSE +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/http/middleware/admin_middleware.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/http/middleware/auth_middleware.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/schemas/user_schema.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/app/services/user_service.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/ai.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/app.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/auth.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/cache.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/cors.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/database.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/events.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/filesystems.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/mail.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/config/queue.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/database/migrations/2026_01_01_000000_create_users_table.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/docker-compose.yml +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/main.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/red-black.png +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/routes/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/routes/api.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/admin/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/admin/registry.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/admin/views.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/client.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/prompts/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/prompts/loader.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/cli.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/make.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/queue.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/loader.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/controller.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/repository.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/resource.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/schema.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/console/stubs/service.stub +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/container.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/exceptions.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/identifiers.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/orm/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/orm/model.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/query_builder.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/helpers/helper.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/http/response.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/mail/transports/smtp.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/queue/worker.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/rules/registry.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/validation/rules/unique.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/websockets/connection.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/admin/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/admin/test_admin.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_observability.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_prompts.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_prompts_security.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/app/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/app/test_application_providers.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/app/test_starter_auth.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/cache/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/concurrency/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/conftest.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/core/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/docs/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/e2e/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/events/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/integration/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/migrations/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/orm/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/security/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/stress/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/support/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/testing/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/typing/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/test_db_rules.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/__init__.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/views/admin/dashboard.html +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/views/admin/login.html +0 -0
- {swiftpy_framework-0.1.5 → swiftpy_framework-0.2.0}/views/mail/template.html +0 -0
|
@@ -4,6 +4,58 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.2.0] - 2026-11-19
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Structured Asynchronous Logging (`swiftpy.logging` / `Log`):**
|
|
11
|
+
- Added the `swiftpy.logging` package (`Log`, `LogManager`, `ChannelLogger`, `DEFAULT_LOG_FORMAT`, `parse_log_level`, `resolve_log_path`) and exported `Log` from top-level `swiftpy`.
|
|
12
|
+
- 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.
|
|
13
|
+
- Added automatic recursive redaction of sensitive credential keys (`password`, `secret`, `token`, `api_key`, `authorization`, `pepper`, etc.) in structured `Log` keyword context.
|
|
14
|
+
- 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.
|
|
15
|
+
- **Validation Ergonomics (`swiftpy.validation`):**
|
|
16
|
+
- Added `ValidatedData` (`dict[str, Any]` subclass with recursive dot attribute access and dict compatibility, keeping bracket access safe for keys matching `dict` method names).
|
|
17
|
+
- 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`.
|
|
18
|
+
- Added `ValidationException.first_field()`, `first_error()`, `first_errors()`, `is_single`, and `single()` returning single-error `{"message": ..., "field": ...}` responses cleanly.
|
|
19
|
+
- **HTTP Request, Router & Exception Ergonomics (`swiftpy.http` / `swiftpy.core`):**
|
|
20
|
+
- 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`).
|
|
21
|
+
- Added `Router(prefix=..., middleware=...)` constructor configuration (validating dynamic `{...}` segments eagerly and composing router middleware cleanly across `include_router`).
|
|
22
|
+
- 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`.
|
|
23
|
+
- **Database Migrations (`Blueprint`):**
|
|
24
|
+
- 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`.
|
|
25
|
+
- **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`.
|
|
26
|
+
- **Authentication Token Refresh & Session Revocation (`swiftpy.auth` / `swiftpy.admin`):**
|
|
27
|
+
- 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.
|
|
28
|
+
- Added `AuthProxy.logout()` and `AuthProxy.logout_all()` on `auth()`, plus `AdminSessionStore.flush()` epoch-based in-memory admin session invalidation.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
- **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.
|
|
32
|
+
- **Scaffolding (`swiftpy new`) & Config:**
|
|
33
|
+
- Shortened generated `app/http/handler/exceptions.py` to demonstrate declarative `HttpException` subclasses without boilerplate handler registration.
|
|
34
|
+
- Added the `"stderr"` channel to `config/logging.py` and `swiftpy new` logging config templates.
|
|
35
|
+
- Bumped generated `pyproject.toml` dependency floor to `swiftpy-framework>=0.2.0` (`tests/console/test_phase9_cli_remediation.py` updated accordingly).
|
|
36
|
+
|
|
37
|
+
### Verified
|
|
38
|
+
- 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.
|
|
39
|
+
|
|
40
|
+
### Documentation
|
|
41
|
+
- 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`.
|
|
42
|
+
- 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`).
|
|
43
|
+
|
|
44
|
+
## [0.1.6] - 2026-11-17
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
- **Authentication Proxy (`swiftpy.auth_manager` / `auth()`):**
|
|
48
|
+
- Added Laravel-style `auth()` / `auth(guard)` request-scoped proxy importable via `from swiftpy.auth_manager import auth` in any file and re-exported from `swiftpy.auth`.
|
|
49
|
+
- Added `auth().check() -> bool` returning whether the current request task has an authenticated user.
|
|
50
|
+
- Added `auth().guest() -> bool` returning whether the current request task is unauthenticated.
|
|
51
|
+
- Added `auth().id() -> Any | None` returning the primary key identifier of the authenticated user.
|
|
52
|
+
- Added `auth().user() -> AuthUser | None` returning an entity with all declared `User` model fields present and all `__hidden__` fields strictly excluded. Supports both attribute access (`user.id`, `user.name`, `user.email`, `user.is_admin`) and dict access (`user["id"]`), `dict(user)`, `json.dumps(user)`, and `user.to_dict()`.
|
|
53
|
+
- Added guard-type selection via `auth("jwt")`, `auth("api_key")`, etc., enforcing guard isolation when a specific guard is requested.
|
|
54
|
+
- Added `set_user_model(model, guard=None)` and `current_user_model()` helpers to bind authenticated ORM Model instances into task-scoped Context.
|
|
55
|
+
- Enhanced `CurrentUser` DI container binding with `__getattr__` attribute access support across declared user attributes.
|
|
56
|
+
- Exported `AuthProxy`, `AuthUser`, `auth`, `set_user_model`, and `current_user_model` across `swiftpy.auth_manager`, `swiftpy.auth`, and top-level `swiftpy`.
|
|
57
|
+
|
|
58
|
+
|
|
7
59
|
## [0.1.5] - 2026-11-16
|
|
8
60
|
|
|
9
61
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
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,12 @@ 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 |
|
|
87
92
|
|
|
88
|
-
*See [`
|
|
93
|
+
*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
94
|
|
|
90
95
|
---
|
|
91
96
|
|
|
@@ -375,6 +380,87 @@ await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch()
|
|
|
375
380
|
await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch(delay=60.0)
|
|
376
381
|
```
|
|
377
382
|
|
|
383
|
+
### 8. Native AI Subsystem (LLM Client, Streaming, RAG & Agents)
|
|
384
|
+
|
|
385
|
+
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`:
|
|
386
|
+
|
|
387
|
+
```python
|
|
388
|
+
# routes/assistant.py
|
|
389
|
+
from swiftpy.http.response import StreamingResponse
|
|
390
|
+
from swiftpy.ai import (
|
|
391
|
+
AI,
|
|
392
|
+
Agent,
|
|
393
|
+
AgentMemory,
|
|
394
|
+
EmbeddingsClient,
|
|
395
|
+
InMemoryMemoryBackend,
|
|
396
|
+
InMemoryVectorStore,
|
|
397
|
+
Retriever,
|
|
398
|
+
XMLBlocksFormatter,
|
|
399
|
+
rag,
|
|
400
|
+
tool,
|
|
401
|
+
)
|
|
402
|
+
from swiftpy.testing import AIFake
|
|
403
|
+
|
|
404
|
+
# 1. Fluent chat & SSE streaming with provider auto-inference
|
|
405
|
+
response = await (
|
|
406
|
+
AI.chat(model="gpt-4o-mini")
|
|
407
|
+
.system("Answer concisely in one paragraph.")
|
|
408
|
+
.user("Summarize SwiftPY's transaction model.")
|
|
409
|
+
.temperature(0.2)
|
|
410
|
+
.max_tokens(300)
|
|
411
|
+
.send()
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
@app.get("/ai/stream")
|
|
416
|
+
async def stream_answer(question: str = "Explain asyncpg pooling") -> StreamingResponse:
|
|
417
|
+
async def chunks():
|
|
418
|
+
client = AI.chat(model="claude-3-5-sonnet-20241022").user(question)
|
|
419
|
+
async for token in client.stream():
|
|
420
|
+
yield token.encode("utf-8")
|
|
421
|
+
|
|
422
|
+
return StreamingResponse(
|
|
423
|
+
chunks(), headers={"content-type": "text/plain; charset=utf-8"}
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
# 2. Embeddings, Vector Stores (swap InMemoryVectorStore -> AI.vectorstore(adapter="pgvector", ...) for PostgreSQL) & RAG
|
|
428
|
+
store = InMemoryVectorStore(dimensions=1536, metric="cosine")
|
|
429
|
+
await store.create_collection("handbook", dimensions=1536, metric="cosine")
|
|
430
|
+
retriever = Retriever(vectorstore=store, embeddings=EmbeddingsClient(), provider="deterministic")
|
|
431
|
+
await retriever.add_documents(["SwiftPY manages asyncpg connections via DatabasePool."])
|
|
432
|
+
|
|
433
|
+
rag_result = await (
|
|
434
|
+
rag()
|
|
435
|
+
.retriever(retriever)
|
|
436
|
+
.top_k(4)
|
|
437
|
+
.formatter(XMLBlocksFormatter())
|
|
438
|
+
.generator(AI.chat(model="gpt-4o-mini"))
|
|
439
|
+
.run("How does SwiftPY manage PostgreSQL connections?")
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
# 3. Typed @tool + Stateful Agent with session memory (testable via AIFake)
|
|
444
|
+
@tool
|
|
445
|
+
async def lookup_order_status(order_id: int) -> dict[str, object]:
|
|
446
|
+
"""Look up fulfillment status for a customer order ID."""
|
|
447
|
+
return {"order_id": order_id, "status": "shipped"}
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
with AIFake("Order #42 is shipped.") as fake:
|
|
451
|
+
agent = Agent(
|
|
452
|
+
name="SupportAssistant",
|
|
453
|
+
system_prompt="Help customers track orders accurately.",
|
|
454
|
+
tools=[lookup_order_status],
|
|
455
|
+
memory=AgentMemory(backend=InMemoryMemoryBackend(), session_id="user-7"),
|
|
456
|
+
model="gpt-4o-mini",
|
|
457
|
+
)
|
|
458
|
+
reply = await agent.run("Where is order #42?", session_id="user-7")
|
|
459
|
+
fake.assert_called_once()
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
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`.
|
|
463
|
+
|
|
378
464
|
---
|
|
379
465
|
|
|
380
466
|
## Command Line Interface (`swiftpy`)
|
|
@@ -404,12 +490,13 @@ swiftpy migrate:rollback
|
|
|
404
490
|
swiftpy migrate:reset
|
|
405
491
|
swiftpy db:seed
|
|
406
492
|
|
|
407
|
-
# Scaffold migrations, models, requests, API keys, mailables, and more
|
|
493
|
+
# Scaffold migrations, models, requests, schemas, API keys, mailables, and more
|
|
408
494
|
swiftpy make:migration create_posts_table
|
|
409
495
|
swiftpy make:model Post --migration
|
|
410
496
|
swiftpy make:request RegisterRequest
|
|
497
|
+
swiftpy make:schema OrderSchema
|
|
411
498
|
swiftpy make:mail WelcomeEmail
|
|
412
|
-
swiftpy make:api-key --
|
|
499
|
+
swiftpy make:api-key --prefix sk_live_
|
|
413
500
|
|
|
414
501
|
# Create symbolic links from public/storage to storage/app/public
|
|
415
502
|
swiftpy storage:link
|
|
@@ -446,6 +533,11 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
446
533
|
| `DB_SSL_CA_FILE` | `database.connections.postgresql.ssl_ca_file` | `""` | Filepath to CA certificate when `DB_SSL` is `"verify-ca"` or `"verify-full"`. |
|
|
447
534
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). |
|
|
448
535
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
536
|
+
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
537
|
+
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
538
|
+
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
539
|
+
| `OPENAI_MODEL` | `ai.providers.openai.model` | `"gpt-4o"` | Default OpenAI chat model (`ANTHROPIC_MODEL` defaults to `"claude-3-5-sonnet-20241022"`). |
|
|
540
|
+
| `AI_VECTORSTORE_DEFAULT` | `ai.vectorstores.default` | `"in_memory"` | Default vector store adapter (`"in_memory"`, `"pgvector"`, `"qdrant"`, `"pinecone"`, `"chroma"`, `"lancedb"`). |
|
|
449
541
|
|
|
450
542
|
---
|
|
451
543
|
|
|
@@ -521,6 +613,7 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
521
613
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
522
614
|
│ │ ├── app_service_provider.py
|
|
523
615
|
│ │ └── database_service_provider.py
|
|
616
|
+
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
524
617
|
│ └── services/ # Domain business logic
|
|
525
618
|
├── config/ # Environment & framework configuration
|
|
526
619
|
│ ├── ai.py
|
|
@@ -549,10 +642,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
549
642
|
│ ├── filesystem/ # Multi-disk Storage (local, public, s3) and uploads
|
|
550
643
|
│ ├── helpers/ # Inflection (pluralize/snake_case), global helpers
|
|
551
644
|
│ ├── http/ # Router, request/response, middleware pipeline
|
|
645
|
+
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
552
646
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
553
647
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
554
648
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
555
|
-
│ ├── testing/ # TestClient, AIFake, MailFake,
|
|
649
|
+
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
556
650
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
557
651
|
│ └── websockets/ # WebSocket manager, connections, broadcast
|
|
558
652
|
├── 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,12 @@ 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 |
|
|
57
62
|
|
|
58
|
-
*See [`
|
|
63
|
+
*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
64
|
|
|
60
65
|
---
|
|
61
66
|
|
|
@@ -345,6 +350,87 @@ await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch()
|
|
|
345
350
|
await SendWelcomeEmail(user_id=42, email="alice@example.com").dispatch(delay=60.0)
|
|
346
351
|
```
|
|
347
352
|
|
|
353
|
+
### 8. Native AI Subsystem (LLM Client, Streaming, RAG & Agents)
|
|
354
|
+
|
|
355
|
+
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`:
|
|
356
|
+
|
|
357
|
+
```python
|
|
358
|
+
# routes/assistant.py
|
|
359
|
+
from swiftpy.http.response import StreamingResponse
|
|
360
|
+
from swiftpy.ai import (
|
|
361
|
+
AI,
|
|
362
|
+
Agent,
|
|
363
|
+
AgentMemory,
|
|
364
|
+
EmbeddingsClient,
|
|
365
|
+
InMemoryMemoryBackend,
|
|
366
|
+
InMemoryVectorStore,
|
|
367
|
+
Retriever,
|
|
368
|
+
XMLBlocksFormatter,
|
|
369
|
+
rag,
|
|
370
|
+
tool,
|
|
371
|
+
)
|
|
372
|
+
from swiftpy.testing import AIFake
|
|
373
|
+
|
|
374
|
+
# 1. Fluent chat & SSE streaming with provider auto-inference
|
|
375
|
+
response = await (
|
|
376
|
+
AI.chat(model="gpt-4o-mini")
|
|
377
|
+
.system("Answer concisely in one paragraph.")
|
|
378
|
+
.user("Summarize SwiftPY's transaction model.")
|
|
379
|
+
.temperature(0.2)
|
|
380
|
+
.max_tokens(300)
|
|
381
|
+
.send()
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
@app.get("/ai/stream")
|
|
386
|
+
async def stream_answer(question: str = "Explain asyncpg pooling") -> StreamingResponse:
|
|
387
|
+
async def chunks():
|
|
388
|
+
client = AI.chat(model="claude-3-5-sonnet-20241022").user(question)
|
|
389
|
+
async for token in client.stream():
|
|
390
|
+
yield token.encode("utf-8")
|
|
391
|
+
|
|
392
|
+
return StreamingResponse(
|
|
393
|
+
chunks(), headers={"content-type": "text/plain; charset=utf-8"}
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
# 2. Embeddings, Vector Stores (swap InMemoryVectorStore -> AI.vectorstore(adapter="pgvector", ...) for PostgreSQL) & RAG
|
|
398
|
+
store = InMemoryVectorStore(dimensions=1536, metric="cosine")
|
|
399
|
+
await store.create_collection("handbook", dimensions=1536, metric="cosine")
|
|
400
|
+
retriever = Retriever(vectorstore=store, embeddings=EmbeddingsClient(), provider="deterministic")
|
|
401
|
+
await retriever.add_documents(["SwiftPY manages asyncpg connections via DatabasePool."])
|
|
402
|
+
|
|
403
|
+
rag_result = await (
|
|
404
|
+
rag()
|
|
405
|
+
.retriever(retriever)
|
|
406
|
+
.top_k(4)
|
|
407
|
+
.formatter(XMLBlocksFormatter())
|
|
408
|
+
.generator(AI.chat(model="gpt-4o-mini"))
|
|
409
|
+
.run("How does SwiftPY manage PostgreSQL connections?")
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
# 3. Typed @tool + Stateful Agent with session memory (testable via AIFake)
|
|
414
|
+
@tool
|
|
415
|
+
async def lookup_order_status(order_id: int) -> dict[str, object]:
|
|
416
|
+
"""Look up fulfillment status for a customer order ID."""
|
|
417
|
+
return {"order_id": order_id, "status": "shipped"}
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
with AIFake("Order #42 is shipped.") as fake:
|
|
421
|
+
agent = Agent(
|
|
422
|
+
name="SupportAssistant",
|
|
423
|
+
system_prompt="Help customers track orders accurately.",
|
|
424
|
+
tools=[lookup_order_status],
|
|
425
|
+
memory=AgentMemory(backend=InMemoryMemoryBackend(), session_id="user-7"),
|
|
426
|
+
model="gpt-4o-mini",
|
|
427
|
+
)
|
|
428
|
+
reply = await agent.run("Where is order #42?", session_id="user-7")
|
|
429
|
+
fake.assert_called_once()
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
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`.
|
|
433
|
+
|
|
348
434
|
---
|
|
349
435
|
|
|
350
436
|
## Command Line Interface (`swiftpy`)
|
|
@@ -374,12 +460,13 @@ swiftpy migrate:rollback
|
|
|
374
460
|
swiftpy migrate:reset
|
|
375
461
|
swiftpy db:seed
|
|
376
462
|
|
|
377
|
-
# Scaffold migrations, models, requests, API keys, mailables, and more
|
|
463
|
+
# Scaffold migrations, models, requests, schemas, API keys, mailables, and more
|
|
378
464
|
swiftpy make:migration create_posts_table
|
|
379
465
|
swiftpy make:model Post --migration
|
|
380
466
|
swiftpy make:request RegisterRequest
|
|
467
|
+
swiftpy make:schema OrderSchema
|
|
381
468
|
swiftpy make:mail WelcomeEmail
|
|
382
|
-
swiftpy make:api-key --
|
|
469
|
+
swiftpy make:api-key --prefix sk_live_
|
|
383
470
|
|
|
384
471
|
# Create symbolic links from public/storage to storage/app/public
|
|
385
472
|
swiftpy storage:link
|
|
@@ -416,6 +503,11 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
416
503
|
| `DB_SSL_CA_FILE` | `database.connections.postgresql.ssl_ca_file` | `""` | Filepath to CA certificate when `DB_SSL` is `"verify-ca"` or `"verify-full"`. |
|
|
417
504
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). |
|
|
418
505
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
506
|
+
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
507
|
+
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
508
|
+
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
509
|
+
| `OPENAI_MODEL` | `ai.providers.openai.model` | `"gpt-4o"` | Default OpenAI chat model (`ANTHROPIC_MODEL` defaults to `"claude-3-5-sonnet-20241022"`). |
|
|
510
|
+
| `AI_VECTORSTORE_DEFAULT` | `ai.vectorstores.default` | `"in_memory"` | Default vector store adapter (`"in_memory"`, `"pgvector"`, `"qdrant"`, `"pinecone"`, `"chroma"`, `"lancedb"`). |
|
|
419
511
|
|
|
420
512
|
---
|
|
421
513
|
|
|
@@ -491,6 +583,7 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
491
583
|
│ ├── providers/ # Service providers (auto-discovered on boot)
|
|
492
584
|
│ │ ├── app_service_provider.py
|
|
493
585
|
│ │ └── database_service_provider.py
|
|
586
|
+
│ ├── schemas/ # Typed dataclasses & request/response DTOs
|
|
494
587
|
│ └── services/ # Domain business logic
|
|
495
588
|
├── config/ # Environment & framework configuration
|
|
496
589
|
│ ├── ai.py
|
|
@@ -519,10 +612,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
519
612
|
│ ├── filesystem/ # Multi-disk Storage (local, public, s3) and uploads
|
|
520
613
|
│ ├── helpers/ # Inflection (pluralize/snake_case), global helpers
|
|
521
614
|
│ ├── http/ # Router, request/response, middleware pipeline
|
|
615
|
+
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
522
616
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
523
617
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
524
618
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
525
|
-
│ ├── testing/ # TestClient, AIFake, MailFake,
|
|
619
|
+
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
526
620
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
527
621
|
│ └── websockets/ # WebSocket manager, connections, broadcast
|
|
528
622
|
├── 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
|
|
@@ -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.
|
|
162
|
+
└── pyproject.toml # Configured with swiftpy-framework>=0.2.0, 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.
|
|
316
|
+
"swiftpy-framework>=0.2.0",
|
|
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.0` 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.
|
|
346
|
+
python -m pip install --upgrade "swiftpy-framework>=0.2.0"
|
|
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`.
|