Skip to main content

A high-performance web framework for Python, powered by Rust and Axum

Project description

Rupy is a web framework for building web applications in Python. However It users Rust (Axum + pyo3) behind the scenes to provide high performance.

Ergonomics

Rupy is designed to be ergonomic and easy to use. It provides a simple and intuitive API that allows developers to quickly build web applications without having to worry about the underlying implementation details.

Example of a simple web application using Rupy:

from rupy import Rupy, Request, Response

app = Rupy()

@app.route("/", methods=["GET"])
def hello_world(request: Request) -> Response:
    return Response("Hello, World!")

@app.route("/user/<username>", methods=["GET"])
def hello_user(request: Request, username: str) -> Response:
    return Response(f"Hello, {username}!")

@app.route("/echo", methods=["POST"])
def echo(request: Request) -> Response:
    return Response(f"Echo: {request.body}")

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)

To run the application, save the code to a file named app.py and execute it using Python:

python app.py

Middleware Support

Rupy supports middleware functions that execute before route handlers. This allows you to add cross-cutting concerns like authentication, logging, CORS, etc.

Example with middleware:

from rupy import Rupy, Request, Response

app = Rupy()

@app.middleware
def auth_middleware(request: Request):
    if request.path.startswith("/admin"):
        return Response("Unauthorized", status=401)
    return request

@app.middleware
def logging_middleware(request: Request):
    print(f"Request: {request.method} {request.path}")
    return request

@app.route("/", methods=["GET"])
def index(request: Request) -> Response:
    return Response("Public page")

@app.route("/admin", methods=["GET"])
def admin(request: Request) -> Response:
    return Response("Admin page")

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)

Middlewares can:

  • Inspect and modify requests
  • Return early responses (blocking further processing)
  • Execute in registration order
  • Be used for authentication, logging, CORS, rate limiting, etc.

Performance

Rupy leverages the performance of Rust and Axum to provide a fast and efficient web framework. It is designed to handle high loads and provide low latency responses. It was meant to be a high-performance, fastest alternative to existing Python web frameworks like FastAPI and Flask.

It was benchmarked against FastAPI and Flask using wrk and the results are as follows:

$ wrk -t12 -c400 -d30s http://127.0.0.1:8000/

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

rupy_api-0.3.0-cp314-cp314-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.14Windows x86-64

rupy_api-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

rupy_api-0.3.0-cp314-cp314-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

rupy_api-0.3.0-cp313-cp313-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.13Windows x86-64

rupy_api-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

rupy_api-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rupy_api-0.3.0-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

rupy_api-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

rupy_api-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rupy_api-0.3.0-cp311-cp311-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.11Windows x86-64

rupy_api-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

rupy_api-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rupy_api-0.3.0-cp310-cp310-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.10Windows x86-64

rupy_api-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

rupy_api-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file rupy_api-0.3.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rupy_api-0.3.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 efde721acac39619c16a60efb6d7ebc4d4c3eb34979f44676b41b0e87234eb1e
MD5 2433a81cd1dc255aad28810102e4ed38
BLAKE2b-256 3de9c6d46d5e621e8c746a067ef3518fa0f28aaaeced02444abb86ab11259805

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp314-cp314-win_amd64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 28a1a46ca9cd4b46aa2688f0c553fa478c787470ddd6b50cc649752501efc64c
MD5 db57f90cf19e0fb717a5792e4fbc26db
BLAKE2b-256 e67c1e01478c941c17c85e1e6dbbce7a153c3fbcf87d78fef67fca57a8639d4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a9fd62405cc91b9fcc01cfd2ba9ff5de75c707913a901b2b2bf0c25bec842372
MD5 7aee39a35615cca761e9439c99d325c2
BLAKE2b-256 4cb21a558dd7969af5ffbbc6a0ed830d022c5a489e1f25f8e8bb5b2a62b23325

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rupy_api-0.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4bf94057b02b812003bd3d874afa2dac886dd6960a36ac876e410cf5f95f550f
MD5 c44e39ce025ac100a3c93f48b44ebb70
BLAKE2b-256 3767f761e0b49c1eb8a543a2f14027a6c88fe88b56f4da3048a31f73b8a2ce92

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c9c74cbb62fe05d4b4fb1464c7a31dbfb8cc7a43e2d410adcb74ee6adf1f4af6
MD5 f4a7baa2c364418e9d649913c5354265
BLAKE2b-256 fdcfa98b66dba88d1aab8dbe11ac3330fe144d5c60024ea296e99b28abc08a94

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61c0c93d3bfadbf6f8351747d60ecaa5d3d28c4a2b5cb10b8b01dd329a9e3588
MD5 74f798edbeece2aab1a1c96bdf4b9dc5
BLAKE2b-256 f661124bae02190cf374b729b9d4eebeda8bf0b7b0d989996cd1ae3a39d597b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rupy_api-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4c372ac8ab2f733f08a76f85695bfc40b3424524ba23aa52321d905f3d7cbbc7
MD5 755c44196e480d255422159c7c20ee76
BLAKE2b-256 817a96feb996691297285ea1bc30c75a3c8fe272497259eab633b6ee2d667305

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0c6f268956055eb64967e9ef79edb339552cd5a6f606984ec46a99575da5da3f
MD5 5b126ceacafb53ea99f225a4031660cf
BLAKE2b-256 23880e89fa27c2e71737fc83c28315dda582bd380b8756c44478f20aa2200a28

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42bd1a594bd0d45cae9bf7f243c54da0cee5500b7ef99b2cc29cab72dd9e9605
MD5 1981fc23776a8b322260b818fdde9709
BLAKE2b-256 5f2a7f67b93636ceaa25262a71cd031626c7861ed93b487ddfcddb4e83e184c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rupy_api-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 63a1c3b8fb21a4be15ceb292d5076922907f69e0520a4a4104c83af8ef98b361
MD5 4b31946e037ca9b31876c323f29bdc77
BLAKE2b-256 a89c90fa5716b90a036881cf10310169933509b577b20ad748b36770df28395f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1fb809d2b2f2da347f7a71f667e2c46299b7ca995d535eb212e059e36e35bbc0
MD5 f0045350f86eb6b8a9b92b5e5e6ca9ca
BLAKE2b-256 4d143a8c58c4106f2a324b4d77dd7e871a74b82ce037ccf52aecd4496f033072

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d060dd0b99a4746f7ed710199a77e29165c2401956dcc5b4cda796e2cfb2ab09
MD5 a13ec7b8832689251939525fba5e0a06
BLAKE2b-256 76e35b90d3db18a9d24ffcc35463616c21a9a50e55dbee4f2b5d1d01ed95dfa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rupy_api-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 70d0d708948529d07b7bd0e0371f79dea47211bf5cef2b7a18617955f705773a
MD5 36054a1bafdb6e180547f9481d24127a
BLAKE2b-256 cfd872b0aefc85b045b5c0ee7ca6a0331b256537c6f292268a924ec56085b508

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0c71e2bced88c3faa618f5a19df2eea0df151eba2e09afb82003778dc13946cb
MD5 3dafe4aeeb3d6c22eb135d58f49b03de
BLAKE2b-256 e7d6eef4b279799f70956afb8e585a5bf51ec5f591006cd7d58c0ee5f2aec027

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rupy_api-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65df5bc3fe9c815c4209995d181905ee027ef50c95e44ad6f0071e426fdcfd82
MD5 0a3043e0c682716d87064ad0259dff46
BLAKE2b-256 cbc0b73055bcfd645f818a17c0a553e9af399e0315fdbf8543d264a957b64b3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on manoelhc/rupy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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