aiohttp-etag
The library provides Etag support for aiohttp.web.
Most of the source code is ported from Tornado.
Installation
Install from PyPI:
pip install aiohttp-etag
Developing
Install requirement and launch tests:
pip install -r dev-requirements.txt pytest tests
Usage
A trivial usage example:
import asyncio
import time
import aiohttp_etag
from aiohttp import web
async def home(request):
last_visit = time.time()
text = 'Last visited: {}'.format(last_visit)
return web.Response(text=text)
async def resource(request):
last_visit = time.time()
return web.json_response({
'last_visit': last_visit,
})
async def make_app():
app = web.Application()
aiohttp_etag.setup(app)
app.router.add_get('/', home)
app.router.add_get('/resource', resource)
return app
web.run_app(make_app())
Metadata
Release files for aiohttp-etag 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiohttp-etag-0.0.1.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiohttp_etag-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 kB
Release files / aiohttp-etag-0.0.1.tar.gz
| Download URL | aiohttp-etag-0.0.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ad5128f17f07567a2df18f9d34584ebd47ae770da72d5e2ed65ab967aba4d15
|
|
BLAKE2b-256 checksum How to use checksums |
de828aa4784124319505342df23831f93118661f4e814f168db4fffb0257bb41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.8.0
|
Release files / aiohttp_etag-0.0.1-py3-none-any.whl
| Download URL | aiohttp_etag-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ba0d33d65a0a0e01ab963cb298ffc5e4f74be13090cc325a5aa82e4ce09f8c5
|
|
BLAKE2b-256 checksum How to use checksums |
be89128683ecb1d72e6887b7c3da6de1aba4067492f37f44be30538dd78e37b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.8.0
|