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-framework

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.1.tar.gz (53.4 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.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (821.5 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (821.5 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (822.1 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (823.6 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

cello_framework-0.2.1-cp312-abi3-win_amd64.whl (707.6 kB view details)

Uploaded CPython 3.12+Windows x86-64

cello_framework-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (818.5 kB view details)

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

cello_framework-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (820.8 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

cello_framework-0.2.1-cp312-abi3-macosx_11_0_arm64.whl (744.6 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: cello_framework-0.2.1.tar.gz
  • Upload date:
  • Size: 53.4 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.1.tar.gz
Algorithm Hash digest
SHA256 1207baaeb3372a0203c7c43c3de8fd74fe6b9edef024a5ebebea39979a62d480
MD5 8c2c4c1c38e688acc2bc1b1dff89f477
BLAKE2b-256 621e84fa119e2dbeb0d92e41fcb4cb7971bf28b1abf62ed49253090937fea6ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.1.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.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c0c0c0ffaf9168194afb6ad9b8446b0ada631cac4ebbea287dc8fe54b70eb916
MD5 72ecabe0e0d5b221ebc09c2c0db0406c
BLAKE2b-256 955aed676e0d24699df9c7abadf0eec5edeb2c44282afd181b520c63644e53bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.1-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.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 63ee530b184cfdc0152d3a9cf020b9951cb5c550b38397fc38373ac17368cfa5
MD5 b041d276ade39cded1042d786a8c3f5e
BLAKE2b-256 05921cc9c581446b7ce51bfb736a05154fd3c766719add31c7accaa94b1ef276

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.1-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.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 91227f1bc46de75b83a422a4f375f39b19813cd13d5957128aa74d2d1d217d0e
MD5 36b275c29e675b0c6b484276ed45c4d3
BLAKE2b-256 d4fe6990e4363c4fb45639deb4647f156a7e3d1ec46e3ca1d6932bb34b1b593a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.1-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.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6eb6dbc1838093546a4e4912c72c826f7378774198e26f0ecd546d203292d67b
MD5 4d5c29625c2f9d3ff1c73d4e1548738c
BLAKE2b-256 594da0d92815a813da464e2f95233f2ea77067ffbceb7c3fb62d5c742d146ced

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cello_framework-0.2.1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 72b72514145870a5b4f3980378514b506669c4b8cfb7f520e26221e249ad4a1e
MD5 dcf02f876cd0892bd49dd16345cbf8da
BLAKE2b-256 ed37d7776343512977b389453862bb9a9afad8c000d5b3925a79d181e6a253a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.1-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.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 99056f3a1b70ddc744c7e69f0c76bac4fbd9dd8649283c44ed364ae2d56ca1bb
MD5 2d263b8dd1553046ba6a2bc895834720
BLAKE2b-256 12204313ddc073adc53895d7ff3cb508b873449a810d0c921ecc638fe68caeb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.1-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.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cello_framework-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 de3392ed4d2af0e94d554607a9817d0e6eda7b208655055fc7db768292da58e6
MD5 ed7b9bda2dfa799014158bb751eb39b8
BLAKE2b-256 0c0b64019464edba3bde2f0950abdf72a40771c9b3ecc707a892a2b00dbe8d82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for cello_framework-0.2.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d221554c44f07e151ab5d20bc65ba6a7d9f96a48429ba18fdc81bec04864b956
MD5 791c7fa7c6f0fd270521f6f65b29429f
BLAKE2b-256 0a172465067b32d9f4ec738010f69016ea10697670aa19be4e4411703f23b7d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cello_framework-0.2.1-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