Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Widget for maps

Project description

Binder Documentation Status

pydeck: Large-scale interactive data visualization in Python


The pydeck library is a set of Python bindings for making spatial visualizations with, optimized for a Jupyter Notebook environment.

For interactive demos, click the binder logo below:


See further documentation here.


pip install pydeck

If you are installing this for a Jupyter notebook server, you'll have to enable the widget extension. To do this, run:

jupyter nbextension install --sys-prefix --symlink --overwrite --py pydeck
jupyter nbextension enable --sys-prefix --py pydeck

Mapbox API token

Like, the pydeck library takes its basemap tiles from Mapbox. Register with Mapbox, and you can find your Mapbox access token here. The service is free until a certain level of traffic is exceeded.

You will need to inform pydeck about your key by setting an environment variable. In your terminal, run export MAPBOX_API_KEY=<mapbox-key-here>, which pydeck will read to use Mapbox basemaps. You can also refer to the pydeck docs to see how to pass the key as a variable.

Getting started

The following code renders a visualization similar to the one above in a Jupyter notebook:

import pydeck as pdk

# 2014 location of car accidents in the UK

# Define a layer to display on a map
layer = pdk.Layer(
    get_position='[lng, lat]',
    elevation_range=[0, 3000],

# Set the viewport location
view_state = pdk.ViewState(

# Render
r = pdk.Deck(layers=[layer], initial_view_state=view_state)

If you're doing this outside a Jupyter environment, you can run:

r.to_html('demo.html', notebook_display=False)

For more, check out the docs and Binder examples above.

Debugging note

Currently, some errors in pydeck will only appear in your browser's developer console. If a visualization fails to render, open the developer console. Error handling will be expanded in future versions of pydeck.


If you encounter an issue, file it in the issues page and include your console output, if any.

Installation from source

# Clone the repo
git clone

# Navigate to the pydeck module

# Create a virtual environment
python3 -m venv env3
. env3/bin/activate

python3 install


git clone
# Build the entire project
yarn bootstrap

# Optional but recommended: Run a hot reloading development server
cd modules/jupyter-widget
yarn watch

If running a non-default URL for webpack's dev server, change the URL in the PYDECK_DEV_SERVER environment variable, e.g., export PYDECK_DEV_SERVER=http://localhost:8081.

Elsewhere, run:

export PYDECK_DEV_SERVER=http://localhost:8080

# Create a virtual environment
python3 -m venv env3
. env3/bin/activate

pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .


Tests are handled by pytest. In the top-level pydeck directory, you can type:


Tests expect the development build of pydeck, specified above. Click on the URLs in the test output to see visualizations generated by the tests.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pydeck, version 0.1.dev5
Filename, size File type Python version Upload date Hashes
Filename, size pydeck-0.1.dev5-py2.py3-none-any.whl (66.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size pydeck-0.1.dev5.tar.gz (57.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page