{"id":2035,"library":"folium","title":"Folium","description":"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.","status":"active","version":"0.20.0","language":"en","source_language":"en","source_url":"https://github.com/python-visualization/folium","tags":["mapping","geospatial","leaflet","visualization","data visualization"],"install":[{"cmd":"pip install folium","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core dependency for creating elements for Folium maps.","package":"branca","optional":false},{"reason":"Used for templating map elements.","package":"Jinja2","optional":false},{"reason":"Often used for numerical data handling, especially with geospatial data.","package":"Numpy","optional":false},{"reason":"Used for fetching data from URLs, e.g., GeoJSON data.","package":"requests","optional":false},{"reason":"Commonly used for data manipulation before visualization on maps.","package":"pandas","optional":true},{"reason":"Provides a repository of raster basemap tilesets for more tile options.","package":"xyzservices","optional":true}],"imports":[{"symbol":"Map","correct":"import folium\nm = folium.Map(...)"},{"symbol":"Marker","correct":"import folium\nfolium.Marker(...).add_to(m)"},{"note":"The `Map.choropleth` method was deprecated and removed in v0.15.0; use `folium.Choropleth` directly.","wrong":"m.choropleth(...)","symbol":"Choropleth","correct":"import folium\nfolium.Choropleth(...).add_to(m)"},{"symbol":"MarkerCluster","correct":"from folium.plugins import MarkerCluster"}],"quickstart":{"code":"import folium\n\n# Create a map centered at a specific location with a zoom level\nm = folium.Map(location=[40.7128, -74.0060], zoom_start=12)\n\n# Add a marker\nfolium.Marker(\n    location=[40.7128, -74.0060],\n    popup=\"<b>New York City</b>\",\n    tooltip=\"Click for info\"\n).add_to(m)\n\n# Save the map to an HTML file\nm.save(\"folium_map.html\")\n\n# Display the map (useful in Jupyter notebooks, otherwise open the HTML file)\n# m","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade Python to version 3.9 or higher. Adjust `requires_python` in project metadata if necessary.","message":"Python 3.8 support was dropped in Folium versions 0.18.0 and 0.19.0. Users on Python 3.8 or older should upgrade their Python environment to at least 3.9 before upgrading Folium.","severity":"breaking","affected_versions":">=0.18.0"},{"fix":"Replace `map_object.choropleth(...)` with `folium.Choropleth(...).add_to(map_object)`.","message":"The `Map.choropleth` method was deprecated and subsequently removed. Direct usage of `folium.Choropleth` class is required.","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Switch to alternative built-in tiles (e.g., 'OpenStreetMap', 'CartoDB Positron', 'CartoDB Voyager') or use custom tiles via the `xyzservices` package.","message":"Several Stamen tilesets (e.g., 'Stamen Toner', 'Stamen Terrain', 'Stamen Watercolor') were removed in v0.15.0 due to upstream changes or deprecations.","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Trust the Jupyter Notebook (File -> Trust Notebook) or ensure the map variable is the final output of the cell.","message":"When using Folium in Jupyter notebooks or similar environments, maps may not render if the notebook is not 'trusted' or if the map object is not the last expression in the cell. If a map doesn't appear, ensure the notebook is trusted and the map object `m` is the last line of the cell.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}