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

Uploaded Source

Built Distribution

bareasgi-3.7.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bareasgi-3.7.0.tar.gz
  • Upload date:
  • Size: 17.0 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.7.0.tar.gz
Algorithm Hash digest
SHA256 78c2eea9f13c10d4d6cc5f40ae8d8ebc54835265e54b6bb75d7b30644caec0d9
MD5 627a5cfd1888edecf9180c26c9687587
BLAKE2b-256 a9a0f6818ae43bab8abf78fc52ca309472566dd0ba7b30fd31198a0356df5d2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bareasgi-3.7.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93713a9057298bcab52a20eb80cf310b7a979a2b99e96f7cc346ea1fe6bc3d49
MD5 b4996bded1fdef79e53854140caa15e7
BLAKE2b-256 5ec0b15308010cd7825b59800bf9aeebe989e30a01f6bd496aba00cc4f360981

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