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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: rupy_api-0.2.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.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 2e92ed0c9ab23c2d71f236fbb1110c0d0c0a5c54700a103987ec7d83cc99b8cc
MD5 8428da9072b22075945a2995ddaf5837
BLAKE2b-256 048a06ccf8d773e45bfc7c878a3dca078d7bb0f7a2c8b3d18ae3718f1352a184

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7e29b08767fb0437bfcc9acf808bb9827050cf9e9d9163beeedcdbb0c9515c51
MD5 36516b7208296b2eedf2edfd21fa7265
BLAKE2b-256 af2bb4cd40dce50c67fb8911f310a0903936506fbec5832b2d1522c51b37d0c7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e43f756313ca46e8f5f7d6b4dd1285f5485013d4ecf97f3da84054bd3c11187
MD5 405701f712e0de5bded3347753356f83
BLAKE2b-256 2b271eee5d46d4367ae33733a6983b8652348a9daf8beae3013f84626f172964

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.2.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.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5e0c8ba8de727b0fce4f00dfd3d52649528d5d3dcf5c22ead2485349f309873b
MD5 e0d9fb21e065a27f5ed67a0fa82088c5
BLAKE2b-256 229873d60f964550572c79b811549085d1c39993b70b5e3514b419aeb9697eed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0a820da69ddf37296514b0849cc2ec724021b7737ab3403cf5b2d64ed7de0599
MD5 fa397156fc943b949e301fb27e5456db
BLAKE2b-256 54593aa7c051d9119a1b5324c1cb95c1aea9cdda7af5496c2867a2e826b2a27e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00c52845bd52bc8b9403561360d4fa45de05ec8e272869029424795eb17c8518
MD5 214922e76536907089a693102f5edc84
BLAKE2b-256 6d6a8247f6ba5ee5a4e2ac21c90f0a600dbdb5911d755be5ca73bcb598b51f20

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.2.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.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 45ac4a122c3c138110e4a4dc0f993dde6ff6ec89c5eefbdcdc4bcd1bd78ba9aa
MD5 b70eb9af7ea84f0bb626043063924b13
BLAKE2b-256 93d9840811d9a521a8affaf2c15184d35ec3c0b963e90bd85dca861634d28861

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 80629c6a042c233f78760d4315558e826bbbbc83feae224019290fe99c7c28ee
MD5 a58c0d7b0937e624ecfec324e31b0745
BLAKE2b-256 ab385f182a8ed2432873723994e9041f0e73c64cf2426c5420caeceb46ce7bd5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c370f4e6ef82eae2cf7c004a2cdeb4575728c230fd2dc21496711b9f05623dc0
MD5 b94babb14ba111805ef19ea4ed7e17af
BLAKE2b-256 d2b9646d39f1b5f7d9529fcd4f9a3095919fcc7d3ca01cbc1154b0c5b71e2f5a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.2.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.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ad7e8f03ecfa8a7b7cc593af0adeec8c7a2709d1a9a8adeef9cfd632a653638f
MD5 410d1cebac5bf54e2474b9c47e7fc0ab
BLAKE2b-256 cab85166816e8932a49bd1b6a3ad03c7141953f70a41395dae76c5fed72fbe92

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 286fb112910a394a029807530579101a41125f5a03469b9967d4b1ca500c2795
MD5 4ac3d575fdd0a8498a98b8f2d96c49ee
BLAKE2b-256 3e77e60731ac296deb096326a2bb6ab0fd1ff480fd4bfeb239b5070da12a4119

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4fce6e7c6e9eea8af394aaf84b6a1f3091b7ac6d422912c5e4a011ab2a41ef9
MD5 ab5cbdd610b77b60f514bd5228e41188
BLAKE2b-256 e26758dcb472157dfbe3238657e5193a99fdc53cc46d8e46204b3c74d2efe78c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rupy_api-0.2.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.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4ddb45ecd878089977600afcafdbe08919f11c7b4c3b2ac06bfc45174551f894
MD5 9bbbc61248ffdc7118fa984d014f5513
BLAKE2b-256 57fa86e1a9ed8e3205725d2ce6fb2f9def2de0dac779c8894d2b526c858026e3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 acf3af9a39a25c8a6d3a08531803f85d7781fd13ce12b43318d99c5d00b8dfac
MD5 27a56fefbccb6ccfb10909696cd0291a
BLAKE2b-256 bde5883efcee239e69c763f572670537bb56f9ca42b4a84d170a579e60235727

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rupy_api-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6ac8ac936294bc900e3c7fb6fdf53bfd2f63721453238cc4ec81acc1543571fe
MD5 7a50ed6a6fc6002c7163199c4e7b1b67
BLAKE2b-256 d16c0ccd7dd6bc95d06400f04f46e5c2489cc5c83e9ce05351b620d1ff94b92e

See more details on using hashes here.

Provenance

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