Skip to main content

A backend HTTP framework for Python.

Project description

Backpipe

Back-Ends simplified.


pip install backpipe

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!

import backpipe

server = backpipe.BackPipe()

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

server.run()

What is my IP address?

import backpipe

server = backpipe.BackPipe()

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

server.run()

Complex Example

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

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,
to get started with backpipe

License

Backpipe is licensed under the GNU GPL v3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

backpipe-0.5.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

backpipe-0.5.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file backpipe-0.5.0.tar.gz.

File metadata

  • Download URL: backpipe-0.5.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for backpipe-0.5.0.tar.gz
Algorithm Hash digest
SHA256 5bcf0afb12506998007cc4560379f8985ba5bcc6303214b033d34083d23d7617
MD5 236f5aa3d90805918c6f87481052c89f
BLAKE2b-256 bf69efcae84c84b9c7ab5b8c91a7631b720fcf79ca9b0ebaea2c82b832e40bd1

See more details on using hashes here.

File details

Details for the file backpipe-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: backpipe-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for backpipe-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3db110dde8caa9b62382d894c38e927887f252c7a7e13da54dc25884cd54e62
MD5 62a622514dc3731478aa98132c9fdcad
BLAKE2b-256 bb3809c9d66ce3bc390c2f64fbdcee4724cea4a88cf65a3b3cfb09c0173dd6cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page