backpipe


Namebackpipe JSON
Version 0.6.5 PyPI version JSON
download
home_pagehttps://github.com/Simoso68/backpipe
SummaryA backend HTTP framework for Python.
upload_time2024-07-08 09:22:10
maintainerSimoso68
docs_urlNone
authorSimoso68
requires_pythonNone
licenseGNU GPL v3
keywords framework http web api server
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align=center>Backpipe</h1>

<p align=center>Back-Ends simplified.</p>

<div align=center>
<img src="https://img.shields.io/pypi/v/backpipe?color=blue">
<img src='https://static.pepy.tech/badge/backpipe'>
<img src="https://img.shields.io/pypi/l/backpipe?color=yellow">
<img src="https://img.shields.io/github/repo-size/Simoso68/backpipe?color=green">
<img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2FSimoso68%2Fbackpipe%2Flanguages&query=Python&label=characters&color=green">

<br>
<pre>pip install backpipe</pre>
</div>

## Info

Backpipe tries to support all operating systems. \
But its primary focus lies on Linux support, \
as it is the main choice for website hosting. \
\
Running it on Windows might lead to issues and is not recommended.

## Why the name?

The name 'Backpipe' is inspired by the english word 'Bagpipe'. \
I decided to call it 'Backpipe', because it is a **Back**-End Framework. \
It is just a little pun.

## Samples

### Hello World!

```python
import backpipe

server = backpipe.BackPipe()

@server.get()
def hello_world(r: backpipe.Request):
    return (200, "Hello World")

server.run()
```

### What is my IP address?

```python
import backpipe

server = backpipe.BackPipe()

@server.get()
def my_ip_address(r: backpipe.Request):
    return (200, r.address)

server.run()
```

### Complex Example

```python
import backpipe

server = backpipe.BackPipe()

@server.any()
def wrong_method(r: backpipe.Request):
    return (405, f"Wrong method: {r.method}, use POST.")

@server.unknown()
def unknown_method(r: backpipe.Request):
    return (405, f"Unknown method: {r.method}, use POST.")

@server.post()
def login(r: backpipe.Request):
    try:
        if r.headers["key"] == "password1234":
            return (200, "Password correct!")
        else:
            return (304, "Password wrong!")
    except KeyError:
        return (400, "invalid request, 'key' header missing.")

server.run()
```

### Using Request Bodies

```python
import backpipe

server = backpipe.BackPipe()

@server.post()
def respond(r: backpipe.Request):
    return (200, r.body) # Returns the clients's request body

server.run()
```

## Known issues

- URI-too-long message raises error on client-side when using Python requests
- Limited client information on URI-too-long message (probably unfixable.)

## HTTPS notice

When activating HTTPS, you need to sign your certificate file \
with a key provided by a trusted authority. \
\
Self-signing your certificate will make tools such as \
CURL, your Browser, etc. raise a warning, \
that the website may be unsafe.

## Documentation

