Skip to main content

Altair Viewer

Offline chart viewer for Altair visualizations

github actions github actions code style black

This package provides tools for viewing Altair charts without a web connection in arbitrary Python environments. Charts can be displayed either inline in a Jupyter notebook environment, or in a separate browser window for use in any environment.

Altair Viewer Gif

Installation

Altair Viewer can be installed from the Python Package Index with pip:

$ pip install altair_viewer

Usage: General Environments

Altair viewer provides two top-level functions for displaying charts: display() and show(). Their intended use is slightly different:

import altair_viewer
altair_viewer.display(chart)

display(chart) is meant for use in interactive computing environments where a single Python process is used interactively. It will serve a chart viewer at a localhost URL, and any susequent chart created within the session will appear in the same window. The background server will be terminated when the main Python process terminates, so this is not suitable for standalone scripts.

import altair_viewer
altair_viewer.show(chart)

show(chart) is meant for use once at the end of a Python script. It does the same as display(), but automatically opens a browser window, and adds an input prompt to prevent the script (and the server it creates) from terminating.

Usage: IPython & Jupyter

Within Jupyter notebook, IPython terminal, and related environments that support Mimetype-based display, altair viewer can be used by enabling the altair_viewer renderer:

import altair as alt
alt.renderers.enable('altair_viewer')

This will cause charts at the end of a Jupyter notebook cell to be rendered in a separate browser window, as with the display() and show() methods.

If enabled with inline=True, charts will be rendered inline in the notebook:

import altair as alt
alt.renderers.enable('altair_viewer', inline=True)

To display a single inline chart using Altair viewer in an IPython environment without globally enabling the associated renderer, you can use the display method directly:

import altair_viewer
altair_viewer.display(chart, inline=True)

Note that the display based on altair viewer will only function correctly as long as the kernel that created the charts is running, as it depends on the background server started by the kernel. In particular, this means that if you save a notebook and reopen it later, charts will not display until the associated cells are re-run.

Metadata

Release files for altair-viewer 0.1.2

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-viewer 0.1.2
File Size Uploaded Provenance Actions
altair_viewer-0.1.2.tar.gz 275.5 kB Without provenance Details for altair_viewer-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for altair-viewer 0.1.2
File Interpreter ABI Platform Actions
altair_viewer-0.1.2-py3-none-any.whl Python 3 none any Details for altair_viewer-0.1.2-py3-none-any.whl

Total release size: 552.3 kB

Release files / altair_viewer-0.1.2.tar.gz

Download URL altair_viewer-0.1.2.tar.gz
Size 275.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35f2dce092a19e24c3eb25bd3fd0cbc4d3843b9a4f05ea99265b15d7e3df669d
BLAKE2b-256 checksum
How to use checksums
976e1d95ea6bd615a9de838adf6f16d68d9c433f040a6d7bc6e3bf41237e6bff
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_viewer-0.1.2-py3-none-any.whl

Download URL altair_viewer-0.1.2-py3-none-any.whl
Size 276.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82d839a5991945a908712eb4d1bf9d383abd7fc854e19febf64f7f6a869c0ae5
BLAKE2b-256 checksum
How to use checksums
279f3761abac11a2b3d446aad92cbe39462bb14a8dd409a24d6b44449d144a17
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

Security for altair-viewer 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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