Pydeck wrapper for use with CARTO
Project Links
Meta
Author: CARTO
Requires Python: >=3.8
Classifiers
Development Status
- 5 - Production/Stable
Framework
- Jupyter
Intended Audience
- Developers
- Science/Research
License
- OSI Approved :: BSD License
Natural Language
- English
Programming Language
- Python :: 3
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
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
import pydeck_carto as pdkc
from carto_auth import CartoAuth
# Authentication with CARTO
carto_auth = CartoAuth.from_oauth()
# Register new layer types in pydeck
pdkc.register_layers()
# Create CARTO data source
data = pdkc.sources.vector_query_source(
access_token=carto_auth.get_access_token(),
api_base_url=carto_auth.get_api_base_url(),
connection_name="carto_dw",
sql_query="SELECT geom, name FROM carto-demo-data.demo_tables.world_airports",
)
# Render CARTO layer in pydeck
layer = pdk.Layer(
"VectorTileLayer",
data=data,
get_fill_color=[238, 77, 90],
point_radius_min_pixels=2.5,
pickable=True,
)
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
0.2.1b0
May 09, 2024
0.2.0
Apr 29, 2024
0.2.0b0
Apr 24, 2024
0.1.1b0
Apr 24, 2024
0.1.0
Nov 04, 2022
0.1.0b9
Nov 03, 2022
0.1.0b8
Oct 13, 2022
0.1.0b8.dev0
Oct 13, 2022
0.1.0b7
Sep 19, 2022
0.1.0b6
Sep 18, 2022
0.1.0b5
Sep 09, 2022
0.1.0b4
Sep 08, 2022
0.1.0b3
Sep 07, 2022
0.1.0b2
Sep 01, 2022
0.1.0b1
Aug 26, 2022
0.1.0a1
May 04, 2022