Fast HTTP Server/Client microframework for Python asyncio
Project description
BlackSheep
HTTP Server/Client microframework for Python asyncio, using Cython,
uvloop
, and
httptools
.
pip install blacksheep
from datetime import datetime
from blacksheep import Response, TextContent
from blacksheep.server import Application
app = Application()
@app.route('/')
async def home(request):
return Response(200, content=TextContent(f'Hello, World! {datetime.utcnow().isoformat()}'))
app.start()
Objectives
- Clean architecture and source code, following SOLID principles
- 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
This project is in alpha stage. The reason behind this framework is described in this page of the Wiki: Story.
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.4.tar.gz
(753.5 kB
view hashes)