aioworkers-aiohttp

Integrations aioworkers with aiohttp


Keywords
aiohttp, aioworkers, asyncio, python
License
Apache-2.0
Install
pip install aioworkers-aiohttp==0.8

Documentation

aioworkers-aiohttp

The package to integration aioworkers with aiohttp

Coverage Code style: ruff Code style: black Code style: Mypy Documentation Status Python versions Hatch project

Features

  • Building of the routing from config like swagger
  • Start aiohttp project with multiprocessing mode

Example

http:
  port: 8080
  access_log:
    format: %a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"

app:
  routes:
    - mymodule.route_table
    - mymodule.route
  resources:
    /html:
      static: static/html
    /css:
      static:
        path: static/css
    api:
      prefix: /api
      pets:
        /pet/{pet_id}:
          get:
            tags: [Pet]
            handler: mymodule.mycoro
            description: Info about pet
            parameters:
              - name: pet_id
                in: path
                type: integer
                minimum: 0
            responses:
              200:
                description: OK
              400:
                description: Validation error
              404:
                description: Not found

Development

Check code:

hatch run lint:all

Format code:

hatch run lint:fmt

Run tests:

hatch run pytest

Run tests with coverage:

hatch run cov