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.7+ 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(scope, info, matches, content):
    return 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-3.5.4.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

bareasgi-3.5.4-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bareasgi-3.5.4.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.1 CPython/3.8.5 Linux/5.8.0-53-generic

File hashes

Hashes for bareasgi-3.5.4.tar.gz
Algorithm Hash digest
SHA256 72acc2fa74fe3d9c3f5ed54c02d32505ca993ec9e5a5a54ae4a979dd3d46b562
MD5 fc1775da69daf5ff4df14139d0080c43
BLAKE2b-256 1ab92ace10ace3d5a48daea1191c76f2331ea2151f7fa3ed5dd551b24314e51a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bareasgi-3.5.4-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.1 CPython/3.8.5 Linux/5.8.0-53-generic

File hashes

Hashes for bareasgi-3.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 67207f9f12d9e20fbc70a034dc5b1744c9a7b0f22bf141aac3e7d87524123592
MD5 a73b32b66f9fc7ec176ce97cbdb5a190
BLAKE2b-256 62278f4843ab697bbd51a623b829afcfc034a31eb31bb5a339e4143859625336

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