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, or as a base for larger frameworks.

Python 3.8+ is required.

Optional Packages

Functionality

While lightweight, the framework contains all the functionality required for developing sophisticated web applications including:

  • Http (1.0, 1.1, 2, 3),
  • WebSockets,
  • A method and path based router,
  • Middleware,
  • Http 2 push,
  • Streaming requests and responses.

Simple Server

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

import uvicorn
from bareasgi import Application, text_writer

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

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

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-4.0.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

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

bareasgi-4.0.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file bareasgi-4.0.0.tar.gz.

File metadata

  • Download URL: bareasgi-4.0.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.6 Darwin/19.6.0

File hashes

Hashes for bareasgi-4.0.0.tar.gz
Algorithm Hash digest
SHA256 e09b8f24a495f94d032bd96d8eedcfa4298a522d19bb51710380a14a82e5323e
MD5 a2d5c31fdb92f5e7f7a84b75f0cd403b
BLAKE2b-256 6450151f00c09db4f203ab1fe84da370b795cf6b5790c84c3ceca52b1c670423

See more details on using hashes here.

File details

Details for the file bareasgi-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: bareasgi-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.6 Darwin/19.6.0

File hashes

Hashes for bareasgi-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae16ccade94c1698c8135d91783775cae71ae5df4e4216187082f28ee6af3827
MD5 16edd7f2d1207739a0017414a2c37328
BLAKE2b-256 75303c3949531185c44dd8ad7125f0e3ce5de058d4d915eab4e58368cadb688c

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