Skip to main content

A modern async JSON-RPC framework built on Starlette. Where determination rises from simplicity.

Project description

wilrise

Wilrise is a server-side JSON-RPC framework built on Starlette.

It targets teams that want RPC semantics (method-oriented API, batch support) while staying inside the ASGI ecosystem. It supports mounting under an existing Starlette/FastAPI app, reusing middleware, dependency injection, and Pydantic validation.

This document assumes you are already familiar with JSON-RPC 2.0. The framework implements the server side only; use any JSON-RPC 2.0–compliant client to call your methods.

Install

# With uv (recommended)
uv add wilrise

# Or pip
pip install wilrise

For Pydantic validation and clear Invalid params (-32602) error codes on type mismatches, install the optional extra: uv add "wilrise[pydantic]".

Quick start

1. Write a minimal service (e.g. main.py):

from wilrise import Wilrise

app = Wilrise()

@app.method
def add(a: int, b: int) -> int:
    return a + b

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

2. Run the server:

uv run python main.py

3. Send a request:

curl -X POST http://127.0.0.1:8000/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0", "method":"add", "params":{"a":1, "b":2}, "id":1}'

Response: {"jsonrpc":"2.0","result":3,"id":1}

Learning by Examples

To learn the framework quickly, we highly recommend checking out the examples/ directory. It contains step-by-step runnable tutorials:

  1. 01_minimal.py — The absolute basics.
  2. 02_routing.py — Grouping methods with Router and prefixes.
  3. 03_dependencies.py — Dependency injection (Use).
  4. 04_parameters.py — Advanced parameters (Param alias/default).
  5. auth_crud/ — A full production-like app with SQLAlchemy, JWT auth, and CRUD.

Run the examples from the examples folder:

cd examples
uv sync
uv run python 01_minimal.py

See examples/README.md for more details.

Documentation Index

For advanced topics, production readiness, and deep-dives, see the specific guides in the docs/ folder:

Development and Contributing

Bugs and feature requests are welcome. See CONTRIBUTING (中文) for code style, formatting, and PR guidelines.

# Setup dev environment
uv sync --group dev

# Format and lint
uv run ruff format . && uv run ruff check .

# Type check
uv run pyright

中文说明见 README.zh-CN.md.

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

wilrise-0.3.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

wilrise-0.3.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file wilrise-0.3.1.tar.gz.

File metadata

  • Download URL: wilrise-0.3.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wilrise-0.3.1.tar.gz
Algorithm Hash digest
SHA256 47914ce83bb0bb402f8b113822538e9635c9149a47e317e46465d45f77e20631
MD5 7af2267514046fb0e163e1d12bd5ab2e
BLAKE2b-256 a8af428a23916b5bb5004fa9686bd368e62e914795af522fb33ecea696a219f3

See more details on using hashes here.

File details

Details for the file wilrise-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: wilrise-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wilrise-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5230fd870d99f944217ff4d0f7c4367d6cb30b40dc1c2af7a209c8fe128caf7c
MD5 011f3192947e66a119e2209f737a5bf8
BLAKE2b-256 02c908a3e7a63090cbed55ebcc6a823a6fc5b0e39eebb0624d3df3c8647323d0

See more details on using hashes here.

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