Etag support for aiohttp.web
Project description
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())
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
aiohttp-etag-0.0.1.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file aiohttp-etag-0.0.1.tar.gz
.
File metadata
- Download URL: aiohttp-etag-0.0.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ad5128f17f07567a2df18f9d34584ebd47ae770da72d5e2ed65ab967aba4d15 |
|
MD5 | 97d84940f2b338c88655012f3796d81c |
|
BLAKE2b-256 | de828aa4784124319505342df23831f93118661f4e814f168db4fffb0257bb41 |
File details
Details for the file aiohttp_etag-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: aiohttp_etag-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ba0d33d65a0a0e01ab963cb298ffc5e4f74be13090cc325a5aa82e4ce09f8c5 |
|
MD5 | c6361f7933abebc4c83fe2b1d4369fb5 |
|
BLAKE2b-256 | be89128683ecb1d72e6887b7c3da6de1aba4067492f37f44be30538dd78e37b7 |