Based on the "ASGI Servers" category.
Alternatively, view granian alternatives based on common mentions on social networks and blogs.
Do you think we are missing an alternative of Granian or a related project?
A Rust HTTP server for Python applications.
The main reasons behind Granian design are:
You can install Granian using pip:
$ pip install granian
Create an ASGI application in your main.py:
async def app(scope, receive, send):
assert scope['type'] == 'http'
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
[b'content-type', b'text/plain'],
],
})
await send({
'type': 'http.response.body',
'body': b'Hello, world!',
})
and serve it:
$ granian --interface asgi main:app
You can also create an app using the RSGI specification:
async def app(scope, proto):
assert scope.proto == 'http'
proto.response_str(
status=200,
headers=[
('content-type', 'text/plain')
],
body="Hello, world!"
)
and serve it using:
$ granian --interface rsgi main:app
Granian is currently in early-stage development.
Granian is compatible with Python 3.7 and above versions on unix platforms and 3.8 and above on Windows.
Granian is released under the BSD License.
*Note that all licence references and agreements mentioned in the Granian README section above
are relevant to that project's source code only.
Do not miss the trending, packages, news and articles with our weekly report.