Embed Observable cells hosted on observablehq.com into Jupyter notebooks.
Project description
observable_jupyter
Embed cells from Observable notebooks into Jupyter notebooks.
To install the library, import the embed function, and embed the "graphic" cell from this notebook:
!pip install observable_jupyter
from observable_jupyter import embed
embed('@mbostock/epicyclic-gearing', cells=['graphic'], inputs={'speed': 0.2})
The simplest way to use embed()
is to render an entire Observable notebook:
embed('@d3/gallery')
You may want to swap in your own data into a D3 chart:
import this
text = ''.join(this.d.get(l, l) for l in this.s)
embed('@d3/word-cloud', cells=['chart'], inputs={'source': text})
With multiple cells, you can embed interactive charts!
embed(
'@observablehq/visualize-a-data-frame-with-observable-in-jupyter,
cells=['vegaPetalsWidget', 'viewof sepalLengthLimits', 'viewof sepalWidthLimits'],
)
About this library
This is an unofficial, but unlikely to break because it uses official embedding APIs, library for embedding Observable notebooks in Jupyter. The library was developed at Observable but is now maintained by Thomas Ballinger. All code added before Sept 2021 is copyright Observable.
Development
Because this is a Python and JavaScript library, you'll need node as well as Python to contribute to it.
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
Built Distribution
Hashes for observable_jupyter-0.1.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b32410e8ecf74646cdee5c239785bb680288bf5c1ea8ce4e6b1ab4e5825186a5 |
|
MD5 | 0d556e7b084ccb2cd9e53a479167210c |
|
BLAKE2b-256 | c23d86b076255e1fccc87dcd6b491533fc7f8f58c7964102856b7b886f26896b |
Hashes for observable_jupyter-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9204cef432fc0980f1b6e9e3a7d93ed22112ad4752ae0b1b446969eb346d9fc5 |
|
MD5 | 48333b8b4e50affb7e354a7fa49315cd |
|
BLAKE2b-256 | 90b049f0eb7f44b8f9fa7cfb3ad0ef7ff315a36b4b0484ca177ae367d0106f95 |