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.
pip install foliumVerified import paths — ran on the pinned version, not inferred.
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.
Upgrade Python to version 3.9 or higher. Adjust `requires_python` in project metadata if necessary.
Replace `map_object.choropleth(...)` with `folium.Choropleth(...).add_to(map_object)`.
Switch to alternative built-in tiles (e.g., 'OpenStreetMap', 'CartoDB Positron', 'CartoDB Voyager') or use custom tiles via the `xyzservices` package.
Trust the Jupyter Notebook (File -> Trust Notebook) or ensure the map variable is the final output of the cell.