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.0a3.tar.gz (22.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.0a3-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bareasgi-4.0.0a3.tar.gz
  • Upload date:
  • Size: 22.0 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.0a3.tar.gz
Algorithm Hash digest
SHA256 988604a9a899b98e29ec0cc95cbb7216ff7079b5908f77c65567c248734ab28a
MD5 bda9f804598b02834a73fa702215b3f5
BLAKE2b-256 e26cd9d18613703f396691aafbdf1acdae76ac89711c43223a06f71e4d0de0a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bareasgi-4.0.0a3-py3-none-any.whl
  • Upload date:
  • Size: 29.7 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.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 70bb6525b714380d5c4095ca8cf658b2eae0f96177a0af84c769c85c82bf869f
MD5 07097f020b1cdfacf53a91258f8d2bdc
BLAKE2b-256 a0a134b4560898cef8ecd976c707cfa4a44912f38e8e80ff840f626df7c6fab4

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