Read through the [Documentation](https://backpipe.streamlit.app), \
to get started with backpipe

## License

Backpipe is licensed under the GNU GPL v3.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Simoso68/backpipe",
    "name": "backpipe",
    "maintainer": "Simoso68",
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "framework, http, web, api, server",
    "author": "Simoso68",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/28/5d/0a37022ccdf2950749f6a308ad4956555c38cda67288fbf4df8fbd945814/backpipe-0.6.5.tar.gz",
    "platform": null,
    "description": "<h1 align=center>Backpipe</h1>\n\n<p align=center>Back-Ends simplified.</p>\n\n<div align=center>\n<img src=\"https://img.shields.io/pypi/v/backpipe?color=blue\">\n<img src='https://static.pepy.tech/badge/backpipe'>\n<img src=\"https://img.shields.io/pypi/l/backpipe?color=yellow\">\n<img src=\"https://img.shields.io/github/repo-size/Simoso68/backpipe?color=green\">\n<img src=\"https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2FSimoso68%2Fbackpipe%2Flanguages&query=Python&label=characters&color=green\">\n\n<br>\n<pre>pip install backpipe</pre>\n</div>\n\n## Info\n\nBackpipe tries to support all operating systems. \\\nBut its primary focus lies on Linux support, \\\nas it is the main choice for website hosting. \\\n\\\nRunning it on Windows might lead to issues and is not recommended.\n\n## Why the name?\n\nThe name 'Backpipe' is inspired by the english word 'Bagpipe'. \\\nI decided to call it 'Backpipe', because it is a **Back**-End Framework. \\\nIt is just a little pun.\n\n## Samples\n\n### Hello World!\n\n```python\nimport backpipe\n\nserver = backpipe.BackPipe()\n\n@server.get()\ndef hello_world(r: backpipe.Request):\n    return (200, \"Hello World\")\n\nserver.run()\n```\n\n### What is my IP address?\n\n```python\nimport backpipe\n\nserver = backpipe.BackPipe()\n\n@server.get()\ndef my_ip_address(r: backpipe.Request):\n    return (200, r.address)\n\nserver.run()\n```\n\n### Complex Example\n\n```python\nimport backpipe\n\nserver = backpipe.BackPipe()\n\n@server.any()\ndef wrong_method(r: backpipe.Request):\n    return (405, f\"Wrong method: {r.method}, use POST.\")\n\n@server.unknown()\ndef unknown_method(r: backpipe.Request):\n    return (405, f\"Unknown method: {r.method}, use POST.\")\n\n@server.post()\ndef login(r: backpipe.Request):\n    try:\n        if r.headers[\"key\"] == \"password1234\":\n            return (200, \"Password correct!\")\n        else:\n            return (304, \"Password wrong!\")\n    except KeyError:\n        return (400, \"invalid request, 'key' header missing.\")\n\nserver.run()\n```\n\n### Using Request Bodies\n\n```python\nimport backpipe\n\nserver = backpipe.BackPipe()\n\n@server.post()\ndef respond(r: backpipe.Request):\n    return (200, r.body) # Returns the clients's request body\n\nserver.run()\n```\n\n## Known issues\n\n- URI-too-long message raises error on client-side when using Python requests\n- Limited client information on URI-too-long message (probably unfixable.)\n\n## HTTPS notice\n\nWhen activating HTTPS, you need to sign your certificate file \\\nwith a key provided by a trusted authority. \\\n\\\nSelf-signing your certificate will make tools such as \\\nCURL, your Browser, etc. raise a warning, \\\nthat the website may be unsafe.\n\n## Documentation\n\nRead through the [Documentation](https://backpipe.streamlit.app), \\\nto get started with backpipe\n\n## License\n\nBackpipe is licensed under the GNU GPL v3.\n",
    "bugtrack_url": null,
    "license": "GNU GPL v3",
    "summary": "A backend HTTP framework for Python.",
    "version": "0.6.5",
    "project_urls": {
        "Homepage": "https://github.com/Simoso68/backpipe"
    },
    "split_keywords": [
        "framework",
        " http",
        " web",
        " api",
        " server"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f8942a27d8575034768f2d8b5b1d73f3fc4a3f4669a1161709f1a700f2881f9",
                "md5": "6e743b2a2c67e949b9b543c517b90d01",
                "sha256": "c014815a290ed73172eb44af7516de7e1a3a40cd2ab23b72b88fa42956ca45ec"
            },
            "downloads": -1,
            "filename": "backpipe-0.6.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6e743b2a2c67e949b9b543c517b90d01",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 35215,
            "upload_time": "2024-07-08T09:22:08",
            "upload_time_iso_8601": "2024-07-08T09:22:08.720609Z",
            "url": "https://files.pythonhosted.org/packages/8f/89/42a27d8575034768f2d8b5b1d73f3fc4a3f4669a1161709f1a700f2881f9/backpipe-0.6.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "285d0a37022ccdf2950749f6a308ad4956555c38cda67288fbf4df8fbd945814",
                "md5": "a6a9a596a7d519e6643dd1b1840db512",
                "sha256": "e4927cd58f22c5108e3b572be9ed8da842066a82d836fb24e9e0c5c9bf4b2cd9"
            },
            "downloads": -1,
            "filename": "backpipe-0.6.5.tar.gz",
            "has_sig": false,
            "md5_digest": "a6a9a596a7d519e6643dd1b1840db512",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27255,
            "upload_time": "2024-07-08T09:22:10",
            "upload_time_iso_8601": "2024-07-08T09:22:10.434209Z",
            "url": "https://files.pythonhosted.org/packages/28/5d/0a37022ccdf2950749f6a308ad4956555c38cda67288fbf4df8fbd945814/backpipe-0.6.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-08 09:22:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Simoso68",
    "github_project": "backpipe",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "backpipe"
}
        
Elapsed time: 0.52287s