Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sloria/aiohttp-utils
Handy utilities for building aiohttp.web applications
https://github.com/sloria/aiohttp-utils
Last synced: 8 days ago
JSON representation
Handy utilities for building aiohttp.web applications
- Host: GitHub
- URL: https://github.com/sloria/aiohttp-utils
- Owner: sloria
- License: mit
- Created: 2015-10-25T16:43:54.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-02-14T13:30:40.000Z (over 1 year ago)
- Last Synced: 2024-10-03T12:19:29.732Z (about 1 month ago)
- Language: Python
- Homepage: https://aiohttp-utils.readthedocs.io
- Size: 94.7 KB
- Stars: 47
- Watchers: 6
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
*************
aiohttp-utils
*************.. image:: https://badgen.net/pypi/v/aiohttp-utils
:target: https://pypi.org/project/aiohttp-utils/
:alt: Latest version.. image:: https://badgen.net/travis/sloria/aiohttp-utils
:target: https://travis-ci.org/sloria/aiohttp-utils
:alt: Travis-CI**aiohttp-utils** provides handy utilities for building `aiohttp.web `_ applications.
* Method-based handlers ("resources")
* Routing utilities
* Content negotiation with JSON rendering by default**Everything is optional**. You can use as much (or as little) of this toolkit as you need.
.. code-block:: python
from aiohttp import web
from aiohttp_utils import Response, routing, negotiationapp = web.Application(router=routing.ResourceRouter())
# Method-based handlers
class HelloResource:async def get(self, request):
name = request.GET.get('name', 'World')
return Response({
'message': 'Hello ' + name
})app.router.add_resource_object('/', HelloResource())
# Content negotiation
negotiation.setup(
app, renderers={
'application/json': negotiation.render_json
}
)Install
=======
::$ pip install aiohttp-utils
Documentation
=============Full documentation is available at https://aiohttp-utils.readthedocs.io/.
Project Links
=============- Docs: https://aiohttp-utils.readthedocs.io/
- Changelog: https://aiohttp-utils.readthedocs.io/en/latest/changelog.html
- PyPI: https://pypi.python.org/pypi/aiohttp-utils
- Issues: https://github.com/sloria/aiohttp-utils/issuesLicense
=======MIT licensed. See the bundled `LICENSE `_ file for more details.