kml2geojson is a Python library that converts KML files to GeoJSON format. Current version is 5.1.1. Actively maintained.
pip install kml2geojsonVerified import paths — ran on the pinned version, not inferred.
Convert a KML file to GeoJSON object.
Update code to handle return value as dict.
Write XML string to a temporary file or use io.StringIO with proper encoding.
Use Python 3.11 or newer.
Pass a file path string to convert(), not a parsed KML dict.
Check the structure: geojson['features'] if 'features' in geojson else geojson.
No dependency data recorded yet.