Skip to main content

A background data server for Altair charts.

Project description

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.

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

altair_data_server-0.4.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

altair_data_server-0.4.0-py2.py3-none-any.whl (12.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file altair_data_server-0.4.0.tar.gz.

File metadata

  • Download URL: altair_data_server-0.4.0.tar.gz
  • Upload date:
  • Size: 12.6 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

Hashes for altair_data_server-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9f9b31b1e7377423450bf186fae217069724ce12ce14e716c621cc7d169d9d92
MD5 143e69de4dad94a57bc5fb7c35a006b9
BLAKE2b-256 7e9b0d2c0434f90a5859fd6707d98b621274ccc2703733ebe8101970db44e0c6

See more details on using hashes here.

Provenance

File details

Details for the file altair_data_server-0.4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: altair_data_server-0.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 2, 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

Hashes for altair_data_server-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7732a209375a19140e29df01e4e1714b464f406b8e9c179ea9082f4f75fda8d5
MD5 3a12b893ca59aae8c62f229c022c3647
BLAKE2b-256 e0e94562b6b11ef06603f9a8bf0cadd42dd16220341cf776ef90cd60a54871cc

See more details on using hashes here.

Provenance

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