A background data server for Altair charts.
Project description
Altair data server
This is a data transformer plugin for Altair that transparently serves data for Altair charts via a background WSGI server.
Note that charts will only render as long as your Python session is active.
The data server is a good option when you'll be generating multiple charts as part of an exploration of data.
Usage
First install the package and its dependencies:
$ pip install altair_data_server
Next import altair and enable the data server:
import altair as alt
alt.data_transformers.enable('data_server')
Now when you create an Altair chart, the data will be served in the background rather than embedded in the chart specification.
Once you are finished with exploration and want to generate charts that will have their data fully embedded in the notebook, you can restore the default data transformer:
alt.data_transformers.enable('default')
and carry on from there.
Remote Systems
Remotely-hosted notebooks (like JupyterHub or Binder) usually do not allow the end user to access arbitrary ports. To enable users to work on that setup, make sure jupyter-server-proxy is installed on the jupyter server, and use the proxied data server transformer:
alt.data_transformers.enable('data_server_proxied')
Example
You can see this in action, as well as read some of the motivation for this plugin, in the example notebook: AltairDataServer.ipynb. Click the Binder or Colab links above to try it out in your browser.
Known Issues
Because jupyter-server-proxy requires at least Python 3.5, the methods described in Remote Systems do not work do not work for older versions of Python.
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
Built Distribution
File details
Details for the file altair_data_server-0.4.1.tar.gz
.
File metadata
- Download URL: altair_data_server-0.4.1.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b39205a48ab2678020fc58739cb973845879ed169cb5addddc9dcbf5a69aeb2b |
|
MD5 | 36f429aba034517006b83dafa63917bf |
|
BLAKE2b-256 | 32249f6a6c755fdaf5307e57222f64af85882c6a5e193a0c5537a456058748bc |
File details
Details for the file altair_data_server-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: altair_data_server-0.4.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd1414d69dbfec22c804b34210491d7313e5edc7736504dfb8c405ded0e2015b |
|
MD5 | 64735172b7dc15af7b754ecb2184be32 |
|
BLAKE2b-256 | e7a30e7651adce146c17eea516ffcb530f7ee769671e59395bc10838eca827db |