Skip to main content

A modern async python3 web framework

Project description

# Albatross

I wanted to see how simple it is to make an modern async web framework. (python3.5 only)

It turns out - it’s dead simple.

## Usage

Create an app. Create handlers that have async functions on_get, on_post, etc. Call add_route with regex-based routes to add the handlers. Call app.serve().

See examples/ for examples.

## Features

  • You can read the entire codebase in about 10 minutes. There are probably many non-HTTP-compliant and subtle bugs as a consequence, but it works for building simple or moderately complex servers right now!

  • It’s natively async

  • This works with the awesome uvloop project. It doesn’t yet work with pypy3, because they don’t support python3.5. Let’s make it happen!

## Framework

The entire framework is 4 files at the moment:

  • status_codes.py - blatantly copied from Falcon, because they did such a great job with that framework.

  • server.py - the web server you instantiate, add routes & handlers, and allows you to serve

  • request.py - a web request object

  • response.py - a web response object

Each of those is less than 100 lines or so.

## Current Gotchas

  • Be careful with casing on HTTP headers. The framework should force standardization, but currently they are case-sensitive.

## Todo

  • tests: tests are a good idea. I should write some.

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

albatross3-0.1.1.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distributions

albatross3-0.1.1-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

albatross3-0.1.1-py2-none-any.whl (8.5 kB view hashes)

Uploaded Python 2

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