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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

rupy_api-0.3.1-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.1-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.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.3.1-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.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 37cc9a41c413fca34d930ab4c262e3e4e31d362a61458bede051d19067dec3d6
MD5 497c60baf96890f2fdcd7f4c0e5fefd4
BLAKE2b-256 c5377bbbf4c7a6446005945e40a235f735bf6f5c59dadfd0aeae413f2c262957

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d7abab1c8f7551a99b84d3388885015694a89556de36af5142783030e9674be8
MD5 8f2984df53bb2a2296cf12b03ff8fe02
BLAKE2b-256 c26b7953addcf26c749f4f8bc935cac2484ee5691dd361576b07ea24fbde6c8f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 048f2f618d0547ad26a9daadc029ea58e74177c7d4e61a345fad9b598c8a1cc5
MD5 f746d6289b736b3aa5b21614231afdb4
BLAKE2b-256 362a1f1316f6e62ca93a0664cf0a72c45fb166aaa2839f6ef59c8e98acebb5ec

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.3.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 01fa5ced6f8d8864aa3b02f6f543a5afc0bb80c146a582eda21b0aeafe6e66d3
MD5 55a72c0ff121a2c70474879011f64ca7
BLAKE2b-256 c204d9bdfe3794399ce60c062ef0c45ab5a3e6a0aa39ed82f40f114d03e1b76f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9d54e59dcf607df4f18c129f19a5fd36f5df6342d0ae5e75d5dceb3168e1c1ed
MD5 fa8563e5307402ff9c8fb5985d4b9cd6
BLAKE2b-256 0505cd6ad40754e15306e6b27831b85514a23818ea182dde27268a87f7115fd0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 670bcd662249b335bbf9c7f57bc241319b3b7ad1c3e76fcfc8368085ad206f55
MD5 0a0674e92bfd5857c462a14c2d33989a
BLAKE2b-256 57bb6d898b4d2015b1a56c9d5d3c04b5dc61d0749c9eaa157ce1147de2faad67

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.3.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 beeb749bca1c1bac35750361ec4b25ccddd61a82e3b3a982ae6d27bcdf27cce7
MD5 89c77c7c3f6984f8e55b4e0db5454874
BLAKE2b-256 d40ee094df9090f61aa39c0f72b42a361151046ece32260ccd5f17b935dd3de5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 991bab84fc0d6f203d2cf8b054bfc5afe096b309786e983c678b363d03bde0c7
MD5 f951b35556f19a259df80b4ea9122c09
BLAKE2b-256 8d6cf654cc97ca9bc840df3fae28d4f5a7ae8b9372ce8aa07388adc281c0a56b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e93ad5bfe494460fdb44fd46ea9f8a122d8bf92b1484d7f30850480ed4facbb2
MD5 f7f38997d8908a5c0bbcc519ae978e2e
BLAKE2b-256 587c804f238f1b0d5755edf83b21e8c0d96a13d0288d3c1809c85d2efb1b0d40

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.3.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ca7cce5ff264e4282e2eac70d0c06463fd5001b3b9b2977650fafd23d2694a74
MD5 c8c4f282819284f948b32eaf4aeda032
BLAKE2b-256 d952f8286426a2ec632504aff181c598a61b5d9c9ec14e3dd52a35c534eaee45

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 19beadadb5cee10b3a73437e74d10d32cbcf54ac9d9430f3f1a1ce73fd388833
MD5 aad6c3c1370d871f89d2d7b9592c4431
BLAKE2b-256 469b84c70ce72553e4b530e4884eaf3b824668790579dda95179f2d44aa3d242

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 216ff761cb35d3b33cb32d40c1bff652ae2d9479359031920d899c55e68385dc
MD5 f64861a49e98dc27202517518872a0db
BLAKE2b-256 8cddb4e4b21a0805676fd7778a9c9bfe10ed1132d20f889b2b422a367dff6f51

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.3.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 beb3beb3282a96b995deceaea3c25d22e4fb190d3f596b225b4aeef6d8f4740d
MD5 014d9823218c9b3197a6a9e57d8c6b32
BLAKE2b-256 793cb48b58b0e2df6ab506af191e117a8b53e894a9daabfb2795afeceb15cc00

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3f3142542bf7f38ddae209037735c7cd7e7a37c4939427f834903436cebb7148
MD5 784d1fd3ed8706ca97ff7a1a1649a20b
BLAKE2b-256 5647890d1e5587d17d25e4912d5b4af0f8057f1c8072c1cc8fda0688df2d1cf8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c47188b36fb918d66c2ae91c9d570b488176ff57524193aeba3f6412231f4a9a
MD5 faee88c3b6d923ae690e11ac4b0e37f2
BLAKE2b-256 5aa3d85ffc5c7f6d39a679493fc3bfe9adca89f7936c0ede287c342d817d4587

See more details on using hashes here.

Provenance

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