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.2-cp314-cp314-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.14Windows x86-64

rupy_api-0.3.2-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.2-cp314-cp314-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

rupy_api-0.3.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

rupy_api-0.3.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

rupy_api-0.3.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

rupy_api-0.3.2-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.2-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.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.2-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.12

File hashes

Hashes for rupy_api-0.3.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 34ce31188632a085873cbaf33940a8c86e2bd2bd11eb083c16056fba2aadeb4d
MD5 8cf9ecd3b49f7c925f704709270da521
BLAKE2b-256 6b68c0303a4e26f574b1cc0f123fa2474ca72c33254e4d6efb94c024555edc39

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0b78059ead2e6f1c39a6bd693722d8c32a9f2feddcaba3df9c7c3a57143cab6a
MD5 1a3241795dbc85c4e9e13ce6e7eb124d
BLAKE2b-256 f4b6d347290d15ae6d0e9582077ee8da5c5c56b889e4caa077eabda615593a20

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 139acda896240ad43c48b39b078e9d39b43610f639b1be0b9536e82326f1e149
MD5 c3e26933e48d60baea7e6d9a0fb2829a
BLAKE2b-256 e95e77f4edcedaa5d83458673e7900647c7e47273a695469fc49ec1e19c1a62d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.2-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.12

File hashes

Hashes for rupy_api-0.3.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5e134e2c4c6703fe5cf159042ab47653dd23be04aa1e932759b8c6f96029be0a
MD5 c77b6c3ac117de03c2ed0721e166013f
BLAKE2b-256 06de83f21299aa6c992283ddeab63ef750f1e79cb3669307b3601542a6345f3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d7d1b926be8104265177f3767bf5493f6e269f58678d3187c128e708c7f9766c
MD5 f0cc1e97197165da4a980f911dadd3b5
BLAKE2b-256 7839e67a91e0a0eaa88c3d8be0dc311a8c24c2e17a8f4d5ae13d66f17c04d905

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4f67416a34690f1abbd4da5e4360939febc954b15ec87b4569d891ed1600eef4
MD5 d72a678b660897174d7376d406155869
BLAKE2b-256 beddcc7085d5aa063489d99c3f9c13dd248b5cf0b629646f54fb103dbd55d326

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.2-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.12

File hashes

Hashes for rupy_api-0.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0eca3a47d18875c586fc38f1ffea2c0d55fef9de4a0ffed774173dd181d4513e
MD5 518c070b6c683d8e880f342fe5b54dba
BLAKE2b-256 e005f60a38b68b6a290ea19ddef0f78857be688c4ae9643d922f39006fd5ad15

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 de4a8339c21e7a4b317b9db533ddc40b777b8b6ccbbe1f4181620a88c92cb64d
MD5 25d6ab7614f207c2239cefef7c851ee8
BLAKE2b-256 947ab50975856515e264c08be6eaf911ad5d10b80df8a2a4ce6d256f249d8957

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b56fa02716972a2a03a18f0ddf3afda0259fe27e0168787b887102e7e6e1ec8
MD5 2ae29ef27849409c816946ac3235b5d3
BLAKE2b-256 517da629c71ee7e4308c417286a072a88772638fa5d64eceb2d6d54cbe769380

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.2-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.12

File hashes

Hashes for rupy_api-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 21cf11e0be481bef2e929b008f9ae9002be17863d7502bf0f03562147dc5fc32
MD5 fb3abadc09191840110632b1630b9245
BLAKE2b-256 d12f58ff2533cc11c076bba2627203955010354b04b4527e89ac21883d73bd6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 df9266f577c4f1cf15cd5ab731629016618e2267ac0a13b1f9e921df45ceb1ea
MD5 d7dc3c3f3fe4bc66e19ef0f2759e1e80
BLAKE2b-256 e9d6171562532d7199a91ff9930e24b6a592be7a655162d7ba80a25daca4024b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba85bc244912fdc8f55e73c97a2bc8eb18aab36aea95fb98d2c9fd18037bbfbf
MD5 4f369856c0b9eac5cdbba1f26376e985
BLAKE2b-256 d385895a132e8f2e4baec536c7c2519b14f693440e2a1abc61c23592d0e7161c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.2-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.12

File hashes

Hashes for rupy_api-0.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 590c73ddf1e3a907648dad8c765c88f83418f736a87872383e8e9c75c3c75217
MD5 f3c926c6b432b1085fe9096e034be003
BLAKE2b-256 bc150cad6a844a9762ab0c66cce657d856e74beb944a4b8775ad30537db22d9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0b1683178434742f6f006e00db31c1baf3cef02884fecb57d15b186a8b698829
MD5 b28a3e1d866eab5f9b0b14b731a090f5
BLAKE2b-256 7bd02fd0e6a844112f5157816ab0223bb065ab81b54ba8c12d5be026a8c42d21

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rupy_api-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2c370d9f54fe8ef0f00fc179a300663434748260bf504d7c5a25ef3ed250dd6a
MD5 74d82339ad17ba7c8075033f3b2b5d4b
BLAKE2b-256 f85715bc32d913f961ae8be96872e67da151600c44bb6ade45a5c03b31e12a71

See more details on using hashes here.

Provenance

The following attestation bundles were made for rupy_api-0.3.2-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