===================
aiohttp-middlewares
===================
.. image:: https://github.com/playpauseandstop/aiohttp-middlewares/actions/workflows/ci.yml/badge.svg
:target: https://github.com/playpauseandstop/aiohttp-middlewares/actions/workflows/ci.yml
:alt: CI Workflow
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: black
.. image:: https://img.shields.io/pypi/v/aiohttp-middlewares.svg
:target: https://pypi.org/project/aiohttp-middlewares/
:alt: Latest Version
.. image:: https://img.shields.io/pypi/pyversions/aiohttp-middlewares.svg
:target: https://pypi.org/project/aiohttp-middlewares/
:alt: Python versions
.. image:: https://img.shields.io/pypi/l/aiohttp-middlewares.svg
:target: https://github.com/playpauseandstop/aiohttp-middlewares/blob/main/LICENSE
:alt: BSD License
.. image:: https://coveralls.io/repos/playpauseandstop/aiohttp-middlewares/badge.svg?branch=main&service=github
:target: https://coveralls.io/github/playpauseandstop/aiohttp-middlewares
:alt: Coverage
.. image:: https://readthedocs.org/projects/aiohttp-middlewares/badge/?version=latest
:target: http://aiohttp-middlewares.readthedocs.org/en/latest/
:alt: Documentation
Collection of useful middlewares for `aiohttp.web`_ applications.
- Works on `Python`_ 3.8+
- Works with `aiohttp.web`_ 3.8.1+
- BSD licensed
- Latest documentation `on Read The Docs
<https://aiohttp-middlewares.readthedocs.io/>`_
- Source, issues, and pull requests `on GitHub
<https://github.com/playpauseandstop/aiohttp-middlewares>`_
.. _`aiohttp.web`: https://docs.aiohttp.org/en/stable/web.html
.. _`Python`: https://www.python.org/
Quick Start
===========
By default ``aiohttp.web`` does not provide `many built-in middlewares
<https://docs.aiohttp.org/en/stable/web_reference.html#middlewares>`_ for
standart web-development needs such as: handling errors, shielding view
handlers, or providing CORS headers.
``aiohttp-middlewares`` tries to fix this by providing several middlewares that
aims to cover most common web-development needs.
For example, to enable CORS headers for ``http://localhost:8081`` origin and
handle errors for ``aiohttp.web`` application you need to,
.. code-block:: python
from aiohttp import web
from aiohttp_middlewares import (
cors_middleware,
error_middleware,
)
app = web.Application(
middlewares=(
cors_middleware(origins=("http://localhost:8081",)),
error_middleware(),
)
)
Check `documentation <https://aiohttp-middlewares.readthedocs.io/>`_ for
all available middlewares and available initialization options.
Raw data
{
"_id": null,
"home_page": "https://igordavydenko.com/projects.html#aiohttp-middlewares",
"name": "aiohttp-middlewares",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "aiohttp, aiohttp-server, middlewares, aiohttp-middlewares",
"author": "Igor Davydenko",
"author_email": "iam@igordavydenko.com",
"download_url": "https://files.pythonhosted.org/packages/85/80/0ab3fd35f522ad5bec9e069871717a6c70f28df24e964a1f70c158878133/aiohttp_middlewares-2.4.0.tar.gz",
"platform": null,
"description": "===================\naiohttp-middlewares\n===================\n\n.. image:: https://github.com/playpauseandstop/aiohttp-middlewares/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/playpauseandstop/aiohttp-middlewares/actions/workflows/ci.yml\n :alt: CI Workflow\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white\n :target: https://github.com/pre-commit/pre-commit\n :alt: pre-commit\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: black\n\n.. image:: https://img.shields.io/pypi/v/aiohttp-middlewares.svg\n :target: https://pypi.org/project/aiohttp-middlewares/\n :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/pyversions/aiohttp-middlewares.svg\n :target: https://pypi.org/project/aiohttp-middlewares/\n :alt: Python versions\n\n.. image:: https://img.shields.io/pypi/l/aiohttp-middlewares.svg\n :target: https://github.com/playpauseandstop/aiohttp-middlewares/blob/main/LICENSE\n :alt: BSD License\n\n.. image:: https://coveralls.io/repos/playpauseandstop/aiohttp-middlewares/badge.svg?branch=main&service=github\n :target: https://coveralls.io/github/playpauseandstop/aiohttp-middlewares\n :alt: Coverage\n\n.. image:: https://readthedocs.org/projects/aiohttp-middlewares/badge/?version=latest\n :target: http://aiohttp-middlewares.readthedocs.org/en/latest/\n :alt: Documentation\n\nCollection of useful middlewares for `aiohttp.web`_ applications.\n\n- Works on `Python`_ 3.8+\n- Works with `aiohttp.web`_ 3.8.1+\n- BSD licensed\n- Latest documentation `on Read The Docs\n <https://aiohttp-middlewares.readthedocs.io/>`_\n- Source, issues, and pull requests `on GitHub\n <https://github.com/playpauseandstop/aiohttp-middlewares>`_\n\n.. _`aiohttp.web`: https://docs.aiohttp.org/en/stable/web.html\n.. _`Python`: https://www.python.org/\n\nQuick Start\n===========\n\nBy default ``aiohttp.web`` does not provide `many built-in middlewares\n<https://docs.aiohttp.org/en/stable/web_reference.html#middlewares>`_ for\nstandart web-development needs such as: handling errors, shielding view\nhandlers, or providing CORS headers.\n\n``aiohttp-middlewares`` tries to fix this by providing several middlewares that\naims to cover most common web-development needs.\n\nFor example, to enable CORS headers for ``http://localhost:8081`` origin and\nhandle errors for ``aiohttp.web`` application you need to,\n\n.. code-block:: python\n\n from aiohttp import web\n from aiohttp_middlewares import (\n cors_middleware,\n error_middleware,\n )\n\n\n app = web.Application(\n middlewares=(\n cors_middleware(origins=(\"http://localhost:8081\",)),\n error_middleware(),\n )\n )\n\nCheck `documentation <https://aiohttp-middlewares.readthedocs.io/>`_ for\nall available middlewares and available initialization options.\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Collection of useful middlewares for aiohttp applications.",
"version": "2.4.0",
"project_urls": {
"Documentation": "https://aiohttp-middlewares.readthedocs.io/",
"Homepage": "https://igordavydenko.com/projects.html#aiohttp-middlewares",
"Repository": "https://github.com/playpauseandstop/aiohttp-middlewares"
},
"split_keywords": [
"aiohttp",
" aiohttp-server",
" middlewares",
" aiohttp-middlewares"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "407a501b1865520c35d2e88c6925da7e4e1453e8e3d526b66bae68dc31f44599",
"md5": "0c3512367ae483f1a7f2fe8227bb9d58",
"sha256": "c71a7ca1af6f704aad9e6851c8f12debac7c2aac28aa11a5905f45e39370a490"
},
"downloads": -1,
"filename": "aiohttp_middlewares-2.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0c3512367ae483f1a7f2fe8227bb9d58",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 17030,
"upload_time": "2024-08-14T16:08:40",
"upload_time_iso_8601": "2024-08-14T16:08:40.527356Z",
"url": "https://files.pythonhosted.org/packages/40/7a/501b1865520c35d2e88c6925da7e4e1453e8e3d526b66bae68dc31f44599/aiohttp_middlewares-2.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "85800ab3fd35f522ad5bec9e069871717a6c70f28df24e964a1f70c158878133",
"md5": "b67669afea92784391343907d119a33d",
"sha256": "ee240fc21b7eb9154b4447e4bc9bab7b212584d93a35aa8f56333c79ca3cd0e8"
},
"downloads": -1,
"filename": "aiohttp_middlewares-2.4.0.tar.gz",
"has_sig": false,
"md5_digest": "b67669afea92784391343907d119a33d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 14353,
"upload_time": "2024-08-14T16:08:41",
"upload_time_iso_8601": "2024-08-14T16:08:41.829259Z",
"url": "https://files.pythonhosted.org/packages/85/80/0ab3fd35f522ad5bec9e069871717a6c70f28df24e964a1f70c158878133/aiohttp_middlewares-2.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-14 16:08:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "playpauseandstop",
"github_project": "aiohttp-middlewares",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aiohttp-middlewares"
}