Skip to main content

Binding-free anywidget-style backend core for any Jupyter kernel language.

Project description

cositos

A portable anywidget-inspired backend core: define a widget front end once, drive it from any Jupyter kernel language.

cositos is the small pile of protocol glue ("cositos" = little things) that sits between a host language's state object and the Jupyter comm channel. It speaks the ipywidgets widget messaging protocol (v2.1.0) and reuses anywidget's published AnyModel/AnyView front end verbatim — so you write no new JavaScript (see docs/tutorials/authoring-widgets.qmd to author one).

Why

anywidget already lets you build widgets with plain ESM. Its backend has been ported to Python and Deno, and people want Julia, C#, and R too. The blocker (per the anywidget maintainer) is keeping the core free of per-language bindings. cositos is that binding-free core plus a conformance fixture suite, so ecosystem experts can port a backend to their language and self-certify against golden messages.

Backend maturity

The protocol core ports to a language in ~150 lines and is fixture-certified for all five backends below (see docs/porting.md). Whether you get live widgets also depends on the kernel's comm support, which is a separate, per-kernel question — see probe/README.md for how each was classified.

Language Live widgets today? Detail
Python ✅ yes (Tier 1, ipykernel) src/cositos/
Julia ✅ yes (Tier 1, IJulia) julia/README.md
R 🚧 protocol core only — blocked upstream (IRkernel comm-open bug) r/README.md
C# 🚧 protocol core only — blocked upstream (.NET Interactive's non-standard protocol) csharp/README.md
Clojure ✅ yes (Tier 1 via an internal-API crack, clojupyter) or via Clay (recommended, public API) clojure/README.md, docs/hosts.md

Full tier classification and how kernels were tested: probe/README.md. Shortest runnable path per language: docs/tutorials/quickstart.qmd.

Documentation site

The tutorials, reference, and explanation docs under docs/ build into a Quarto website (tutorials execute live, so a broken example fails the build, not just a lint):

mise run docs           # build docs/_site/
mise run qa-docs        # build + open it
mise run docs-preview   # live-reload preview while editing

Start at docs/index.qmd (a live-rendered widget) or docs/status.md for the implementation-status overview (per-language and per-host maturity). The site is not published yet (no hosting decision made) — build it locally.

Architecture

host state ──▶ cositos-core (pure protocol, no I/O) ──▶ Transport seam ──▶ kernel comm
                • message builders   • buffer split/merge   • mimebundle
  • Core is pure: message shaping, binary-buffer split/merge, inbound parsing. No kernel code.
  • Transport is a seam: each kernel supplies a thin adapter (Python comm, Deno.jupyter.broadcast, IJulia, dotnet-interactive). See docs/tutorials/integrating.qmd for which one to use and how to embed a widget into an existing tool (Quarto, JupyterBook, Voila, Clay, …).
  • Contract is data: fixtures/*.json are the cross-language guarantee.

Status

Early. The v0 core (buffers + protocol builders) is implemented and fixture-tested. See .wai/projects/cositos-core/ for the research → design → plan trail and docs/porting.md for how to add a new-language backend.

Development

Tooling is managed with mise (task runner + pinned node).

mise install     # pinned node
mise run setup   # install Python (uv) + JS (npm) deps
mise run verify  # lint + typecheck + coverage (py & js) + complexity + specs
mise tasks       # list all tasks

Quality gates run on every commit/push via lefthook — see docs/hooks.md.

License

MITu2014see LICENSE. No anywidget/ipywidgets source is vendoredu2014see NOTICE for how cositos reuses those projects' protocol and frontend without copying source.

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

cositos-0.1.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

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

cositos-0.1.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file cositos-0.1.0.tar.gz.

File metadata

  • Download URL: cositos-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cositos-0.1.0.tar.gz
Algorithm Hash digest
SHA256 266a80469ceaf34ec8672990fffc5b6b4051521ff4f4d78db898b074fcf4b0c0
MD5 0aa54665af4423f6ff56904d27beee31
BLAKE2b-256 00c8c291cedce5c76b0c8ce41f46e7cbc630a1ca6bd1f2827392e34df40194bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for cositos-0.1.0.tar.gz:

Publisher: release.yml on sashakile/cositos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cositos-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cositos-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cositos-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c0ab066acb1819b500a5055c8f5708ae7d15309f08ae2c37863ed8b1d3e74d9
MD5 895a5ced8c59ec096809e52f681626ad
BLAKE2b-256 693120913d6ddde968e363ef5a8983c09fda33ec6bcc3a865375c118be955723

See more details on using hashes here.

Provenance

The following attestation bundles were made for cositos-0.1.0-py3-none-any.whl:

Publisher: release.yml on sashakile/cositos

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