pykml
Python KML library
What it is and what it does
pyKML is a Python library for reading and writing KML (Keyhole Markup Language) documents—the XML format used for geographic data in mapping applications. It wraps lxml.objectify to provide a Pythonic interface, so you can construct or parse KML documents as Python objects rather than manipulating raw XML strings.
The package was last released in 2019 and is now abandoned, meaning no bug fixes, security updates, or compatibility work are happening. It has a single runtime dependency on lxml and installs with low friction. If you're working with legacy KML data or maintaining older code that already uses it, it may still function; for new projects, you should evaluate whether a maintained alternative exists or whether hand-rolling KML generation with a modern XML library is more appropriate.
Use it for:
- Parse KML files from mapping services or geographic data sources into Python objects for analysis.
- Generate KML documents programmatically to feed into GIS tools or web mapping applications.
- Convert between KML and other geographic data formats in a data pipeline.
- Extract geographic coordinates and metadata from KML placemarks for geospatial queries.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyKML parses and creates KML documents using a Pythonic XML interface built on lxml.objectify, letting you read and write geographic markup programmatically.
No, unless you are maintaining legacy code that already depends on it. The package has been abandoned since 2019 with no maintenance, no visible repository, and no security updates. For new projects requiring KML support, evaluate maintained alternatives or use a general-purpose XML library with KML specifications. The low install friction and permissive license do not offset the maintenance risk.
Install
pykml on PyPI
pip
pip install pykmluv
uv add pykmlpoetry
poetry add pykmlInstalling pykml
Before you install
Installation is straightforward with a single runtime dependency (lxml), but the package has been abandoned since 2019 with no maintenance activity or repository access visible. Use only if you need KML support in legacy code or have no active development requirements.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects that can tolerate an unmaintained dependency.
Quickstart
pip install pykml
from pykml import kml
k = kml.KML()
doc = kml.Document(ns='http://www.opengis.net/kml/2.2')
k.append(doc)
Verify before relying
- Whether lxml version compatibility issues exist with modern Python releases given the package's 2019 last release date.
- Whether the package works with current KML specifications or only historical versions.
- Active community forks or maintained alternatives for KML handling.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — lxml |
| Maintenance | abandoned — 2,485 days since the last release |
| First released | |
| Downloads | 247,261/month — #8,695 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pykml-0.2.0-py3-none-any.whl
Keywords: kml
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fastkmlReads, writes, and manipulates KML files—an…
copyleft · top 15,000 on PyPI
simplekmlSimplekml generates KML (Keyhole Markup…
copyleft · top 15,000 on PyPI
lxmllxml provides Python bindings to libxml2 and…
permissive · top 1,000 on PyPI
pyulogParses ULog files (a self-describing logging…
permissive · top 15,000 on PyPI
kml2geojsonConverts KML files to GeoJSON format,…
permissive · top 15,000 on PyPI
turbohtmlParse, query, edit, and serialize HTML and XML…
permissive · top 15,000 on PyPI
pyquerypyquery lets you query and manipulate XML and…
permissive · top 5,000 on PyPI
pydantic-xmlPydantic-xml adds XML serialization and…
permissive · top 5,000 on PyPI
docxCreates, reads, and writes Microsoft Office…
unclear · top 15,000 on PyPI
MarkupPyMarkupPy generates HTML and XML markup from…
permissive · top 5,000 on PyPI