Skip to main content

Document structures for collaborative editing using Ypy

Project description

Build Status Code style: black PyPI npm (scoped)

jupyter_ydoc

jupyter_ydoc provides Ypy-based data structures for various documents used in the Jupyter ecosystem. Built-in documents include:

  • YBlob: a generic immutable binary document.
  • YUnicode: a generic UTF8-encoded text document (YFile is an alias to YUnicode).
  • YNotebook: a Jupyter notebook document.

These documents are registered via an entry point under the "jupyter_ydoc" group as "blob", "unicode" (or "file"), and "notebook", respectively. You can access them as follows:

from jupyter_ydoc import ydocs

print(ydocs)
# {
#     'blob': <class 'jupyter_ydoc.yblob.YBlob'>,
#     'file': <class 'jupyter_ydoc.yfile.YFile'>,
#     'notebook': <class 'jupyter_ydoc.ynotebook.YNotebook'>,
#     'unicode': <class 'jupyter_ydoc.yunicode.YUnicode'>
# }

Which is just a shortcut to:

import pkg_resources

ydocs = {ep.name: ep.load() for ep in pkg_resources.iter_entry_points(group="jupyter_ydoc")}

Or directly import them:

from jupyter_ydoc import YBlob, YUnicode, YNotebook

The "jupyter_ydoc" entry point group can be populated with your own documents, e.g. by adding the following to your package's pyproject.toml:

[project.entry-points.jupyter_ydoc]
my_document = "my_package.my_file:MyDocumentClass"

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

jupyter_ydoc-2.0.0.tar.gz (954.5 kB view details)

Uploaded Source

Built Distribution

jupyter_ydoc-2.0.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_ydoc-2.0.0.tar.gz.

File metadata

  • Download URL: jupyter_ydoc-2.0.0.tar.gz
  • Upload date:
  • Size: 954.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for jupyter_ydoc-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9bb3f4d327d47597d9430358df3d59795899521ca0eb50c799c0236ef4dc177d
MD5 79cfcb7f8fed7f0bab10afd9bba0e31a
BLAKE2b-256 cb3a94eef4de42db1acb4ad6feb1d1f37fdd8b826a6a1bdd40d4cd946f425b3c

See more details on using hashes here.

File details

Details for the file jupyter_ydoc-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_ydoc-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37330bf8acede4b822e493591bde8c9e4b6deda61b7d7ce29da737db5f879429
MD5 4d146fe0ddb430cc66b44a80648b2ec3
BLAKE2b-256 b8b1b798efe2d22c660ea308ef580ba0122d190f1738962a7a82cb28a931319d

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