Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
Widget API
KeplerGl()
Create a kepler.gl map widget.
Parameters
heightintoptional default:400Height of the map display in pixels.
datadictoptionalDatasets as a dictionary, key is the name of the dataset. Read more on Accepted data formats.
mapbox_tokenstroptional default:""Mapbox API access token. Required for Mapbox basemap styles (e.g. "Dark", "Muted Light"). Leave empty to use free MapLibre styles.
use_arrowbooloptional default:FalseIf
True, serialize DataFrames as Arrow IPC for better performance on large datasets. Has no effect on GeoDataFrames, which always use GeoArrow serialization.configdictoptionalMap config as a dictionary. The
dataIdin the layer and filter settings should match thenameof the dataset they are created under.show_docsbooloptionalDeprecated, kept for backward compatibility.
themestroptional default:""UI theme for the map. Accepted values are
"light","dark","base", or""(default dark theme). See Map Customization for details.app_namestroptional default:"kepler.gl"Application name shown in the side panel header and used as the HTML
<title>when exporting. See Map Customization for details.
Examples
# Load an empty map
from keplergl import KeplerGl
map_1 = KeplerGl()
map_1

You can also create the map and pass in the data or data and config at the same time. Follow the instruction to match config with data.
# Load a map with data and config and height
from keplergl import KeplerGl
map_2 = KeplerGl(height=400, data={"data_1": my_df}, config=config)
map_2

.add_data()
Add data to an existing map.
Parameters
datarequired CSV, GeoJSON, DataFrame or GeoDataFrame. Read more on Accepted data formats.nameoptional default:"data". Name of the data entry.use_arrowoptional IfTrue, serialize DataFrame as Arrow IPC. IfNone(default), falls back to the widget-leveluse_arrowsetting.
name of the dataset will be saved to the dataId property of each layer, filter and interactionConfig in the config.
kepler.gl expects the data to be CSV, GeoJSON, DataFrame or GeoDataFrame. You can call add_data multiple times to add multiple datasets to kepler.gl.
# DataFrame
df = pd.read_csv('hex-data.csv')
map_1.add_data(data=df, name='data_1')
# CSV
with open('csv-data.csv', 'r') as f:
csvData = f.read()
map_1.add_data(data=csvData, name='data_2')
# GeoJSON as string
with open('sf_zip_geo.json', 'r') as f:
geojson = f.read()
map_1.add_data(data=geojson, name='geojson')

.data
Print the current data added to the map. Returns a dict.
map_1.data
# {'data_1': 'hex_id,value\n89283082c2fffff,64\n8928308288fffff,73\n89283082c07ffff,65\n89283082817ffff,74\n89283082c3bffff,66\n8...`,
# 'data_2': 'location, lat, lng, name\n..',
# 'data_3': '{"type": "FeatureCollection...'}