nyxa 0.0.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.
- nyxa-0.0.1/LICENSE +21 -0
- nyxa-0.0.1/PKG-INFO +317 -0
- nyxa-0.0.1/README.md +255 -0
- nyxa-0.0.1/pyproject.toml +79 -0
- nyxa-0.0.1/pyproject.toml.orig +69 -0
- nyxa-0.0.1/src/nyxa/__init__.py +296 -0
- nyxa-0.0.1/src/nyxa/__main__.py +6 -0
- nyxa-0.0.1/src/nyxa/_awaitable.py +46 -0
- nyxa-0.0.1/src/nyxa/_current.py +44 -0
- nyxa-0.0.1/src/nyxa/_speedups.py +170 -0
- nyxa-0.0.1/src/nyxa/adapters/__init__.py +72 -0
- nyxa-0.0.1/src/nyxa/adapters/asgi.py +84 -0
- nyxa-0.0.1/src/nyxa/adapters/base.py +139 -0
- nyxa-0.0.1/src/nyxa/adapters/cloudrun.py +103 -0
- nyxa-0.0.1/src/nyxa/adapters/container.py +254 -0
- nyxa-0.0.1/src/nyxa/adapters/docker.py +131 -0
- nyxa-0.0.1/src/nyxa/adapters/fly.py +60 -0
- nyxa-0.0.1/src/nyxa/adapters/granian.py +94 -0
- nyxa-0.0.1/src/nyxa/adapters/native.py +85 -0
- nyxa-0.0.1/src/nyxa/adapters/promotion.py +232 -0
- nyxa-0.0.1/src/nyxa/adapters/railway.py +46 -0
- nyxa-0.0.1/src/nyxa/adapters/render.py +39 -0
- nyxa-0.0.1/src/nyxa/application.py +5 -0
- nyxa-0.0.1/src/nyxa/asgi.py +16 -0
- nyxa-0.0.1/src/nyxa/bridge/__init__.py +30 -0
- nyxa-0.0.1/src/nyxa/bridge/asgi.py +561 -0
- nyxa-0.0.1/src/nyxa/bridge/base.py +54 -0
- nyxa-0.0.1/src/nyxa/bridge/blacksheep.py +113 -0
- nyxa-0.0.1/src/nyxa/bridge/native.py +364 -0
- nyxa-0.0.1/src/nyxa/bridge/rsgi.py +346 -0
- nyxa-0.0.1/src/nyxa/bridge/starlette.py +81 -0
- nyxa-0.0.1/src/nyxa/build/__init__.py +1 -0
- nyxa-0.0.1/src/nyxa/build/binary.py +106 -0
- nyxa-0.0.1/src/nyxa/build/bundle.py +501 -0
- nyxa-0.0.1/src/nyxa/build/classify.py +229 -0
- nyxa-0.0.1/src/nyxa/build/deps.py +548 -0
- nyxa-0.0.1/src/nyxa/build/emit_config.py +138 -0
- nyxa-0.0.1/src/nyxa/build/emit_container.py +78 -0
- nyxa-0.0.1/src/nyxa/build/emit_discovery.py +179 -0
- nyxa-0.0.1/src/nyxa/build/emit_macros.py +234 -0
- nyxa-0.0.1/src/nyxa/build/emit_plans.py +304 -0
- nyxa-0.0.1/src/nyxa/build/emit_routes.py +343 -0
- nyxa-0.0.1/src/nyxa/build/frozen.py +193 -0
- nyxa-0.0.1/src/nyxa/build/manifest.py +150 -0
- nyxa-0.0.1/src/nyxa/build/suggest.py +118 -0
- nyxa-0.0.1/src/nyxa/cli/__init__.py +14 -0
- nyxa-0.0.1/src/nyxa/cli/ai_scaffold.py +172 -0
- nyxa-0.0.1/src/nyxa/cli/commands/__init__.py +176 -0
- nyxa-0.0.1/src/nyxa/cli/commands/backup.py +251 -0
- nyxa-0.0.1/src/nyxa/cli/commands/catalog.py +61 -0
- nyxa-0.0.1/src/nyxa/cli/commands/database.py +231 -0
- nyxa-0.0.1/src/nyxa/cli/commands/deploy_promote.py +91 -0
- nyxa-0.0.1/src/nyxa/cli/commands/project.py +972 -0
- nyxa-0.0.1/src/nyxa/cli/commands/publish.py +166 -0
- nyxa-0.0.1/src/nyxa/cli/commands/queue.py +351 -0
- nyxa-0.0.1/src/nyxa/cli/commands/runtime.py +714 -0
- nyxa-0.0.1/src/nyxa/cli/commands/scaffold.py +562 -0
- nyxa-0.0.1/src/nyxa/cli/commands/schedule.py +313 -0
- nyxa-0.0.1/src/nyxa/cli/commands/utils.py +73 -0
- nyxa-0.0.1/src/nyxa/cli/commands/workflows.py +102 -0
- nyxa-0.0.1/src/nyxa/cli/dev.py +204 -0
- nyxa-0.0.1/src/nyxa/cli/fields.py +292 -0
- nyxa-0.0.1/src/nyxa/cli/hooks.py +157 -0
- nyxa-0.0.1/src/nyxa/cli/kits.py +107 -0
- nyxa-0.0.1/src/nyxa/cli/local_deps.py +173 -0
- nyxa-0.0.1/src/nyxa/cli/main.py +69 -0
- nyxa-0.0.1/src/nyxa/cli/make.py +1484 -0
- nyxa-0.0.1/src/nyxa/cli/new.py +161 -0
- nyxa-0.0.1/src/nyxa/cli/ops_assist.py +48 -0
- nyxa-0.0.1/src/nyxa/cli/package.py +275 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/__init__.py +85 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/bridge.py +206 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/process.py +82 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/__init__.py +7 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/app.py +58 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/runner.py +113 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/screens/__init__.py +7 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/screens/home.py +416 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/slash.py +76 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/widgets/__init__.py +19 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/widgets/choice_overlay.py +133 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/widgets/chrome.py +42 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/widgets/input_bar.py +102 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/widgets/scrollback.py +60 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/widgets/slash_menu.py +77 -0
- nyxa-0.0.1/src/nyxa/cli/runtime/ui/widgets/status_bar.py +114 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/action.stub +14 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/agents_md.stub +47 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/app_provider.stub +14 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/binary_cargo_toml.stub +7 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/binary_main_rs.stub +21 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/command.stub +17 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/config_app.stub +6 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/config_csrf.stub +9 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/config_database.stub +51 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/config_http.stub +19 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/config_queue.stub +51 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/config_workflows.stub +20 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/conftest.stub +28 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/controller.home.stub +8 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/controller.invokable.stub +8 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/controller.model.crud.stub +31 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/controller.model.stub +24 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/controller.resource.stub +20 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/controller.singleton.stub +13 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/controller.stub +8 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/env_example.stub +7 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/event.stub +14 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/exception.stub +18 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/factory.stub +19 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/fly.toml.stub +19 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/form_request.bare.stub +21 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/form_request.pair.stub +25 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/form_request.store.stub +15 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/form_request.update.stub +15 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/gitignore.stub +9 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/job.stub +22 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/listener.stub +18 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/manifest.stub +10 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/middleware.stub +13 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/migration.create.fields.stub +24 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/migration.create.stub +24 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/migration.stub +17 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/model.fields.stub +13 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/model.stub +13 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.config.stub +3 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.init.stub +7 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.lang.stub +1 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.migration.stub +23 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.provider.stub +23 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.pyproject.stub +36 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.routes.stub +5 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.test.stub +17 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/package.view.stub +2 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/provider.stub +21 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/pyproject.stub +12 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/railway.toml.stub +10 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/render.yaml.stub +9 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/routes.stub +6 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/schedule.stub +18 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/seeder.stub +13 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/service.ai.stub +11 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/service.stub +5 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/smoke_test.stub +26 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.action.stub +15 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.command.stub +20 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.controller.invokable.stub +25 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.controller.model.crud.stub +42 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.controller.model.stub +42 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.controller.resource.stub +40 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.controller.singleton.stub +30 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.controller.stub +27 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.event.stub +22 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.exception.stub +18 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.job.stub +25 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.listener.stub +33 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.middleware.stub +25 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.provider.stub +24 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.service.stub +16 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.stub +16 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/test.validator.stub +16 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/validator.stub +9 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/workflow.cloudrun.yml.stub +39 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/workflow.docker.yml.stub +304 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/workflow.fly.yml.stub +27 -0
- nyxa-0.0.1/src/nyxa/cli/stubs/workflow.stub +23 -0
- nyxa-0.0.1/src/nyxa/cli/templates.py +134 -0
- nyxa-0.0.1/src/nyxa/cli/wizard.py +576 -0
- nyxa-0.0.1/src/nyxa/command.py +363 -0
- nyxa-0.0.1/src/nyxa/concurrency.py +97 -0
- nyxa-0.0.1/src/nyxa/config/__init__.py +41 -0
- nyxa-0.0.1/src/nyxa/config/config.py +599 -0
- nyxa-0.0.1/src/nyxa/config/env.py +86 -0
- nyxa-0.0.1/src/nyxa/config/logging.py +285 -0
- nyxa-0.0.1/src/nyxa/config/secrets.py +95 -0
- nyxa-0.0.1/src/nyxa/console/__init__.py +7 -0
- nyxa-0.0.1/src/nyxa/console/errors.py +30 -0
- nyxa-0.0.1/src/nyxa/console/input.py +102 -0
- nyxa-0.0.1/src/nyxa/console/kernel.py +340 -0
- nyxa-0.0.1/src/nyxa/console/output.py +426 -0
- nyxa-0.0.1/src/nyxa/console/parser.py +121 -0
- nyxa-0.0.1/src/nyxa/console/signature.py +222 -0
- nyxa-0.0.1/src/nyxa/container.py +24 -0
- nyxa-0.0.1/src/nyxa/context.py +779 -0
- nyxa-0.0.1/src/nyxa/contracts.py +276 -0
- nyxa-0.0.1/src/nyxa/controller.py +130 -0
- nyxa-0.0.1/src/nyxa/core/__init__.py +6 -0
- nyxa-0.0.1/src/nyxa/core/application.py +1542 -0
- nyxa-0.0.1/src/nyxa/core/container.py +781 -0
- nyxa-0.0.1/src/nyxa/core/direct.py +321 -0
- nyxa-0.0.1/src/nyxa/core/discovery.py +168 -0
- nyxa-0.0.1/src/nyxa/core/ignitor.py +306 -0
- nyxa-0.0.1/src/nyxa/core/maintenance.py +134 -0
- nyxa-0.0.1/src/nyxa/core/manifest.py +210 -0
- nyxa-0.0.1/src/nyxa/core/plugins.py +261 -0
- nyxa-0.0.1/src/nyxa/core/serve.py +700 -0
- nyxa-0.0.1/src/nyxa/core/settings.py +115 -0
- nyxa-0.0.1/src/nyxa/core/telemetry.py +104 -0
- nyxa-0.0.1/src/nyxa/db/__init__.py +109 -0
- nyxa-0.0.1/src/nyxa/db/builder.py +914 -0
- nyxa-0.0.1/src/nyxa/db/casts.py +178 -0
- nyxa-0.0.1/src/nyxa/db/collection.py +605 -0
- nyxa-0.0.1/src/nyxa/db/connection.py +565 -0
- nyxa-0.0.1/src/nyxa/db/drivers/__init__.py +43 -0
- nyxa-0.0.1/src/nyxa/db/drivers/base.py +140 -0
- nyxa-0.0.1/src/nyxa/db/drivers/mysql.py +351 -0
- nyxa-0.0.1/src/nyxa/db/drivers/postgres.py +338 -0
- nyxa-0.0.1/src/nyxa/db/drivers/sqlite.py +273 -0
- nyxa-0.0.1/src/nyxa/db/errors.py +73 -0
- nyxa-0.0.1/src/nyxa/db/events.py +125 -0
- nyxa-0.0.1/src/nyxa/db/factory.py +323 -0
- nyxa-0.0.1/src/nyxa/db/grammar.py +707 -0
- nyxa-0.0.1/src/nyxa/db/manager.py +328 -0
- nyxa-0.0.1/src/nyxa/db/migrations.py +383 -0
- nyxa-0.0.1/src/nyxa/db/model.py +1597 -0
- nyxa-0.0.1/src/nyxa/db/pagination.py +142 -0
- nyxa-0.0.1/src/nyxa/db/plan.py +128 -0
- nyxa-0.0.1/src/nyxa/db/provider.py +7 -0
- nyxa-0.0.1/src/nyxa/db/query.py +612 -0
- nyxa-0.0.1/src/nyxa/db/relations.py +1084 -0
- nyxa-0.0.1/src/nyxa/db/schema.py +308 -0
- nyxa-0.0.1/src/nyxa/db/seeder.py +105 -0
- nyxa-0.0.1/src/nyxa/db/sync.py +357 -0
- nyxa-0.0.1/src/nyxa/db/traits.py +105 -0
- nyxa-0.0.1/src/nyxa/db/vectors.py +92 -0
- nyxa-0.0.1/src/nyxa/dev/__init__.py +7 -0
- nyxa-0.0.1/src/nyxa/dev/access.py +53 -0
- nyxa-0.0.1/src/nyxa/dev/introspect.py +377 -0
- nyxa-0.0.1/src/nyxa/dev/snapshot.py +436 -0
- nyxa-0.0.1/src/nyxa/discovery.py +19 -0
- nyxa-0.0.1/src/nyxa/env.py +5 -0
- nyxa-0.0.1/src/nyxa/errors.py +245 -0
- nyxa-0.0.1/src/nyxa/events.py +748 -0
- nyxa-0.0.1/src/nyxa/exceptions.py +131 -0
- nyxa-0.0.1/src/nyxa/helpers/__init__.py +195 -0
- nyxa-0.0.1/src/nyxa/helpers/ambient.py +826 -0
- nyxa-0.0.1/src/nyxa/helpers/benchmark.py +36 -0
- nyxa-0.0.1/src/nyxa/helpers/bounded.py +232 -0
- nyxa-0.0.1/src/nyxa/helpers/core.py +876 -0
- nyxa-0.0.1/src/nyxa/helpers/dates.py +46 -0
- nyxa-0.0.1/src/nyxa/helpers/payload.py +99 -0
- nyxa-0.0.1/src/nyxa/helpers/pipeline.py +115 -0
- nyxa-0.0.1/src/nyxa/helpers/timebox.py +54 -0
- nyxa-0.0.1/src/nyxa/http/__init__.py +105 -0
- nyxa-0.0.1/src/nyxa/http/context.py +541 -0
- nyxa-0.0.1/src/nyxa/http/ctx_snapshot.py +146 -0
- nyxa-0.0.1/src/nyxa/http/exceptions.py +228 -0
- nyxa-0.0.1/src/nyxa/http/headers.py +68 -0
- nyxa-0.0.1/src/nyxa/http/multipart.py +168 -0
- nyxa-0.0.1/src/nyxa/http/params.py +416 -0
- nyxa-0.0.1/src/nyxa/http/request.py +671 -0
- nyxa-0.0.1/src/nyxa/http/response.py +969 -0
- nyxa-0.0.1/src/nyxa/http/streaming.py +93 -0
- nyxa-0.0.1/src/nyxa/http/streams.py +144 -0
- nyxa-0.0.1/src/nyxa/http/websocket.py +194 -0
- nyxa-0.0.1/src/nyxa/ignitor.py +6 -0
- nyxa-0.0.1/src/nyxa/logging.py +9 -0
- nyxa-0.0.1/src/nyxa/manifest.py +5 -0
- nyxa-0.0.1/src/nyxa/middleware/__init__.py +75 -0
- nyxa-0.0.1/src/nyxa/middleware/access_log.py +80 -0
- nyxa-0.0.1/src/nyxa/middleware/context.py +40 -0
- nyxa-0.0.1/src/nyxa/middleware/cors.py +172 -0
- nyxa-0.0.1/src/nyxa/middleware/csrf.py +287 -0
- nyxa-0.0.1/src/nyxa/middleware/discovery.py +58 -0
- nyxa-0.0.1/src/nyxa/middleware/gzip.py +128 -0
- nyxa-0.0.1/src/nyxa/middleware/https_redirect.py +54 -0
- nyxa-0.0.1/src/nyxa/middleware/phase.py +222 -0
- nyxa-0.0.1/src/nyxa/middleware/pipeline.py +264 -0
- nyxa-0.0.1/src/nyxa/middleware/registry.py +75 -0
- nyxa-0.0.1/src/nyxa/middleware/trusted_host.py +71 -0
- nyxa-0.0.1/src/nyxa/monitoring/__init__.py +15 -0
- nyxa-0.0.1/src/nyxa/monitoring/alerts.py +173 -0
- nyxa-0.0.1/src/nyxa/monitoring/errors.py +79 -0
- nyxa-0.0.1/src/nyxa/openapi.py +243 -0
- nyxa-0.0.1/src/nyxa/playground.py +334 -0
- nyxa-0.0.1/src/nyxa/playground_actions.py +228 -0
- nyxa-0.0.1/src/nyxa/playground_terminal.py +324 -0
- nyxa-0.0.1/src/nyxa/plugins.py +5 -0
- nyxa-0.0.1/src/nyxa/plugins_catalog.py +182 -0
- nyxa-0.0.1/src/nyxa/process.py +1351 -0
- nyxa-0.0.1/src/nyxa/providers/__init__.py +24 -0
- nyxa-0.0.1/src/nyxa/providers/base.py +440 -0
- nyxa-0.0.1/src/nyxa/providers/core.py +392 -0
- nyxa-0.0.1/src/nyxa/providers/database.py +88 -0
- nyxa-0.0.1/src/nyxa/providers/queue.py +148 -0
- nyxa-0.0.1/src/nyxa/providers/schedule.py +70 -0
- nyxa-0.0.1/src/nyxa/providers/workflows.py +75 -0
- nyxa-0.0.1/src/nyxa/py.typed +0 -0
- nyxa-0.0.1/src/nyxa/pytest_plugin.py +55 -0
- nyxa-0.0.1/src/nyxa/queue/__init__.py +118 -0
- nyxa-0.0.1/src/nyxa/queue/driver.py +528 -0
- nyxa-0.0.1/src/nyxa/queue/drivers/__init__.py +8 -0
- nyxa-0.0.1/src/nyxa/queue/drivers/memory.py +381 -0
- nyxa-0.0.1/src/nyxa/queue/drivers/sync.py +128 -0
- nyxa-0.0.1/src/nyxa/queue/events.py +293 -0
- nyxa-0.0.1/src/nyxa/queue/job.py +622 -0
- nyxa-0.0.1/src/nyxa/queue/listener.py +95 -0
- nyxa-0.0.1/src/nyxa/queue/manager.py +757 -0
- nyxa-0.0.1/src/nyxa/queue/middleware.py +81 -0
- nyxa-0.0.1/src/nyxa/queue/provider.py +7 -0
- nyxa-0.0.1/src/nyxa/queue/stores/__init__.py +17 -0
- nyxa-0.0.1/src/nyxa/queue/stores/db.py +320 -0
- nyxa-0.0.1/src/nyxa/queue/testing.py +186 -0
- nyxa-0.0.1/src/nyxa/queue/worker.py +547 -0
- nyxa-0.0.1/src/nyxa/routing/__init__.py +44 -0
- nyxa-0.0.1/src/nyxa/routing/ambient.py +930 -0
- nyxa-0.0.1/src/nyxa/routing/compiler.py +188 -0
- nyxa-0.0.1/src/nyxa/routing/plan.py +1491 -0
- nyxa-0.0.1/src/nyxa/routing/refs.py +115 -0
- nyxa-0.0.1/src/nyxa/routing/route.py +958 -0
- nyxa-0.0.1/src/nyxa/routing/router.py +1494 -0
- nyxa-0.0.1/src/nyxa/routing/static.py +122 -0
- nyxa-0.0.1/src/nyxa/routing/tree.py +347 -0
- nyxa-0.0.1/src/nyxa/rsgi.py +13 -0
- nyxa-0.0.1/src/nyxa/scheduling/__init__.py +49 -0
- nyxa-0.0.1/src/nyxa/scheduling/cron.py +162 -0
- nyxa-0.0.1/src/nyxa/scheduling/runner.py +296 -0
- nyxa-0.0.1/src/nyxa/scheduling/schedule.py +618 -0
- nyxa-0.0.1/src/nyxa/scheduling/store.py +221 -0
- nyxa-0.0.1/src/nyxa/security.py +332 -0
- nyxa-0.0.1/src/nyxa/server.py +259 -0
- nyxa-0.0.1/src/nyxa/services.py +111 -0
- nyxa-0.0.1/src/nyxa/testing/__init__.py +876 -0
- nyxa-0.0.1/src/nyxa/testing/browser.py +172 -0
- nyxa-0.0.1/src/nyxa/testing/jobs.py +209 -0
- nyxa-0.0.1/src/nyxa/types.py +252 -0
- nyxa-0.0.1/src/nyxa/upgrade/__init__.py +1 -0
- nyxa-0.0.1/src/nyxa/upgrade/codemods.py +190 -0
- nyxa-0.0.1/src/nyxa/warmup.py +27 -0
- nyxa-0.0.1/src/nyxa/workflows/__init__.py +53 -0
- nyxa-0.0.1/src/nyxa/workflows/events.py +72 -0
- nyxa-0.0.1/src/nyxa/workflows/executor.py +353 -0
- nyxa-0.0.1/src/nyxa/workflows/manager.py +182 -0
- nyxa-0.0.1/src/nyxa/workflows/store.py +240 -0
- nyxa-0.0.1/src/nyxa/workflows/workflow.py +211 -0
- nyxa-0.0.1/src/nyxa/wsgi.py +230 -0
nyxa-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NyxaDev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
nyxa-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nyxa
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Standalone, convention-first backend framework for Python — AI-first
|
|
5
|
+
Keywords: framework,asgi,api,backend,ai,mcp
|
|
6
|
+
Author: Al-Amin Islam Nerob
|
|
7
|
+
Author-email: Al-Amin Islam Nerob <alamin@aincoder.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Web Environment
|
|
12
|
+
Classifier: Framework :: AsyncIO
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Dist: pydantic>=2.9
|
|
21
|
+
Requires-Dist: orjson>=3.10
|
|
22
|
+
Requires-Dist: rich>=13
|
|
23
|
+
Requires-Dist: textual>=2.0
|
|
24
|
+
Requires-Dist: watchfiles>=1.0
|
|
25
|
+
Requires-Dist: nyxa-speedups>=0.0.1
|
|
26
|
+
Requires-Dist: nyxa-minijinja>=0.0.1
|
|
27
|
+
Requires-Dist: nyxa-forms>=0.0.1
|
|
28
|
+
Requires-Dist: nyxa[cli,starlette,blacksheep,granian,uvicorn,msgspec,postgres,mysql] ; extra == 'all'
|
|
29
|
+
Requires-Dist: blacksheep>=2.0 ; extra == 'blacksheep'
|
|
30
|
+
Requires-Dist: mcp>=1.23 ; extra == 'dev'
|
|
31
|
+
Requires-Dist: cryptography>=43 ; extra == 'encrypt'
|
|
32
|
+
Requires-Dist: granian[reload]>=2.0 ; extra == 'granian'
|
|
33
|
+
Requires-Dist: argon2-cffi>=23 ; extra == 'hash-argon2'
|
|
34
|
+
Requires-Dist: bcrypt>=4 ; extra == 'hash-bcrypt'
|
|
35
|
+
Requires-Dist: msgspec>=0.19 ; extra == 'msgspec'
|
|
36
|
+
Requires-Dist: asyncmy>=0.2 ; extra == 'mysql'
|
|
37
|
+
Requires-Dist: asyncpg>=0.30 ; extra == 'postgres'
|
|
38
|
+
Requires-Dist: nyxa-server>=0.0.1 ; extra == 'server'
|
|
39
|
+
Requires-Dist: starlette>=0.40 ; extra == 'starlette'
|
|
40
|
+
Requires-Dist: uvicorn>=0.30 ; extra == 'uvicorn'
|
|
41
|
+
Requires-Python: >=3.13
|
|
42
|
+
Project-URL: Homepage, https://nyxadev.com
|
|
43
|
+
Project-URL: Repository, https://github.com/NyxaDev/Nyxa
|
|
44
|
+
Project-URL: Documentation, https://docs.nyxadev.com
|
|
45
|
+
Project-URL: Issues, https://github.com/NyxaDev/Nyxa/issues
|
|
46
|
+
Provides-Extra: all
|
|
47
|
+
Provides-Extra: blacksheep
|
|
48
|
+
Provides-Extra: cli
|
|
49
|
+
Provides-Extra: dev
|
|
50
|
+
Provides-Extra: encrypt
|
|
51
|
+
Provides-Extra: granian
|
|
52
|
+
Provides-Extra: hash-argon2
|
|
53
|
+
Provides-Extra: hash-bcrypt
|
|
54
|
+
Provides-Extra: msgspec
|
|
55
|
+
Provides-Extra: mysql
|
|
56
|
+
Provides-Extra: postgres
|
|
57
|
+
Provides-Extra: server
|
|
58
|
+
Provides-Extra: speed
|
|
59
|
+
Provides-Extra: starlette
|
|
60
|
+
Provides-Extra: uvicorn
|
|
61
|
+
Description-Content-Type: text/markdown
|
|
62
|
+
|
|
63
|
+
# nyxa
|
|
64
|
+
|
|
65
|
+
Standalone, convention-first backend framework for Python — AI-first.
|
|
66
|
+
|
|
67
|
+
Nyxa is a batteries-included async web framework: a compiled router, a
|
|
68
|
+
dependency-injection container, an ORM with migrations and seeding, a
|
|
69
|
+
provider/plugin system, an Artisan-style console, and a first-party
|
|
70
|
+
package ecosystem (`nyxa-cache`, `nyxa-auth`, `nyxa-ai`, …). Apps are
|
|
71
|
+
convention projects — `nyxa.toml`, `config/`, `start/`, `app/` — that
|
|
72
|
+
boot through a provider lifecycle and serve over ASGI, RSGI, WSGI, or
|
|
73
|
+
the optional native Rust server.
|
|
74
|
+
|
|
75
|
+
[](https://pypi.org/project/nyxa/) [](https://pypi.org/project/nyxa/)
|
|
76
|
+
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+
- **Routing** — ambient `router` proxy replayed into the app at boot:
|
|
80
|
+
`get/post/put/patch/delete`, groups with `prefix()`/`middleware()`,
|
|
81
|
+
`resource()`, `view()`, `redirect()`, `fallback()`, named routes, and
|
|
82
|
+
`ws()` WebSocket endpoints. Routes compile to dispatch plans; plugin
|
|
83
|
+
`route_compilers()` extend the pipeline per route.
|
|
84
|
+
- **HTTP surface** — `HttpContext` per request, `Request`/`Response`
|
|
85
|
+
plus `ResponseBuilder`, typed param extractors (`Query`, `Path`,
|
|
86
|
+
`Body`, `Form`, `Files`, `Header`, `Cookie`, `Ip`), `accepts()`/
|
|
87
|
+
`returns()` contract models (pydantic/msgspec), SSE helpers, and a
|
|
88
|
+
full `HttpException` hierarchy with pluggable renderers.
|
|
89
|
+
- **Dependency injection** — `Container` with singleton/transient/scoped
|
|
90
|
+
bindings, `Inject` markers, `Scope` control, and `CircularDependencyError`
|
|
91
|
+
/`ResolutionError` diagnostics.
|
|
92
|
+
- **Provider lifecycle** — `ServiceProvider` hooks (`register` → `boot`
|
|
93
|
+
→ `ready` → `shutdown`) plus plugin surfaces: `commands()`, `config()`,
|
|
94
|
+
`macros()`, `route_compilers()`, `contract_kinds()`, `queue_drivers()`,
|
|
95
|
+
`cache_drivers()`, `adapters()`, `exception_renderers()`. The `Ignitor`
|
|
96
|
+
orchestrates the boot sequence.
|
|
97
|
+
- **ORM & database** — `Model` (fillable guards, dirty tracking,
|
|
98
|
+
`SoftDeletes`, relations via `@relation`, class-level
|
|
99
|
+
`update`/`update_or_fail` with `RETURNING`), fluent `QueryBuilder`,
|
|
100
|
+
`DB` facade, `Schema` builder, `Migration`s, `Factory`/`Seeder`, and
|
|
101
|
+
`Connection.lease()`/`Model.using()` for pinning pooled connections.
|
|
102
|
+
Drivers: SQLite built in, Postgres (`asyncpg`) and MySQL (`asyncmy`)
|
|
103
|
+
via extras.
|
|
104
|
+
- **Console** — `Command` subclasses with Artisan-style `signature`
|
|
105
|
+
strings (`"mail:send {user} {--f|force}"`), kernel-registered, lazily
|
|
106
|
+
loaded plugin commands.
|
|
107
|
+
- **CLI** — `nyxa` entrypoint: `new`, `dev`, `start`, `build`, `deploy`,
|
|
108
|
+
`add`, `make:*` scaffolding (~20 generators), `migrate`/`db:seed`
|
|
109
|
+
family, `queue:*` family, `schedule:*`, `routes`, `doctor`, `repl`,
|
|
110
|
+
`test`, `inspect`, `plugins`, `up`/`down`, `key:generate`, and more.
|
|
111
|
+
- **Config & env** — `config/*.py` files expose a `config` dict
|
|
112
|
+
(namespaced by filename) read via `config.get`/`set` with typed
|
|
113
|
+
getters; `define_config()` builds a standalone typed config object
|
|
114
|
+
(env-overriding) for app code to import; `Env` loader with casts;
|
|
115
|
+
`nyxa.toml` manifest sections (`[app]`, `[plugins]`, `[deploy]`).
|
|
116
|
+
- **Events, scheduling, queue** — `EventEmitter` (`app.events`),
|
|
117
|
+
`app.schedule` entries (`call`/`job`/`command`/`exec` + `cron()`,
|
|
118
|
+
`daily()`, `hourly()`, …) served by `nyxa schedule:work`, and a
|
|
119
|
+
pluggable queue (`QueueProvider`, driver factories).
|
|
120
|
+
- **Testing** — `TestClient` (sync + async) over the in-process app,
|
|
121
|
+
provider/config/route/publish assertions, a `pytest` plugin, and
|
|
122
|
+
`fake()` utilities shipped by first-party packages.
|
|
123
|
+
- **OpenAPI & playground** — generated spec and interactive playground,
|
|
124
|
+
gated by `app.debug`/`NYXA_ENV`.
|
|
125
|
+
- **Transports & deployment** — ASGI/WSGI/RSGI bridges, `nyxa build`
|
|
126
|
+
frozen-bundle production boots, `nyxa deploy`/`promote`/`rollback`,
|
|
127
|
+
deployment adapters, warmup, and process management (`Process`).
|
|
128
|
+
|
|
129
|
+
## Install
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pip install nyxa
|
|
133
|
+
# or
|
|
134
|
+
uv add nyxa
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The `nyxa` command and the Rust accelerators (`nyxa-speedups` +
|
|
138
|
+
`nyxa-minijinja`) are bundled by default — the `cli`/`speed` extras stay
|
|
139
|
+
declared for back-compat but add nothing. Accelerator wheels ship for
|
|
140
|
+
tier-1 platforms; elsewhere pip builds from the sdist (Rust toolchain)
|
|
141
|
+
or use `pip install --no-deps nyxa` plus the deps you want. Useful
|
|
142
|
+
extras: `starlette`,
|
|
143
|
+
`blacksheep`, `granian`, `uvicorn`, `msgspec`, `postgres`, `mysql`,
|
|
144
|
+
`encrypt`, `hash-argon2`, `hash-bcrypt`, `server` (native Rust server),
|
|
145
|
+
`all`.
|
|
146
|
+
|
|
147
|
+
## Usage
|
|
148
|
+
|
|
149
|
+
### A convention project
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
nyxa new my-api && cd my-api
|
|
153
|
+
nyxa dev
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`nyxa new` scaffolds `nyxa.toml` (the manifest), `config/*.py`,
|
|
157
|
+
`start/routes.py`, `start/schedule.py`, `app/` (providers, middleware,
|
|
158
|
+
commands), and `bootstrap/app.py`. The `Application` resolves its root
|
|
159
|
+
from the manifest or an explicit path:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from nyxa import Application
|
|
163
|
+
|
|
164
|
+
app = Application("path/to/project") # or Application() inside a project
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Routing
|
|
168
|
+
|
|
169
|
+
Route files declare against the ambient `router` proxy; declarations
|
|
170
|
+
replay into the app router at boot:
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from nyxa import router
|
|
174
|
+
|
|
175
|
+
router.get("/health", lambda ctx: {"status": "ok"}).named("health")
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
async def show(ctx, id: int): # path param injected by name
|
|
179
|
+
return {"user": id}
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def api(r):
|
|
183
|
+
r.get("/users/:id", show)
|
|
184
|
+
r.post("/users", "app.actions.create_user")
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
router.group(api, prefix="/api").name("api.").middleware(Auth)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Path patterns accept `:param`, `:param?`, `{param}`, `{param:int}`,
|
|
191
|
+
and `...name`/`...name?` catch-alls; converters and
|
|
192
|
+
`.where_ulid()`-style constraints are built in. Groups, `router.controller()`/`resource()` controllers,
|
|
193
|
+
`router.view()`, `router.redirect()`, `router.fallback()`,
|
|
194
|
+
`router.ws()` WebSockets, and `sse_stream`/`sse_event` server-sent
|
|
195
|
+
events are all first-class.
|
|
196
|
+
|
|
197
|
+
Middleware is a class with a `handle` coroutine — referenced per-route
|
|
198
|
+
via `.use(Cls)`/`route.use("name")` or on groups; `scope = "server"`
|
|
199
|
+
runs it globally:
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
class Auth:
|
|
203
|
+
async def handle(self, ctx, next):
|
|
204
|
+
if ctx.request.header("authorization") is None:
|
|
205
|
+
abort(401)
|
|
206
|
+
return await next()
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Dependency injection & providers
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
from nyxa import Inject, ServiceProvider
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class Billing:
|
|
216
|
+
def charge(self, cents: int) -> str: ...
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class AppProvider(ServiceProvider):
|
|
220
|
+
def register(self) -> None:
|
|
221
|
+
self.app.container.singleton(Billing)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
async def invoice(ctx, billing: Billing = Inject(Billing)):
|
|
225
|
+
return {"id": billing.charge(500)}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### ORM
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
from nyxa import Model
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class Post(Model):
|
|
235
|
+
fillable = ["title", "body"]
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
post = await Post.create({"title": "Hello", "body": "..."})
|
|
239
|
+
post = await Post.find(1)
|
|
240
|
+
posts = await Post.query().where("published", True).order_by("id").all()
|
|
241
|
+
await Post.update({"title": "Hi"}, "id", 1) # class-level UPDATE
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
`nyxa migrate`, `nyxa make:model`, factories, and seeders cover the rest
|
|
245
|
+
of the lifecycle; `DB` and `Schema` facades handle raw queries and DDL.
|
|
246
|
+
|
|
247
|
+
### Console commands
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from nyxa import Command
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class SendMail(Command):
|
|
254
|
+
signature = "mail:send {user : user id} {--f|force : skip confirm}"
|
|
255
|
+
|
|
256
|
+
async def handle(self, app, user: int, force: bool) -> int:
|
|
257
|
+
...
|
|
258
|
+
return 0
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Register via a provider's `commands()` or drop the class into
|
|
262
|
+
`app/commands/` — discovered lazily by the `nyxa` kernel.
|
|
263
|
+
|
|
264
|
+
### Testing
|
|
265
|
+
|
|
266
|
+
```python
|
|
267
|
+
from nyxa import Application, TestClient
|
|
268
|
+
|
|
269
|
+
app = Application("path/to/project")
|
|
270
|
+
client = TestClient(app)
|
|
271
|
+
response = client.get("/health")
|
|
272
|
+
assert response.status_code == 200
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
`nyxa.testing` also ships `assert_provider_registered`,
|
|
276
|
+
`assert_config_merged`, `assert_route_registered`, and
|
|
277
|
+
`assert_publish_tag` for package tests, plus a pytest plugin.
|
|
278
|
+
|
|
279
|
+
## Public API
|
|
280
|
+
|
|
281
|
+
The package surface (`from nyxa import …`, lazily bound) groups as:
|
|
282
|
+
|
|
283
|
+
- **App & lifecycle** — `Application`, `ServiceProvider`, `Env`,
|
|
284
|
+
`define_config`, `__version__`
|
|
285
|
+
- **Container** — `Container`, `Provider`, `Inject`, `Scope`,
|
|
286
|
+
`ContainerError`, `CircularDependencyError`, `ResolutionError`
|
|
287
|
+
- **Routing** — `router` (ambient proxy), `Router`, `Route`,
|
|
288
|
+
`RouteError`, `Controller`, `Middleware`, `MiddlewareRegistry`
|
|
289
|
+
- **HTTP** — `HttpContext`, `Request`, `Response`, `ResponseBuilder`,
|
|
290
|
+
`get_request`, `use`, `use_response`, `sse_event`, `sse_stream`,
|
|
291
|
+
`Ws`, `WsClosed`; params `Query`, `Path`, `Body`, `Form`, `Files`,
|
|
292
|
+
`Header`, `Cookie`, `Ip`
|
|
293
|
+
- **Exceptions** — `HttpException`, `abort`, `ExceptionHandler`,
|
|
294
|
+
`HttpExceptionHandler`, `BadRequestException`, `UnauthorizedException`,
|
|
295
|
+
`ForbiddenException`, `NotFoundException`, `MethodNotAllowedException`,
|
|
296
|
+
`ConflictException`, `ValidationException`, `ModelNotFound`,
|
|
297
|
+
`TooManyRequestsException`, `InternalServerErrorException`,
|
|
298
|
+
`ServiceUnavailableException`, `NyxaError`
|
|
299
|
+
- **Database** — `Model`, `DB`, `Schema`, `Collection`, `Query` (param
|
|
300
|
+
extractor — the builder is `Model.query()`), `Migration`, `Factory`,
|
|
301
|
+
`Seeder`, `SoftDeletes`
|
|
302
|
+
- **Runtime** — `Command`, `Context`, `Process`, `EventEmitter`,
|
|
303
|
+
`TestClient`
|
|
304
|
+
|
|
305
|
+
## Configuration
|
|
306
|
+
|
|
307
|
+
Project config lives in `config/*.py` files exporting a `config` dict
|
|
308
|
+
(namespaced by filename — `config/http.py` → `http.*`); `nyxa.toml`
|
|
309
|
+
carries `[app]` (`name`, `env`, `debug`, `providers_dir`,
|
|
310
|
+
`middleware_dir`, `env_file`, `auto_discover_plugins`), `[plugins]`
|
|
311
|
+
(`discover` allowlist), and `[deploy]` (`adapter`). Environment
|
|
312
|
+
resolution: `NYXA_ENV` → `[app] env` → `"development"`;
|
|
313
|
+
`NYXA_DEBUG`/`[app] debug`/`debug=` for the debug flag.
|
|
314
|
+
|
|
315
|
+
## License
|
|
316
|
+
|
|
317
|
+
MIT — see `LICENSE`.
|
nyxa-0.0.1/README.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# nyxa
|
|
2
|
+
|
|
3
|
+
Standalone, convention-first backend framework for Python — AI-first.
|
|
4
|
+
|
|
5
|
+
Nyxa is a batteries-included async web framework: a compiled router, a
|
|
6
|
+
dependency-injection container, an ORM with migrations and seeding, a
|
|
7
|
+
provider/plugin system, an Artisan-style console, and a first-party
|
|
8
|
+
package ecosystem (`nyxa-cache`, `nyxa-auth`, `nyxa-ai`, …). Apps are
|
|
9
|
+
convention projects — `nyxa.toml`, `config/`, `start/`, `app/` — that
|
|
10
|
+
boot through a provider lifecycle and serve over ASGI, RSGI, WSGI, or
|
|
11
|
+
the optional native Rust server.
|
|
12
|
+
|
|
13
|
+
[](https://pypi.org/project/nyxa/) [](https://pypi.org/project/nyxa/)
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **Routing** — ambient `router` proxy replayed into the app at boot:
|
|
18
|
+
`get/post/put/patch/delete`, groups with `prefix()`/`middleware()`,
|
|
19
|
+
`resource()`, `view()`, `redirect()`, `fallback()`, named routes, and
|
|
20
|
+
`ws()` WebSocket endpoints. Routes compile to dispatch plans; plugin
|
|
21
|
+
`route_compilers()` extend the pipeline per route.
|
|
22
|
+
- **HTTP surface** — `HttpContext` per request, `Request`/`Response`
|
|
23
|
+
plus `ResponseBuilder`, typed param extractors (`Query`, `Path`,
|
|
24
|
+
`Body`, `Form`, `Files`, `Header`, `Cookie`, `Ip`), `accepts()`/
|
|
25
|
+
`returns()` contract models (pydantic/msgspec), SSE helpers, and a
|
|
26
|
+
full `HttpException` hierarchy with pluggable renderers.
|
|
27
|
+
- **Dependency injection** — `Container` with singleton/transient/scoped
|
|
28
|
+
bindings, `Inject` markers, `Scope` control, and `CircularDependencyError`
|
|
29
|
+
/`ResolutionError` diagnostics.
|
|
30
|
+
- **Provider lifecycle** — `ServiceProvider` hooks (`register` → `boot`
|
|
31
|
+
→ `ready` → `shutdown`) plus plugin surfaces: `commands()`, `config()`,
|
|
32
|
+
`macros()`, `route_compilers()`, `contract_kinds()`, `queue_drivers()`,
|
|
33
|
+
`cache_drivers()`, `adapters()`, `exception_renderers()`. The `Ignitor`
|
|
34
|
+
orchestrates the boot sequence.
|
|
35
|
+
- **ORM & database** — `Model` (fillable guards, dirty tracking,
|
|
36
|
+
`SoftDeletes`, relations via `@relation`, class-level
|
|
37
|
+
`update`/`update_or_fail` with `RETURNING`), fluent `QueryBuilder`,
|
|
38
|
+
`DB` facade, `Schema` builder, `Migration`s, `Factory`/`Seeder`, and
|
|
39
|
+
`Connection.lease()`/`Model.using()` for pinning pooled connections.
|
|
40
|
+
Drivers: SQLite built in, Postgres (`asyncpg`) and MySQL (`asyncmy`)
|
|
41
|
+
via extras.
|
|
42
|
+
- **Console** — `Command` subclasses with Artisan-style `signature`
|
|
43
|
+
strings (`"mail:send {user} {--f|force}"`), kernel-registered, lazily
|
|
44
|
+
loaded plugin commands.
|
|
45
|
+
- **CLI** — `nyxa` entrypoint: `new`, `dev`, `start`, `build`, `deploy`,
|
|
46
|
+
`add`, `make:*` scaffolding (~20 generators), `migrate`/`db:seed`
|
|
47
|
+
family, `queue:*` family, `schedule:*`, `routes`, `doctor`, `repl`,
|
|
48
|
+
`test`, `inspect`, `plugins`, `up`/`down`, `key:generate`, and more.
|
|
49
|
+
- **Config & env** — `config/*.py` files expose a `config` dict
|
|
50
|
+
(namespaced by filename) read via `config.get`/`set` with typed
|
|
51
|
+
getters; `define_config()` builds a standalone typed config object
|
|
52
|
+
(env-overriding) for app code to import; `Env` loader with casts;
|
|
53
|
+
`nyxa.toml` manifest sections (`[app]`, `[plugins]`, `[deploy]`).
|
|
54
|
+
- **Events, scheduling, queue** — `EventEmitter` (`app.events`),
|
|
55
|
+
`app.schedule` entries (`call`/`job`/`command`/`exec` + `cron()`,
|
|
56
|
+
`daily()`, `hourly()`, …) served by `nyxa schedule:work`, and a
|
|
57
|
+
pluggable queue (`QueueProvider`, driver factories).
|
|
58
|
+
- **Testing** — `TestClient` (sync + async) over the in-process app,
|
|
59
|
+
provider/config/route/publish assertions, a `pytest` plugin, and
|
|
60
|
+
`fake()` utilities shipped by first-party packages.
|
|
61
|
+
- **OpenAPI & playground** — generated spec and interactive playground,
|
|
62
|
+
gated by `app.debug`/`NYXA_ENV`.
|
|
63
|
+
- **Transports & deployment** — ASGI/WSGI/RSGI bridges, `nyxa build`
|
|
64
|
+
frozen-bundle production boots, `nyxa deploy`/`promote`/`rollback`,
|
|
65
|
+
deployment adapters, warmup, and process management (`Process`).
|
|
66
|
+
|
|
67
|
+
## Install
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install nyxa
|
|
71
|
+
# or
|
|
72
|
+
uv add nyxa
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The `nyxa` command and the Rust accelerators (`nyxa-speedups` +
|
|
76
|
+
`nyxa-minijinja`) are bundled by default — the `cli`/`speed` extras stay
|
|
77
|
+
declared for back-compat but add nothing. Accelerator wheels ship for
|
|
78
|
+
tier-1 platforms; elsewhere pip builds from the sdist (Rust toolchain)
|
|
79
|
+
or use `pip install --no-deps nyxa` plus the deps you want. Useful
|
|
80
|
+
extras: `starlette`,
|
|
81
|
+
`blacksheep`, `granian`, `uvicorn`, `msgspec`, `postgres`, `mysql`,
|
|
82
|
+
`encrypt`, `hash-argon2`, `hash-bcrypt`, `server` (native Rust server),
|
|
83
|
+
`all`.
|
|
84
|
+
|
|
85
|
+
## Usage
|
|
86
|
+
|
|
87
|
+
### A convention project
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
nyxa new my-api && cd my-api
|
|
91
|
+
nyxa dev
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`nyxa new` scaffolds `nyxa.toml` (the manifest), `config/*.py`,
|
|
95
|
+
`start/routes.py`, `start/schedule.py`, `app/` (providers, middleware,
|
|
96
|
+
commands), and `bootstrap/app.py`. The `Application` resolves its root
|
|
97
|
+
from the manifest or an explicit path:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from nyxa import Application
|
|
101
|
+
|
|
102
|
+
app = Application("path/to/project") # or Application() inside a project
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Routing
|
|
106
|
+
|
|
107
|
+
Route files declare against the ambient `router` proxy; declarations
|
|
108
|
+
replay into the app router at boot:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from nyxa import router
|
|
112
|
+
|
|
113
|
+
router.get("/health", lambda ctx: {"status": "ok"}).named("health")
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
async def show(ctx, id: int): # path param injected by name
|
|
117
|
+
return {"user": id}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def api(r):
|
|
121
|
+
r.get("/users/:id", show)
|
|
122
|
+
r.post("/users", "app.actions.create_user")
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
router.group(api, prefix="/api").name("api.").middleware(Auth)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Path patterns accept `:param`, `:param?`, `{param}`, `{param:int}`,
|
|
129
|
+
and `...name`/`...name?` catch-alls; converters and
|
|
130
|
+
`.where_ulid()`-style constraints are built in. Groups, `router.controller()`/`resource()` controllers,
|
|
131
|
+
`router.view()`, `router.redirect()`, `router.fallback()`,
|
|
132
|
+
`router.ws()` WebSockets, and `sse_stream`/`sse_event` server-sent
|
|
133
|
+
events are all first-class.
|
|
134
|
+
|
|
135
|
+
Middleware is a class with a `handle` coroutine — referenced per-route
|
|
136
|
+
via `.use(Cls)`/`route.use("name")` or on groups; `scope = "server"`
|
|
137
|
+
runs it globally:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
class Auth:
|
|
141
|
+
async def handle(self, ctx, next):
|
|
142
|
+
if ctx.request.header("authorization") is None:
|
|
143
|
+
abort(401)
|
|
144
|
+
return await next()
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Dependency injection & providers
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
from nyxa import Inject, ServiceProvider
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class Billing:
|
|
154
|
+
def charge(self, cents: int) -> str: ...
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class AppProvider(ServiceProvider):
|
|
158
|
+
def register(self) -> None:
|
|
159
|
+
self.app.container.singleton(Billing)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
async def invoice(ctx, billing: Billing = Inject(Billing)):
|
|
163
|
+
return {"id": billing.charge(500)}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### ORM
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from nyxa import Model
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class Post(Model):
|
|
173
|
+
fillable = ["title", "body"]
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
post = await Post.create({"title": "Hello", "body": "..."})
|
|
177
|
+
post = await Post.find(1)
|
|
178
|
+
posts = await Post.query().where("published", True).order_by("id").all()
|
|
179
|
+
await Post.update({"title": "Hi"}, "id", 1) # class-level UPDATE
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
`nyxa migrate`, `nyxa make:model`, factories, and seeders cover the rest
|
|
183
|
+
of the lifecycle; `DB` and `Schema` facades handle raw queries and DDL.
|
|
184
|
+
|
|
185
|
+
### Console commands
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from nyxa import Command
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class SendMail(Command):
|
|
192
|
+
signature = "mail:send {user : user id} {--f|force : skip confirm}"
|
|
193
|
+
|
|
194
|
+
async def handle(self, app, user: int, force: bool) -> int:
|
|
195
|
+
...
|
|
196
|
+
return 0
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Register via a provider's `commands()` or drop the class into
|
|
200
|
+
`app/commands/` — discovered lazily by the `nyxa` kernel.
|
|
201
|
+
|
|
202
|
+
### Testing
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
from nyxa import Application, TestClient
|
|
206
|
+
|
|
207
|
+
app = Application("path/to/project")
|
|
208
|
+
client = TestClient(app)
|
|
209
|
+
response = client.get("/health")
|
|
210
|
+
assert response.status_code == 200
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
`nyxa.testing` also ships `assert_provider_registered`,
|
|
214
|
+
`assert_config_merged`, `assert_route_registered`, and
|
|
215
|
+
`assert_publish_tag` for package tests, plus a pytest plugin.
|
|
216
|
+
|
|
217
|
+
## Public API
|
|
218
|
+
|
|
219
|
+
The package surface (`from nyxa import …`, lazily bound) groups as:
|
|
220
|
+
|
|
221
|
+
- **App & lifecycle** — `Application`, `ServiceProvider`, `Env`,
|
|
222
|
+
`define_config`, `__version__`
|
|
223
|
+
- **Container** — `Container`, `Provider`, `Inject`, `Scope`,
|
|
224
|
+
`ContainerError`, `CircularDependencyError`, `ResolutionError`
|
|
225
|
+
- **Routing** — `router` (ambient proxy), `Router`, `Route`,
|
|
226
|
+
`RouteError`, `Controller`, `Middleware`, `MiddlewareRegistry`
|
|
227
|
+
- **HTTP** — `HttpContext`, `Request`, `Response`, `ResponseBuilder`,
|
|
228
|
+
`get_request`, `use`, `use_response`, `sse_event`, `sse_stream`,
|
|
229
|
+
`Ws`, `WsClosed`; params `Query`, `Path`, `Body`, `Form`, `Files`,
|
|
230
|
+
`Header`, `Cookie`, `Ip`
|
|
231
|
+
- **Exceptions** — `HttpException`, `abort`, `ExceptionHandler`,
|
|
232
|
+
`HttpExceptionHandler`, `BadRequestException`, `UnauthorizedException`,
|
|
233
|
+
`ForbiddenException`, `NotFoundException`, `MethodNotAllowedException`,
|
|
234
|
+
`ConflictException`, `ValidationException`, `ModelNotFound`,
|
|
235
|
+
`TooManyRequestsException`, `InternalServerErrorException`,
|
|
236
|
+
`ServiceUnavailableException`, `NyxaError`
|
|
237
|
+
- **Database** — `Model`, `DB`, `Schema`, `Collection`, `Query` (param
|
|
238
|
+
extractor — the builder is `Model.query()`), `Migration`, `Factory`,
|
|
239
|
+
`Seeder`, `SoftDeletes`
|
|
240
|
+
- **Runtime** — `Command`, `Context`, `Process`, `EventEmitter`,
|
|
241
|
+
`TestClient`
|
|
242
|
+
|
|
243
|
+
## Configuration
|
|
244
|
+
|
|
245
|
+
Project config lives in `config/*.py` files exporting a `config` dict
|
|
246
|
+
(namespaced by filename — `config/http.py` → `http.*`); `nyxa.toml`
|
|
247
|
+
carries `[app]` (`name`, `env`, `debug`, `providers_dir`,
|
|
248
|
+
`middleware_dir`, `env_file`, `auto_discover_plugins`), `[plugins]`
|
|
249
|
+
(`discover` allowlist), and `[deploy]` (`adapter`). Environment
|
|
250
|
+
resolution: `NYXA_ENV` → `[app] env` → `"development"`;
|
|
251
|
+
`NYXA_DEBUG`/`[app] debug`/`debug=` for the debug flag.
|
|
252
|
+
|
|
253
|
+
## License
|
|
254
|
+
|
|
255
|
+
MIT — see `LICENSE`.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "nyxa"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "Standalone, convention-first backend framework for Python — AI-first"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.13"
|
|
9
|
+
keywords = [
|
|
10
|
+
"framework",
|
|
11
|
+
"asgi",
|
|
12
|
+
"api",
|
|
13
|
+
"backend",
|
|
14
|
+
"ai",
|
|
15
|
+
"mcp",
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 4 - Beta",
|
|
19
|
+
"Environment :: Web Environment",
|
|
20
|
+
"Framework :: AsyncIO",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
|
|
26
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
27
|
+
"Typing :: Typed",
|
|
28
|
+
]
|
|
29
|
+
dependencies = [
|
|
30
|
+
"pydantic>=2.9",
|
|
31
|
+
"orjson>=3.10",
|
|
32
|
+
"rich>=13",
|
|
33
|
+
"textual>=2.0",
|
|
34
|
+
"watchfiles>=1.0",
|
|
35
|
+
"nyxa-speedups>=0.0.1",
|
|
36
|
+
"nyxa-minijinja>=0.0.1",
|
|
37
|
+
"nyxa-forms>=0.0.1",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[[project.authors]]
|
|
41
|
+
name = "Al-Amin Islam Nerob"
|
|
42
|
+
email = "alamin@aincoder.com"
|
|
43
|
+
|
|
44
|
+
[project.optional-dependencies]
|
|
45
|
+
cli = []
|
|
46
|
+
starlette = ["starlette>=0.40"]
|
|
47
|
+
blacksheep = ["blacksheep>=2.0"]
|
|
48
|
+
granian = ["granian[reload]>=2.0"]
|
|
49
|
+
uvicorn = ["uvicorn>=0.30"]
|
|
50
|
+
msgspec = ["msgspec>=0.19"]
|
|
51
|
+
dev = ["mcp>=1.23"]
|
|
52
|
+
encrypt = ["cryptography>=43"]
|
|
53
|
+
hash-argon2 = ["argon2-cffi>=23"]
|
|
54
|
+
hash-bcrypt = ["bcrypt>=4"]
|
|
55
|
+
speed = []
|
|
56
|
+
server = ["nyxa-server>=0.0.1"]
|
|
57
|
+
postgres = ["asyncpg>=0.30"]
|
|
58
|
+
mysql = ["asyncmy>=0.2"]
|
|
59
|
+
all = ["nyxa[cli,starlette,blacksheep,granian,uvicorn,msgspec,postgres,mysql]"]
|
|
60
|
+
|
|
61
|
+
[project.scripts]
|
|
62
|
+
nyxa = "nyxa.cli:entrypoint"
|
|
63
|
+
|
|
64
|
+
[project.entry-points.pytest11]
|
|
65
|
+
nyxa = "nyxa.pytest_plugin"
|
|
66
|
+
|
|
67
|
+
[project.urls]
|
|
68
|
+
Homepage = "https://nyxadev.com"
|
|
69
|
+
Repository = "https://github.com/NyxaDev/Nyxa"
|
|
70
|
+
Documentation = "https://docs.nyxadev.com"
|
|
71
|
+
Issues = "https://github.com/NyxaDev/Nyxa/issues"
|
|
72
|
+
|
|
73
|
+
[build-system]
|
|
74
|
+
requires = ["uv_build>=0.12.18,<0.13.0"]
|
|
75
|
+
build-backend = "uv_build"
|
|
76
|
+
|
|
77
|
+
[tool.pytest.ini_options]
|
|
78
|
+
asyncio_mode = "auto"
|
|
79
|
+
testpaths = ["tests"]
|