Skip to main content

Altair data server

build status github actions github actions code style black Binder Open In Colab

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

Binder Open In Colab

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.

Metadata

Release files for altair-data-server 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for altair-data-server 0.4.1
File Size Uploaded
altair_data_server-0.4.1.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for altair-data-server 0.4.1
File Interpreter ABI Platform
altair_data_server-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.3 kB

Release files / altair_data_server-0.4.1.tar.gz

Download URL altair_data_server-0.4.1.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b39205a48ab2678020fc58739cb973845879ed169cb5addddc9dcbf5a69aeb2b
BLAKE2b-256 checksum
How to use checksums
32249f6a6c755fdaf5307e57222f64af85882c6a5e193a0c5537a456058748bc
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / altair_data_server-0.4.1-py3-none-any.whl

Download URL altair_data_server-0.4.1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd1414d69dbfec22c804b34210491d7313e5edc7736504dfb8c405ded0e2015b
BLAKE2b-256 checksum
How to use checksums
e7a30e7651adce146c17eea516ffcb530f7ee769671e59395bc10838eca827db
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page