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

Publishing

Make sure you have pypi token setup, easiest way is to set env var POETRY_PYPI_TOKEN_PYPI.

  • update version either manually or via poetry version
  • poetry build
  • poetry publish

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.2.7.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

replit_river-0.2.7-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

Details for the file replit_river-0.2.7.tar.gz.

File metadata

  • Download URL: replit_river-0.2.7.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.5.0-1017-gcp

File hashes

Hashes for replit_river-0.2.7.tar.gz
Algorithm Hash digest
SHA256 9e0811b14c84f634c47e53a172bde9e47b29f9266e512842373868ae2788bbff
MD5 7d954fad65bd8ae03d0bff097e23c145
BLAKE2b-256 129106ce3718132fdd202f453298e3152548404ae6acfeb5941d65955658a277

See more details on using hashes here.

File details

Details for the file replit_river-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: replit_river-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 36.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.5.0-1017-gcp

File hashes

Hashes for replit_river-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 195fdbaeb08178f702731a2a6da3acca7e7746de4b9fc64b7d2b30994e3b16a7
MD5 ca2f6558ed68978b3885b3131faed108
BLAKE2b-256 c84f857b225299bef6c164c21a8129f1cec4e53be2d93f8bab34a4dde67b383c

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