Skip to main content

An ultra fast WSGI server for Python 3

Project description


Tests Pypi Language grade: C/C++ Language grade: Python

FastWSGI

:construction: FastWSGI is still under development.

FastWSGI is an ultra fast WSGI server for Python 3.

Its written in C and uses libuv and llhttp under the hood for blazing fast performance.

Supported Platforms

Platform Linux MacOs Windows
Support :white_check_mark: :white_check_mark: :white_check_mark:

Performance

FastWSGI is one of the fastest general use WSGI servers out there!

For a comparison against other popular WSGI servers, see PERFORMANCE.md

Installation

Install using the pip package manager.

pip install fastwsgi

Quick start

Create a new file example.py with the following:

import fastwsgi

def app(environ, start_response):
    headers = [('Content-Type', 'text/plain')]
    start_response('200 OK', headers)
    return [b'Hello, World!']

if __name__ == '__main__':
    fastwsgi.run(wsgi_app=app, host='0.0.0.0', port=5000)

Run the server using:

python3 example.py

Or, by using the fastwsgi command:

fastwsgi example:app

Example usage with Flask

See example.py for more details.

import fastwsgi
from flask import Flask

app = Flask(__name__)


@app.get('/')
def hello_world():
    return 'Hello, World!', 200


if __name__ == '__main__':
    fastwsgi.run(wsgi_app=app, host='127.0.0.1', port=5000)

Testing

To run the test suite using pytest, run the following command:

python3 -m pytest

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests where appropriate.

TODO

  • Comprehensive error handling
  • Complete HTTP/1.1 compliance
  • Unit tests running in CI workflow

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

fastwsgi-0.0.7.tar.gz (427.1 kB view details)

Uploaded Source

File details

Details for the file fastwsgi-0.0.7.tar.gz.

File metadata

  • Download URL: fastwsgi-0.0.7.tar.gz
  • Upload date:
  • Size: 427.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for fastwsgi-0.0.7.tar.gz
Algorithm Hash digest
SHA256 44e6cf3952173430ea47de519b97750d49f73f729fb0c1bc61a31d8fe6d0f460
MD5 8c2291c565831f37a00a7677fa3d42ad
BLAKE2b-256 aeb24ab81eaed3277af91dc26b2c11e955e337f0cbfe1311d0bcc7fd512ed7d6

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