Skip to main content

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

Project description

cositos

Binder

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

Try it live on myBinder — opens JupyterLab with a runnable Python widget counter (other kernels also available).

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.2.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.2.0-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cositos-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 328522ebac4297b947c20a79b439cc58021c6d25aafb4d22b9d048051460159a
MD5 7c8432c585215216fe77c6c8b7af5a6d
BLAKE2b-256 dcaa87eb38235053ffb90676ddac588e9789972395a55c593df2cfa38ac6fb10

See more details on using hashes here.

Provenance

The following attestation bundles were made for cositos-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: cositos-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 297a13d198c21d4c5bf873365d96d892fd74d16df88c59d0dc60e1b8861cf791
MD5 91fd018181162d3d23cb5bc0f32fa47b
BLAKE2b-256 bc4905a2b09499bf83aa82622d84b7dd405d5388e535c8f0d8bf2cc46b4333e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for cositos-0.2.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