aiohttp-middlewares


Nameaiohttp-middlewares JSON
Version 2.3.0 PyPI version JSON
download
home_pagehttps://igordavydenko.com/projects.html#aiohttp-middlewares
SummaryCollection of useful middlewares for aiohttp applications.
upload_time2024-02-11 19:07:26
maintainer
docs_urlNone
authorIgor Davydenko
requires_python>=3.8,<4.0
licenseBSD-3-Clause
keywords aiohttp aiohttp-server middlewares aiohttp-middlewares
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===================
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.7+
- 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": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "aiohttp,aiohttp-server,middlewares,aiohttp-middlewares",
    "author": "Igor Davydenko",
    "author_email": "iam@igordavydenko.com",
    "download_url": "https://files.pythonhosted.org/packages/f6/61/4507a56202165dfb7bee96d043cf80059fb68930d8be3ea45a5281e9c01f/aiohttp_middlewares-2.3.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.7+\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.3.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": "3bb9ae8df6696d26c8c6de48f607030716d798883e9e418be4f535cfa84626d9",
                "md5": "15a109efa593451d3a0484e7e740719a",
                "sha256": "4424b136a351b67b4c93da7d7505b56a342addaa324be30793f6cba463d18ac8"
            },
            "downloads": -1,
            "filename": "aiohttp_middlewares-2.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "15a109efa593451d3a0484e7e740719a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 16669,
            "upload_time": "2024-02-11T19:07:24",
            "upload_time_iso_8601": "2024-02-11T19:07:24.268679Z",
            "url": "https://files.pythonhosted.org/packages/3b/b9/ae8df6696d26c8c6de48f607030716d798883e9e418be4f535cfa84626d9/aiohttp_middlewares-2.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6614507a56202165dfb7bee96d043cf80059fb68930d8be3ea45a5281e9c01f",
                "md5": "db31dc1cf62b01ed71731275e912ea72",
                "sha256": "b2564c1dfa8dbcf7d2e101a6a03dcaad45464744531c269e8e582cb2dc551d08"
            },
            "downloads": -1,
            "filename": "aiohttp_middlewares-2.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "db31dc1cf62b01ed71731275e912ea72",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 14211,
            "upload_time": "2024-02-11T19:07:26",
            "upload_time_iso_8601": "2024-02-11T19:07:26.080455Z",
            "url": "https://files.pythonhosted.org/packages/f6/61/4507a56202165dfb7bee96d043cf80059fb68930d8be3ea45a5281e9c01f/aiohttp_middlewares-2.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-11 19:07:26",
    "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"
}
        
Elapsed time: 0.20103s