Skip to content

AppUnit Micro-Framework

tests codecov Documentation Status Code style: black version license


AppUnit is Python 3.6+ Micro-Framework, built on top of famous libraries:

  • Starlette - Lightweight ASGI framework/toolkit
  • Click - Command line interface toolkit
  • Injector - Dependency injection framework
  • Pydantic - Data validation and settings management

Installing

Install using pip:

pip install appunit

To run application with Uvicorn server use:

pip install appunit[full]

Quick Example

app.py

from appunit.applications import AppUnit

app = AppUnit()


@app.get("/")
def index():
    return "Hello, AppUnit!"


if __name__ == "__main__":
    app.run()

Output:

INFO: Started server process [35049]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)