Pydeck wrapper for use with CARTO
Project description
pydeck-carto
Pydeck wrapper for use with CARTO.
Install
pip install pydeck-carto
This also ensures pydeck is installed. If you haven't previously enabled pydeck to be used with Jupyter, follow its instructions to install.
Installing from source
git clone https://github.com/visgl/deck.gl
cd deck.gl/bindings/pydeck-carto
pip install .
Usage
import pydeck as pdk
from carto_auth import CartoAuth
from pydeck_carto import register_carto_layer, get_layer_credentials, get_error_notifier
from pydeck_carto.layer import MapType, CartoConnection
# Authentication with CARTO
carto_auth = CartoAuth.from_oauth()
# Register CartoLayer in pydeck
register_carto_layer()
# Render CartoLayer in pydeck
layer = pdk.Layer(
"CartoLayer",
data="SELECT geom, name FROM carto-demo-data.demo_tables.airports",
type_=MapType.QUERY,
connection=CartoConnection.CARTO_DW,
credentials=get_layer_credentials(carto_auth),
get_fill_color=[238, 77, 90],
point_radius_min_pixels=2.5,
pickable=True,
on_data_error=get_error_notifier(),
)
view_state = pdk.ViewState(latitude=0, longitude=0, zoom=1)
pdk.Deck(layer, map_style=pdk.map_styles.ROAD, initial_view_state=view_state)
For more information, check the examples section and the documentation.
Development
Make commands:
- init: create the environment and install dependencies
- lint: run linter (black + flake8)
- test: run tests (pytest)
- publish-pypi: publish package in pypi.org
- publish-test-pypi: publish package in test.pypi.org
- clean: remove the environment
Contributors
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for pydeck-carto-0.1.0b8.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47131da30070c2f0b6028cfaae9f0cc2b9c25f860c99ef0d692d9c7ed978c5cc |
|
MD5 | 64289d9afde3ee454274816c29c8041d |
|
BLAKE2b-256 | b50186de94f9dc0684be4ec704458583e2366ea06143ebe61e34c48fdcd8e06a |
Close
Hashes for pydeck_carto-0.1.0b8.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4185b137b5237d76bfa5bce9df1b853c6032875829e3ca7fd1116582227a225 |
|
MD5 | 5d56c0e650d2c560874d8440695db903 |
|
BLAKE2b-256 | 8c5066a1beba44882635acfc23f4e0ac9dfc856ede0bf8c257c9fdc203211b5a |