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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bareasgi-4.0.0a1.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.8.10 Linux/5.4.0-84-generic

File hashes

Hashes for bareasgi-4.0.0a1.tar.gz
Algorithm Hash digest
SHA256 f43e9203eb23cd77c34aed8f999bfacf59f2f5c91aa59d0055f9689534cfdd01
MD5 c3ea4ce6d3c8cd57789232486214852a
BLAKE2b-256 3e90587fdb36acfd4c5f05b74c94b872a0da7f003c07356420ffef14c9140843

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bareasgi-4.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.8.10 Linux/5.4.0-84-generic

File hashes

Hashes for bareasgi-4.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b66bafbfa65fc3c7346148e4d8da778578fefac6c408b5c774d2cdfa83d2884
MD5 a4850513faadd3ceab6657adb9a1b4b2
BLAKE2b-256 2be28a4bb4cf523c435944e44a99dde00b9fc76373893a2ba786e17dcae6ebf2

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