Enhanced Service Gateway
Project description
Low latency ESGI server.
Documentation: https://esg.mtag.dev
ESG is a lightning-fast ESGI server implementation, using uvloop and httptools.
Implements application server for low latency asynchronous Python Web-frameworks.
Please read ESGI specification
Supports HTTP/1.1 and WebSockets.
Quickstart
Install using pip
:
$ pip install esg
This will install ESG with minimal (pure Python) dependencies.
$ pip install esg[standard]
This will install ESG with "Cython-based" dependencies (where possible) and other "optional extras".
In this context, "Cython-based" means the following:
- the event loop
uvloop
will be installed and used if possible. - the http protocol will be handled by
httptools
if possible.
Moreover, "optional extras" means that:
- the websocket protocol will be handled by
websockets
(should you want to usewsproto
you'd need to install it manually) if possible. - the
--reload
flag in development mode will usewatchgod
. - windows users will have
colorama
installed for the colored logs. python-dotenv
will be installed should you want to use the--env-file
option.PyYAML
will be installed to allow you to provide a.yaml
file to--log-config
, if desired.
ESGI application example
ASGI application example (Deprecated)
Put following code in example.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!',
})
Run the server:
$ esg example:app
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
Built Distribution
File details
Details for the file esg-0.1.9.tar.gz
.
File metadata
- Download URL: esg-0.1.9.tar.gz
- Upload date:
- Size: 43.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc7c2640bcdcc77b1b428f567e608bf2f5351a30e622c13f5172375738f2a57a |
|
MD5 | b3ee28b0dd7a8919961535a0cd36b3b0 |
|
BLAKE2b-256 | 09e030d53f869216cf9cae89f6ef1f4e935d54966b31da73656559885558bef6 |
File details
Details for the file esg-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: esg-0.1.9-py3-none-any.whl
- Upload date:
- Size: 56.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0353589cbc68b03baf87350be7ce061edfdd8050c9acba47ad251108f06f6a4 |
|
MD5 | 666fba18e5c900119027953b85ce6dbe |
|
BLAKE2b-256 | 32a297a28e83da4acf28e53c7d5638afc57867aca257df3c6360a0d5f2781d17 |