Folium

0.20.0 · active · verified Thu Apr 09

Folium is a Python library that builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the Leaflet.js library. It allows users to create interactive maps and geospatial visualizations that can be shared as standalone HTML files or integrated into web applications. The current version is 0.20.0, and it maintains an active release cadence with frequent updates and patch releases.

Warnings

Install

Imports

Quickstart

This example demonstrates how to create a basic interactive map, center it on New York City, add a marker with a popup and tooltip, and save the result as a standalone HTML file.

import folium

# Create a map centered at a specific location with a zoom level
m = folium.Map(location=[40.7128, -74.0060], zoom_start=12)

# Add a marker
folium.Marker(
    location=[40.7128, -74.0060],
    popup="<b>New York City</b>",
    tooltip="Click for info"
).add_to(m)

# Save the map to an HTML file
m.save("folium_map.html")

# Display the map (useful in Jupyter notebooks, otherwise open the HTML file)
# m

view raw JSON →