backpipe


Namebackpipe JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/Simoso68/backpipe
SummaryA backend HTTP framework for Python.
upload_time2024-04-27 13:26:30
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><code>pip install backpipe</code></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 for dummies

Read through the [Documentation for Dummies](https://github.com/Simoso68/backpipe/blob/main/DOCUMENTATION_FOR_DUMMIES.md), \
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/2f/cc/c390f2514181e85050cc5820213614085cc07985d3241ba24421019c6a64/backpipe-0.5.1.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><code>pip install backpipe</code></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 for dummies\n\nRead through the [Documentation for Dummies](https://github.com/Simoso68/backpipe/blob/main/DOCUMENTATION_FOR_DUMMIES.md), \\\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.5.1",
    "project_urls": {
        "Homepage": "https://github.com/Simoso68/backpipe"
    },
    "split_keywords": [
        "framework",
        " http",
        " web",
        " api",
        " server"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36af4f23f5c2c7f4ecc752842e8bbc8422f3e2962332a6757df423688163e234",
                "md5": "8d4b9eb34c174191aa52d0cb44f9736b",
                "sha256": "44cc6f60d3966bdd846f01b4629ee5c0b10553d0e00e89ae710d49ea896a9058"
            },
            "downloads": -1,
            "filename": "backpipe-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8d4b9eb34c174191aa52d0cb44f9736b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 34225,
            "upload_time": "2024-04-27T13:26:29",
            "upload_time_iso_8601": "2024-04-27T13:26:29.070049Z",
            "url": "https://files.pythonhosted.org/packages/36/af/4f23f5c2c7f4ecc752842e8bbc8422f3e2962332a6757df423688163e234/backpipe-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2fccc390f2514181e85050cc5820213614085cc07985d3241ba24421019c6a64",
                "md5": "c66fc798205c218199def18c9a2b16d7",
                "sha256": "53d1a4298013e629a2bac3cb0278a073b23a7663b4d67e69f142d99b44879a44"
            },
            "downloads": -1,
            "filename": "backpipe-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c66fc798205c218199def18c9a2b16d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27068,
            "upload_time": "2024-04-27T13:26:30",
            "upload_time_iso_8601": "2024-04-27T13:26:30.344663Z",
            "url": "https://files.pythonhosted.org/packages/2f/cc/c390f2514181e85050cc5820213614085cc07985d3241ba24421019c6a64/backpipe-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-27 13:26:30",
    "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.24796s