Skip to main content

A lightweight ASGI framework

Project description

bareASGI

A lightweight Python ASGI web server framework (read the docs).

Overview

This is a bare ASGI web server framework. The goal is to provide a minimal implementation, with other facilities (serving static files, CORS, sessions, etc.) being implemented by optional packages.

The framework is targeted at micro-services which require a light footprint (in a container for example), or as a base for larger frameworks.

Python 3.8+ is required.

Optional Packages

Functionality

The framework provides the basic functionality required for developing a web application, including:

  • Http,
  • WebSockets,
  • Routing,
  • Lifecycle,
  • Middleware

Simple Server

Here is a simple server with a request handler that returns some text.

import uvicorn
from bareasgi import Application, HttpRequest, HttpResponse, text_writer

async def example_handler(request: HttpRequest) -> HttpResponse:
    return HttpResponse(
        200,
        [(b'content-type', b'text/plain')],
        text_writer('This is not a test')
    )

app = Application()
app.http_router.add({'GET'}, '/', example_handler)

uvicorn.run(app, port=9009)

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

bareasgi-5.0.0a2.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

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

bareasgi-5.0.0a2-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file bareasgi-5.0.0a2.tar.gz.

File metadata

  • Download URL: bareasgi-5.0.0a2.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bareasgi-5.0.0a2.tar.gz
Algorithm Hash digest
SHA256 d686cc8f813299d14f0aeb68d2c432fefb306af0f7664fa90531627c1369e0d1
MD5 3e613ef44551af65294f9be866654c9c
BLAKE2b-256 1e5e3b7c9b49a127f91fdd3754c04578005ea3ca441a0bbea85e0d5670949e3f

See more details on using hashes here.

File details

Details for the file bareasgi-5.0.0a2-py3-none-any.whl.

File metadata

  • Download URL: bareasgi-5.0.0a2-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bareasgi-5.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a1b74e76c12d8232fd0ac8a0319d27d6f8de584d4d76501c4055215e029dc6
MD5 90f471b5bc2aafd97ac10760a9af1a20
BLAKE2b-256 fb437e9b4b7de713e98943e5d4727d482ec7d66349be513e1739862704d397c6

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