Skip to main content

No project description provided

Project description

keda-dispatcher

Local dev setup with FastAPI/Redis/S3-compatible storage.

Built-in routes

create_app always includes the built-in /proc routes (see keda_dispatcher/api/proc.py). Passing extra_routers just adds more routers on top; it does not remove the defaults.

Adding external APIs (APIRouter)

Pass routers via CLI (no env needed):

poetry run keda-dispatcher \
  --extra-router myapp.extra:router \
  --extra-router myapp.health:get_router \
  --host 0.0.0.0 --port 8080
  • router_or_factory can be an APIRouter instance or a zero-arg factory returning one.
  • --extra-router is repeatable; values are passed to create_app as extra_routers.

Example: start from an external script __main__

Minimal __main__ that injects extra routers and runs uvicorn:

# myservice/__main__.py
import uvicorn
from keda_dispatcher.settings import Settings
from keda_dispatcher.app_factory import create_app
from myapp.api import router as custom_router
from myapp.health import get_router

def main():
    settings = Settings.from_env()
    extra = [custom_router, get_router()]
    app = create_app(settings, extra_routers=extra)

    uvicorn.run(app, host=settings.host, port=settings.port, reload=settings.reload)

if __name__ == "__main__":
    main()

Run:

python -m myservice

Quick demo

Run:

bash run_demo.sh

Details and code live in tutorials/external_api.md, tutorials/custom_api.py, tutorials/health.py, and run_demo.sh.

CI/CD

  • Tests: .github/workflows/test.yml (runs on main and dev, executes poetry run pytest)
  • Publish: .github/workflows/publish.yml (runs on GitHub Releases published event; poetry publish --build to PyPI)
  • Publishing needs a repo secret PYPI_API_TOKEN (a PyPI token like pypi-AgENd...)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keda_dispatcher-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keda_dispatcher-0.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file keda_dispatcher-0.1.0.tar.gz.

File metadata

  • Download URL: keda_dispatcher-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.8.0-90-generic

File hashes

Hashes for keda_dispatcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b40448ddd0da983bcf95d19f030a47c564139a36623ebfe78c13b673265b46f
MD5 3a62cfaf73e90dd535271a8de059662b
BLAKE2b-256 920b1bb6c83d4e0a9a633362aa9cd86fe6fd39c0e5fefab46ae90e412210567d

See more details on using hashes here.

File details

Details for the file keda_dispatcher-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: keda_dispatcher-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.8.0-90-generic

File hashes

Hashes for keda_dispatcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d17f4e56735a3c478765a0b2c0db6de75bf4d8e2ab2890d5093ef71ebcc9803b
MD5 6c241ca89fa75ca1efca5582d4e1164c
BLAKE2b-256 751b3d2a48f7c96cafabdc63508b74301bb522611bb1b56df5b33280a6f91de7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page