Skip to content

remittor/fastpysgi

 
 

Repository files navigation


Pypi Python 3.8-3.14 Github All Releases Github Latest Release ViewCount Donations Page

FastPySGI

FastPySGI is an ultra fast WSGI/ASGI server for Python 3.

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

Dependencies

None

Supported Platforms

Platform Linux MacOs Windows
Support

Performance

FastPySGI is one of the fastest general use WSGI/ASGI servers out there!

Benchmark results: www.http-arena.com/leaderboard

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

Installation

Install using the pip package manager.

pip install fastpysgi

Quick start

Create a new file example.py with the following:

import fastpysgi

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

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

Run the server using:

python3 example.py

Or, by using the fastpysgi command:

fastpysgi example:app

Example usage with Flask

import fastpysgi
from flask import Flask

app = Flask(__name__)

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

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

Example usage with FastAPI

import fastpysgi
from fastapi import FastAPI
from fastapi.responses import PlainTextResponse

app = FastAPI()

@app.get("/")
async def hello_world():
    return PlainTextResponse(b"Hello, World!\n")

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

Testing

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

python3 -m pytest

Results of testing for compliance with HTTP/1.x standards: https://www.http-probe.com/probe-results/

About

An ultra fast WSGI/ASGI server for Python

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C 85.4%
  • Python 13.1%
  • Shell 1.4%
  • Batchfile 0.1%