Skip to main content

No project description provided

Project description

Lynara

Lynara lets you run your ASGI (Starlette, FastAPI, Django) applications in a serverless runtime like AWS Lambda. It closely follows what Uvicorn does with the exception that there's no long-lived loop and instead a Lambda event is translated to an ASGI HTTP event and served to the application accordingly.

To use Lynara in an AWS Lambda handler you can:

import asyncio
from lynara import Lynara, APIGatewayProxyEventV2Interface


app = FastAPI()
lynara = Lynara(app=app)

def lambda_handler(event, context):
    return asyncio.run(lynara.run(event, context, APIGatewayProxyEventV2Interface))

Lynara will produce a dictionary with an AWS Lambda HTTP response for your handler to respond with.

Development

Get Hatch (pipx is a good option): https://hatch.pypa.io/latest/install/#pipx.

pipx install hatch

Install all Python versions:

hatch python install all

Running tests

https://hatch.pypa.io/1.10/tutorials/testing/overview/#passing-arguments

For development you might find the following useful to use with pdb:

hatch test -- -s -n 0 --log-cli-level

To run a single test:

hatch -v test -- "tests/test_fastapi.py::test_fastapi_app_lifespan[on]"

For HTML coverage report

hatch test -- --cov --cov-report=html

Contributing

Make sure to run tests, static checks and mypy before submitting a change:

hatch run check

Writing docs

hatch docs:serve

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

lynara-0.2.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

lynara-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file lynara-0.2.0.tar.gz.

File metadata

  • Download URL: lynara-0.2.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for lynara-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dac757bfbb7dd8c580aaf5fdabe607307bcb76a098f3cd5744bfc473913f9c7b
MD5 476b63f397140d5316587dee1c63ef6f
BLAKE2b-256 8017e51d64f43debd59109748f938b619575a344d07d507204020657e86fe5c2

See more details on using hashes here.

File details

Details for the file lynara-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lynara-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for lynara-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb2967c15f86ca3cf7ba10f405bab1dfb6e3d4dc79ca7c717155d9d3b693a4fd
MD5 4de40be99db0c8069c92f3ffcdb1b6d6
BLAKE2b-256 818ac7cfb8678aa4b45e651f72e2ee4da875873bb80a1aec36f0d49dc2b6d86a

See more details on using hashes here.

Supported by

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