Skip to main content

Replit river toolkit for Python

Project description

River

Machinery for compatibility with https://github.com/replit/river, the protocol behind the Workspace ↔ pid2 WebSocket (and in general, the protocol behind the Workspace ↔ * WebSocket).

Since the pid2 services are declared in TypeScript using TypeBox in the main repl-it-web repository, and it would be terrible for everyone involved to force folks to follow this paradigm of declaring their services, types, and interfaces in a foreign repository, any other River servers will use gRPC for their protocol definition and implementation. The @replit/river-codegen package can be used to compile the gRPC .proto files into a River-compatible TypeBox declaration that can be then packaged into an npm package that can be imported by the Workspace and consumed ergonomically.

This includes the necessary machinery to act as a client or server for River:

  • As a River server, create a WebSocket server and the gRPC -> Python River codegen (similar to the protoc flow that generates the Python bindings).
  • As a River client, create a WebSocket client and the JSON Schema -> Python River codegen. python -m river.codegen client --output pkgs/river/river/schema.py --client-name Pid2Client pkgs/river/schema.json
  • If we need to create the client-side of a Python gRPC River server, we also need to generate the JSON schema from the .proto file, with this command: python -m river.codegen server-schema --output pkgs/river/river/schema.py pkgs/river/tests/client/proto/test.proto && cat ./test_schema.json

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

replit_river-0.1.16.dev2.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

replit_river-0.1.16.dev2-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file replit_river-0.1.16.dev2.tar.gz.

File metadata

  • Download URL: replit_river-0.1.16.dev2.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0

File hashes

Hashes for replit_river-0.1.16.dev2.tar.gz
Algorithm Hash digest
SHA256 374df45d863727c41979704cd95a78794dbe42847a6a49595ee8e3b1bc169080
MD5 13f337d1562fd0d258a32c109f4a5af3
BLAKE2b-256 8dc0d16874a950a35e9847427bcc084aa22182d52a7158ee1c3dd4504d796de5

See more details on using hashes here.

File details

Details for the file replit_river-0.1.16.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for replit_river-0.1.16.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba54e395c33c60e9f52db1205f8c263e3cce2cdeec39e27178bb96c762177539
MD5 0cda89e62f2032025eaa6d210f75dd6c
BLAKE2b-256 aa8b961e33d729c9fd6e3e19741144184d3a097a3ff8956e18290f2236150e12

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page