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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

rupy_api-0.1.7-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.1.7-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.1.7-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rupy_api-0.1.7-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.1.7-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 665bc67f05cdfd092f9a436966dadeb29d70db13d2d2a92198782f017ce6f0e7
MD5 2348471b9c75d0ed13a98219d253c99f
BLAKE2b-256 00ed90adfdfe1a480bec02cceeb577b14a8687b81263434269010401fc0adeb7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6dd1d106c285ad63e184d413895bf1b3456fc803afe73b394b7aac1de77d7be2
MD5 d1f0282c828b720d8680e1a26ad381b5
BLAKE2b-256 ad3dc9ce834ce17f444f0f2ec00a756b8a9feb7642daa6fdb59c01456462dc3f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c4ddf912f35a34c762596cf117cefbb3587180f67e5e1881c91be3e89c8fccd
MD5 afa05fc1ca90085951ded775a9572b46
BLAKE2b-256 d5f23517c3451593ab8d076f88e9cbd15d9df802cd98d7c9caef0ca082ea8dfc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.1.7-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.1.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8849693bde477b6af7fc14a12d159d8610fc218149bc9df00453b2fe8f2337ca
MD5 10223b887473424ae1e4be495f7a73c4
BLAKE2b-256 0e5bc81cc1039e51c15571b03aaf2f6192d34984d60aed6f86b402c567b35a10

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d0280466b446161cbfcb24aa19f44b300a5e6018687a588ab6a1ef76c00174ea
MD5 f6dca2fc0fa6ac6d5553d565760abb5c
BLAKE2b-256 da6f9d1d60cb0717da5c605fe0bf0d57ad0e1ba16ff7cedc3c6d10504fb99eb6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a7321745870a2c1bbe707e4dea24d977ca21455f3097764326920262bedc897
MD5 a4a84ded20317f3d76a1704986f43a7a
BLAKE2b-256 7ec4cc11c21b96f22f872976d413241b854880c0caf90c3bfacfd9b3bd703eb5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.1.7-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.1.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 357f75cfaf85f1f3295315d6cce48df71875621824956fba0848978dc40207ad
MD5 eebf5bb9f7a41f0f870c40a6a1fbf3b8
BLAKE2b-256 a649d297f398ef7ee34bb514823aa30914d0055a500a06dffef17ba201571edc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6c222d54e55853e179cd19891b23881a95e9220cdb7b73861553d146cc3ca5e0
MD5 dd185d54eb25d55911feda339d50f772
BLAKE2b-256 26fe19246f4ea4133eb3100c9689018fbeb75117c3071f9d19620e03dc1cfdb3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1517d6f295e94097a41f24833b4030aa020cf5b87cd10ba946dee1a655cac9f
MD5 f54b4fcd829930b8fde80c054f54ba77
BLAKE2b-256 2f9d8df4d97c25963daf39d68dff5dc47c318bdb913cfd4b74c57594061b4154

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.1.7-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.1.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f65a95160b5a9d6a0c8e1cc7b9517c252d5e1f2e2c6f0ddc9fc9f0218de5fa76
MD5 fa44aa410397a005893303c2bedd0b5f
BLAKE2b-256 89d092df4616ffdb3f9bae3bf527fcba6c61853a0c659b1884feff9cb8d6ab88

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 975568805ab5a00a4fb550eb67ff1b3a0ce3eb2d26ac7250d2e0183eef4a139a
MD5 6ff403c3047c526554c43a08fad67835
BLAKE2b-256 1480463d6f67ac5b4e621222dd88e92646971db5694f13d13fa52cc9cb5cb20e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9fd69727b7255bfe981036ea55a3928affc22b2d19efac9da5f17ffeea82de64
MD5 003dc6d84f5be151574fbeca5bb8cd26
BLAKE2b-256 83cb81ac1dda130e015248ac6e400490751214f2d1ca2234ac967ad6dff63d93

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.1.7-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.1.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6324d898f4fa6a5039018508a140bf594795e95a8f72d12397c7a223206f98f6
MD5 5d4a5426a0397ed3c0313f4bdb767705
BLAKE2b-256 7cb790e4f1e965f49de2e9a7ebb85a5750729ce50c9b0f5c95d825fd4e15f01d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c6a5b1c4e10a65d8884dc6e684bbdde5b5814fe6102c25a25c953ec659bf97be
MD5 6c63e277bb42f2e4db0eb49c139aa35e
BLAKE2b-256 2b6a2961b24c499a77669e38090298aa4311680eecbdcf4cb847997b06b4cc21

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.1.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ceb5512f3b0ef687858d5f28a136c786bbf1823ee22363de1eb0c084ecce520
MD5 119a9929ee816829812ea8f252df9d0a
BLAKE2b-256 4a00e5587c45d0eba74d9791561ebba942326c2c1ca9a6f362b0d1362f5f8210

See more details on using hashes here.

Provenance

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