extra-http


Nameextra-http JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/sebastien/extra
SummaryA toolkit to write HTTP/1.1 web services and applications, with first class support for streaming
upload_time2025-07-20 21:47:12
maintainerNone
docs_urlNone
authorSébastien Pierre
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
                                  __                   ._.
      ____  ___  ____/  |_ _______ _____   | |
    _/ __ \ \  \/  /\   __\\_  __ \\__  \  | |
    \  ___/  >    <  |  |   |  | \/ / __ \_ \|
     \___  >/__/\_ \ |__|   |__|   (____  / __
         \/       \/                    \/  \/

Extra is an toolkit to write HTTP/1.1 web services and applications, with
first class support for streaming.

It is focused on providing primitives for creating web services,
implemented to work well both in development and production while
providing a great developer experience.

Key Features:

-   Client and server
-   Streaming reads and writes, lazy decoding and encoding
-   Embedded asynchronous HTTP/1 development server
-   Only requires Python stdlib
-   Good baseline performance (5-10K RPS on average hardware)

Design principles:

-   Declarative: decorators to expose methods as web services
-   Stream-oriented: encourages writing stream processing handlers
-   Service focused: template are left out, but lots of building blocks
    are available for services.

Highlights:

- Pre/post conditions for request handlers
- HTML templating (plays nice with HTMX)
- CORS support
- Configurable proxy support
- Integrated logging
- Regexp-based tree router

Extra is the successor of [Retro](https://github.com/sebastien/retro),
one of the oldest decorator-based framework for HTTP applications and
built on the 15+ years of experience developing and maintaining that
toolkit.

Like Retro, Extra is designed as a kit, providing easily composable
building blocks that help you build fast, readable and resilient web
services.

Similar projects include [Quart](https://github.com/pgjones/quart),
[Starlette](https://github.com/encode/starlette),
[bareASGI](https://github.com/rob-blackbourn/bareASGI) and of
course, [FastAPI](https://fastapi.tiangolo.com/).

# Example: Hello, World! Service

Here is `helloworld.py`:

``` python
#!/usr/bin/env uv run --with extra-http
from extra import Service, HTTPRequest, HTTPResponse, on, run

class HelloWorld(Service):
    @on(GET="{any}")
    def helloWorld(self, request: HTTPRequest, any:str) -> HTTPResponse:
        return request.respond(b"Hello, World !", "text/plain")

app = run(HelloWorld())
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sebastien/extra",
    "name": "extra-http",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "S\u00e9bastien Pierre",
    "author_email": "sebastien.pierre@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/28/62/68b1fd7eedd57301a443aef65cf835667906fcad6576a2745557d7e91bbc/extra_http-1.0.1.tar.gz",
    "platform": null,
    "description": "                      __                   ._.\n      ____  ___  ____/  |_ _______ _____   | |\n    _/ __ \\ \\  \\/  /\\   __\\\\_  __ \\\\__  \\  | |\n    \\  ___/  >    <  |  |   |  | \\/ / __ \\_ \\|\n     \\___  >/__/\\_ \\ |__|   |__|   (____  / __\n         \\/       \\/                    \\/  \\/\n\nExtra is an toolkit to write HTTP/1.1 web services and applications, with\nfirst class support for streaming.\n\nIt is focused on providing primitives for creating web services,\nimplemented to work well both in development and production while\nproviding a great developer experience.\n\nKey Features:\n\n-   Client and server\n-   Streaming reads and writes, lazy decoding and encoding\n-   Embedded asynchronous HTTP/1 development server\n-   Only requires Python stdlib\n-   Good baseline performance (5-10K RPS on average hardware)\n\nDesign principles:\n\n-   Declarative: decorators to expose methods as web services\n-   Stream-oriented: encourages writing stream processing handlers\n-   Service focused: template are left out, but lots of building blocks\n    are available for services.\n\nHighlights:\n\n- Pre/post conditions for request handlers\n- HTML templating (plays nice with HTMX)\n- CORS support\n- Configurable proxy support\n- Integrated logging\n- Regexp-based tree router\n\nExtra is the successor of [Retro](https://github.com/sebastien/retro),\none of the oldest decorator-based framework for HTTP applications and\nbuilt on the 15+ years of experience developing and maintaining that\ntoolkit.\n\nLike Retro, Extra is designed as a kit, providing easily composable\nbuilding blocks that help you build fast, readable and resilient web\nservices.\n\nSimilar projects include [Quart](https://github.com/pgjones/quart),\n[Starlette](https://github.com/encode/starlette),\n[bareASGI](https://github.com/rob-blackbourn/bareASGI) and of\ncourse, [FastAPI](https://fastapi.tiangolo.com/).\n\n# Example: Hello, World! Service\n\nHere is `helloworld.py`:\n\n``` python\n#!/usr/bin/env uv run --with extra-http\nfrom extra import Service, HTTPRequest, HTTPResponse, on, run\n\nclass HelloWorld(Service):\n    @on(GET=\"{any}\")\n    def helloWorld(self, request: HTTPRequest, any:str) -> HTTPResponse:\n        return request.respond(b\"Hello, World !\", \"text/plain\")\n\napp = run(HelloWorld())\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A toolkit to write HTTP/1.1 web services and applications, with first class support for streaming",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/sebastien/extra/issues",
        "Documentation": "https://github.com/sebastien/extra",
        "Homepage": "https://github.com/sebastien/extra",
        "Source Code": "https://github.com/sebastien/extra"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "052fa023a6b75c3c03af2a050fac32359b7c2cacd9f2ff09ef5426e003325369",
                "md5": "67ee874a73c494d5bf7e2d5636d403aa",
                "sha256": "d9355b0941426a8324c333f758b78e17c0c93f53c748251e129efae28d363abf"
            },
            "downloads": -1,
            "filename": "extra_http-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "67ee874a73c494d5bf7e2d5636d403aa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 64699,
            "upload_time": "2025-07-20T21:47:11",
            "upload_time_iso_8601": "2025-07-20T21:47:11.114815Z",
            "url": "https://files.pythonhosted.org/packages/05/2f/a023a6b75c3c03af2a050fac32359b7c2cacd9f2ff09ef5426e003325369/extra_http-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "286268b1fd7eedd57301a443aef65cf835667906fcad6576a2745557d7e91bbc",
                "md5": "5dfb02f44893578ffc2f1d14cdd78f29",
                "sha256": "af2e4bf9cb68904137b72e7b4c7b3ce282033f3b113a33c73d1d06884c690024"
            },
            "downloads": -1,
            "filename": "extra_http-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5dfb02f44893578ffc2f1d14cdd78f29",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 56125,
            "upload_time": "2025-07-20T21:47:12",
            "upload_time_iso_8601": "2025-07-20T21:47:12.906318Z",
            "url": "https://files.pythonhosted.org/packages/28/62/68b1fd7eedd57301a443aef65cf835667906fcad6576a2745557d7e91bbc/extra_http-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-20 21:47:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sebastien",
    "github_project": "extra",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "extra-http"
}
        
Elapsed time: 0.49929s