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.0.tar.gz (15.8 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.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wilrise-0.3.0.tar.gz
  • Upload date:
  • Size: 15.8 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.0.tar.gz
Algorithm Hash digest
SHA256 afb5f581f4f29014f9761262873c956f3692ecb73290bdeed61b60aba7275400
MD5 b0089186a7c257fafdb0b5ba051b6629
BLAKE2b-256 a1041b8c63a9a29ecf0f056bb63d2def6e417c31238badbabc49f8f53f8a954f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wilrise-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f614befaabedd59f812171ef6710de603ff76128ee98d3cf5f7d390a73575cb6
MD5 739869e29a35d0e58b3e9b64feb4d45f
BLAKE2b-256 82192bde7dd2b3b12c3efc49dc92ca939ebc3d4266bd465fb0f0fb0c5cf40876

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