Skip to main content

Auto-diffing LSP client for remote Jupyter notebooks.

Project description

📋 waxtablet

Waxtablet is an efficient, opinionated client for notebooks to interface with the Language Server Protocol.

It handles document synchronization and request processing, so you can integrate LSP (e.g., basedpyright or ty) into a remote notebook product, without needing to manually synchronize every document edit, which can be slow or tricky running over the network.

Use cases

In a remote Jupyter kernel, the primary requests would be:

  • textDocument/hover: Information about a symbol at a given line and character.
  • textDocument/completion: Get a list of completions while typing.
  • textDocument/semanticTokens: Compute semantic highlighting for a range of code.

While LSP has been designed for local IDEs, waxtablet stores its own internal representation of all the cells. The goal is to get diagnostics from a remote server without needing to literally buffer or send every keystroke.

Example

import waxtablet


# Initialize an empty notebook (default).
lsp = waxtablet.NotebookLsp(
    server=["basedpyright", "--stdio"],
    # server=["ty", "server"],
)
await lsp.start()

# Example usage
await lsp.add_cell("cell1", index=0, kind=waxtablet.CellKind.PYTHON)
await lsp.set_text("cell1", "print('Hello, world!')\ndic")
await lsp.hover("cell1", line=0, character=0)
await lsp.completion("cell1", line=1, character=3)

# Shutdown the server
await lsp.shutdown()

License

Code is released under the MIT License.

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

waxtablet-0.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

waxtablet-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: waxtablet-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for waxtablet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f8eef9c270f22089b6a5637f78b7cb1a9a8b47c63bbed6544cd858b6aac5b5c7
MD5 35c09f1ffb621afa2da6fbc20ac173b4
BLAKE2b-256 d095f999cd1c983631666993c9578e462ff7739ce7f6ce764d0e6d1270331b55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: waxtablet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for waxtablet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8251d7e64a9a18844c8cd4b35767966dc08bf9e0462048a41ad0ec1c62d3968e
MD5 4b28fa972260a291b6de86dfee8d14d9
BLAKE2b-256 7df381ed6012856da6c85396dddc3b28230d23040e5ed44110de45b84659cf1e

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