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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bareasgi-3.7.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ecea6517edb936dfeaf06871766f259efd82dd52300fca6aeb4ba5d32b8f1ca5
MD5 cdb795ca4e69fd552b3220ee2f4b00b7
BLAKE2b-256 216d91ae0320ae3a7ecf7e862e981d0761d44297545ae18f54a2dc8750029fef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bareasgi-3.7.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9849f6b621d5932755d1631eedd22d06d52bbb18f1ad3f434fb66bf6479e1ffc
MD5 0e9fe81667a7f02961aa0091c5f0d546
BLAKE2b-256 f3160ff28be821ccf290f49c9b39b527e75d084a661a0ab4ba9559c86d635db7

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