Skip to main content

Ultra-fast Rust-powered Python async web framework

Project description

Cello 🐍

CI PyPI Python License

Ultra-fast Rust-powered Python async web framework

Cello is a high-performance web framework that combines Python's developer experience with Rust's raw speed. All HTTP handling, routing, and JSON serialization happen in Rust—Python handles only your business logic.

✨ Features

Feature Description
🚀 Blazing Fast Tokio + Hyper HTTP engine in pure Rust
📦 SIMD JSON SIMD-accelerated JSON with simd-json
🛡️ Middleware Built-in CORS, logging, gzip compression
🗺️ Blueprints Flask-like route grouping
🌐 WebSocket Real-time bidirectional communication
📡 SSE Server-Sent Events streaming
📁 File Uploads Multipart form data handling
🐍 Pythonic Decorator-based routing like Flask

📦 Installation

pip install cello

From source:

pip install maturin
git clone https://github.com/jagadeeshkatla/cello.git
cd cello
maturin develop

🚀 Quick Start

from cello import App, Response

app = App()

# Enable middleware
app.enable_cors()
app.enable_logging()
app.enable_compression()

@app.get("/")
def home(request):
    return {"message": "Hello, Cello!"}

@app.get("/users/{id}")
def get_user(request):
    user_id = request.params["id"]
    return {"id": user_id, "name": "John"}

@app.post("/users")
def create_user(request):
    data = request.json()
    return {"id": 1, "name": data["name"]}

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

📖 Documentation

Blueprints

Group routes with shared prefixes:

from cello import App, Blueprint

api = Blueprint("/api/v1")

@api.get("/users")
def list_users(request):
    return {"users": []}

@api.get("/users/{id}")
def get_user(request):
    return {"id": request.params["id"]}

app = App()
app.register_blueprint(api)
app.run()

Request Object

def handler(request):
    request.method              # "GET", "POST", etc.
    request.path                # "/users/123"
    request.params["id"]        # Path parameters
    request.query["search"]     # Query parameters
    request.get_header("auth")  # Headers
    request.body()              # Raw bytes
    request.text()              # String body
    request.json()              # Parsed JSON
    request.form()              # Form data dict

Response Types

from cello import Response

# JSON (default)
return {"data": "value"}

# Custom responses
return Response.json({"ok": True}, status=201)
return Response.text("Hello!")
return Response.html("<h1>Hello</h1>")
return Response.file("/path/to/file.pdf")
return Response.redirect("/new-url")
return Response.no_content()

Middleware

app = App()

# CORS - allow cross-origin requests
app.enable_cors()
app.enable_cors(origins=["https://example.com"])

# Logging - log all requests
app.enable_logging()

# Compression - gzip responses
app.enable_compression()
app.enable_compression(min_size=1024)

WebSocket

@app.websocket("/ws")
def websocket_handler(ws):
    ws.send_text("Welcome!")
    while True:
        msg = ws.recv()
        if msg is None:
            break
        ws.send_text(f"Echo: {msg.text}")

Server-Sent Events

from cello import SseEvent, SseStream

@app.get("/events")
def events(request):
    stream = SseStream()
    stream.add_data("Hello")
    stream.add_event("update", '{"count": 1}')
    return stream

🏗️ Architecture

Request → Rust HTTP Engine → Python Handler → Rust Response
              │                    │
              ├─ SIMD JSON         ├─ Return dict
              ├─ Radix routing     └─ Return Response
              └─ Middleware

🛠️ Development

# Setup
python -m venv .venv
source .venv/bin/activate
pip install maturin pytest ruff

# Build & Test
maturin develop
pytest tests/ -v

# Lint
ruff check python/ tests/
cargo clippy

📊 Tech Stack

Component Technology
HTTP Server Tokio + Hyper
JSON simd-json + serde
Routing matchit (radix tree)
Python Bindings PyO3
Compression flate2 (gzip)

📄 License

MIT License - see LICENSE

👤 Author

Jagadeesh Katla

cello

Project details


Download files

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

Source Distribution

cello_framework-0.2.0.tar.gz (51.7 kB view details)

Uploaded Source

Built Distributions

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

cello_framework-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (816.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (816.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (817.1 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (818.5 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.0-cp312-abi3-win_amd64.whl (701.2 kB view details)

Uploaded CPython 3.12+Windows x86-64

cello_framework-0.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (812.8 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

cello_framework-0.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (815.8 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

cello_framework-0.2.0-cp312-abi3-macosx_11_0_arm64.whl (737.5 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file cello_framework-0.2.0.tar.gz.

File metadata

  • Download URL: cello_framework-0.2.0.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cello_framework-0.2.0.tar.gz
Algorithm Hash digest
SHA256 01204e7965ed0593209295d55c1535fd8fdcb2abd644866b8291cf78a7b1588a
MD5 99a3b426e7fed59b33cfe117a5e57dcb
BLAKE2b-256 36d15e62721f86b007576171c33e6591ee22cb76a99492fab29b47e31d67dc69

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0.tar.gz:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 579fc147ddc4714c2cbcc1a3558e68d4287be4a8c734a7fb92ace2632f39da1a
MD5 cd8da144c53aebc911242138dd2e1c0e
BLAKE2b-256 e6850d0df9f0eaec07f462db3862d8cdfee74886df05bf55ab48f8685fb7d2f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 92ea3dee61768dec5d87da882218ee1c85333d92511ca2f73597830816f2d2d6
MD5 59472f8f9ec2e1f60c0808cefd975478
BLAKE2b-256 f0ceb799beaed21c98b067d5049c6a36f6f765728816ccb968711782c438e002

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7b41357994f6091692cbbb47323e322b5ce7e70d19b2c5d5b724708034498ad3
MD5 3ac52bdc32ddda9d76cfd19984045516
BLAKE2b-256 61ff6107f9c2e6698acc38a297226475b08d5055905e9b51eaf12eae21baf784

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2ede37223f9257554e06cd257e683d027c4cf52ef2bcf5f3c8075caf50bec135
MD5 c06d645f9cea6c9df9bfef85823c70c6
BLAKE2b-256 514ad08c11c66c87dedb60f0aa93971dd2ce21bcaaaadb1915aa2907e4e029d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1d7bf11b47a7a6e506c5e4a787b73c1503ab0d4553fbcfc492a326c50ae6e659
MD5 9441e038e2235f48dccff4480e33c2b1
BLAKE2b-256 7d5419debfe0149a940c213d04b26f9a636804e64531d731ac48f88969c7c4f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-cp312-abi3-win_amd64.whl:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 328605c3dd28209eb521ce2ee754eba11515d820cec3e7ff6499ffbcbaafae72
MD5 8f6edc404709f50b174d9bb30fff296f
BLAKE2b-256 6e900b77f57d79acb46392c5f8f3d8ba4821d1cdaffd0d95583d25f088b4e065

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 615c1f5e6c3d6f707ffd583011dc38bc534fb185611c3c889f651b8a2db308e0
MD5 ef5ac66acae6188a48cac1be88536c2b
BLAKE2b-256 c1f98c7a81efbb4612f4c779e9b5cc864266769cb98d3745e18d041d0b6ee24b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on jagadeesh32/cello

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

File details

Details for the file cello_framework-0.2.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df2481cf4c222db6ae4927df2e0c2f842a765985d9c8420e3479f35477e8d923
MD5 bf29cdd6d49afd3efe32c40bfd2b8b03
BLAKE2b-256 946da54c737337dac3438c8608056aea7a5ce017242c4098b393895bb2eb2bbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.0-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on jagadeesh32/cello

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