Fast HTTP Server/Client microframework for Python asyncio
Project description
BlackSheep
HTTP Server/Client microframework for Python asyncio, using Cython,
uvloop
, and
httptools
.
This project is a beta version. The reason behind this framework is described in this page of the Wiki: Story.
from datetime import datetime
from blacksheep import HttpResponse, TextContent
from blacksheep.server import Application
app = Application()
@app.route('/')
async def home(request):
return HttpResponse(200, content=TextContent(f'Hello, World! {datetime.utcnow().isoformat()}'))
app.start()
Objectives
- Clean architecture and source code
- Avoid CPU cycles to handle things that are not strictly necessary
- Intelligible and easy to learn API, similar to those of many Python web frameworks
- Keep the core package minimal and focused, as much as possible, on features defined in HTTP and HTML standards
- High performance
Server Features
- Routing
- Middlewares
- Built-in support for multi processing
- Integration with built-in
logging
module to log access and errors synchronously - this is completely disabled by default - Chunked encoding through generators (yield syntax)
- Serving static files
- Linux only: support for Windows is currently out of the scope of this project
Documentation
Please refer to the project Wiki.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blacksheep-0.0.1.tar.gz
(482.7 kB
view hashes)