Registry / serialization / pykml
library0.2.0pypypi✓ verified 82d ago

Python KML (Keyhole Markup Language) library for parsing, constructing, and manipulating KML files. Version 0.2.0 is the current release; it is in maintenance mode with infrequent updates.

pip install pykml
INSTALL
IMPORT
SIG · PYKML
P
pykml
serializationpythonv0.2.0
Install
2.1s avg
Import
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 30.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.000s · 31MB
28MB installed
● package 28MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KML
import pykml
from pykml import KML

Parse a KML string and access element attributes.

from pykml import parser from lxml import etree kml_str = '''<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document> <Placemark> <name>Test</name> </Placemark> </Document> </kml>''' root = parser.fromstring(kml_str) placemark = root.Document.Placemark print(placemark.name.text)
Debug
Known issues
gotchapykml requires lxml as a dependency; it is not automatically installed if you use pip without lxml already present. Install lxml explicitly.
fix
pip install lxml
affects: all
deprecatedThe library uses a non-standard namespace model with capitalized 'KML' classes, which can cause confusion when working with standard lxml methods.
fix
Use the pykml.factory module with KML_ElementMaker for generating KML.
affects: >=0.1.0
Upgrade
Version history
0.2.0latest on PyPI · released Oct 25, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
7
Resources
pykml — pip install pykml · libregistry