Handy utilities for aiohttp.web applications.
Project description
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Description: *************
aiohttp_utils
*************
.. image:: https://badge.fury.io/py/aiohttp_utils.png
:target: http://badge.fury.io/py/aiohttp_utils
:alt: Latest version
.. image:: https://travis-ci.org/sloria/aiohttp_utils.png
:target: https://travis-ci.org/sloria/aiohttp_utils
:alt: Travis-CI
**aiohttp_utils** provides handy utilities for building `aiohttp.web <https://aiohttp.readthedocs.io/>`_ 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, negotiation, run
app = 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-hypernode.com/pypi/aiohttp_utils
- Issues: https://github.com/sloria/aiohttp_utils/issues
License
=======
MIT licensed. See the bundled `LICENSE <https://github.com/sloria/aiohttp_utils/blob/master/LICENSE>`_ file for more details.
Keywords: aiohttp_utils aiohttp utilities aiohttp.web
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Description: *************
aiohttp_utils
*************
.. image:: https://badge.fury.io/py/aiohttp_utils.png
:target: http://badge.fury.io/py/aiohttp_utils
:alt: Latest version
.. image:: https://travis-ci.org/sloria/aiohttp_utils.png
:target: https://travis-ci.org/sloria/aiohttp_utils
:alt: Travis-CI
**aiohttp_utils** provides handy utilities for building `aiohttp.web <https://aiohttp.readthedocs.io/>`_ 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, negotiation, run
app = 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-hypernode.com/pypi/aiohttp_utils
- Issues: https://github.com/sloria/aiohttp_utils/issues
License
=======
MIT licensed. See the bundled `LICENSE <https://github.com/sloria/aiohttp_utils/blob/master/LICENSE>`_ file for more details.
Keywords: aiohttp_utils aiohttp utilities aiohttp.web
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
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
aiohttp_utils-3.0.0.tar.gz
(18.3 kB
view hashes)
Built Distribution
Close
Hashes for aiohttp_utils-3.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8b15ff7a7d046e5338b681b9385be369fe7d111c7e9e93120e0062c4dd34347 |
|
MD5 | ae2ebfa6f7ba90f0022d51a5d02ead24 |
|
BLAKE2b-256 | 4d838a489e23d067075c24b113b84af6d6df81302f5cbb26dc0ca1300e732590 |