xmlschema
An XML Schema validator and decoder
Decision gist · record as of 2026-08-14
Yes. xmlschema is actively maintained, has no known vulnerabilities, requires only Python 3.10+, and carries a permissive MIT license. It is the standard choice for schema-based XML processing in Python when XSD validation or structured XML-to-Python conversion is needed.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with a single runtime dependency (elementpath).
- Active maintenance with a release 45 days ago and ongoing commits.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in commercial and private projects.
last release 2026-06-30 (45 days) · last repo commit 2026-06-30 · 477 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,481,770 downloads/mo, #1,618 on PyPI
Alternatives
Verify before relying
pip install xmlschema
import xmlschema
my_schema = xmlschema.XMLSchema('path/to/schema.xsd')
my_schema.is_valid('path/to/document.xml')
data = my_schema.to_dict('path/to/document.xml')- Whether XSD 1.1 support is production-ready or still experimental relative to XSD 1.0.
- Performance characteristics when validating large XML files or deeply nested schemas.
What it is and what it does
xmlschema is a Python implementation of XML Schema (XSD) that validates XML documents and converts between XML, Python data structures, and JSON. It supports both XSD 1.0 and XSD 1.1 standards and includes built-in base schemas for offline operation. The library was originally developed to handle schema-based XML processing for the MaX European research project but is applicable to any XML Schema validation or data binding task.
The package provides validation in strict, lax, and skip modes, protects against XML attacks by forbidding entities, and offers XPath-based APIs for navigating schemas. It can decode XML into nested Python dictionaries with type-aware values, encode Python data back to XML, and generate static code using Jinja2 templates. The single runtime dependency (elementpath) keeps installation lightweight.
Use it for
- Validate XML configuration files or data exports against a schema before processing.
- Decode XML documents into Python dictionaries for programmatic access to typed data.
- Encode Python data structures back to XML while enforcing schema constraints.
- Build XML data bindings or generate Python classes from XSD schemas.
- Protect against XML entity attacks by parsing untrusted XML with entity forbidding enabled.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
xmlschema is actively maintained, has no known vulnerabilities, requires only Python 3.10+, and carries a permissive MIT license. It is the standard choice for schema-based XML processing in Python when XSD validation or structured XML-to-Python conversion is needed.
Install
xmlschema on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency (elementpath). Active maintenance with a release 45 days ago and ongoing commits.
Requires Python 3.10 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects.
Quickstart
pip install xmlschema
import xmlschema
my_schema = xmlschema.XMLSchema('path/to/schema.xsd')
my_schema.is_valid('path/to/document.xml')
data = my_schema.to_dict('path/to/document.xml')
Verify before relying
- Whether XSD 1.1 support is production-ready or still experimental relative to XSD 1.0.
- Performance characteristics when validating large XML files or deeply nested schemas.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageelementpath |
| Maintenance | Actively maintained 45 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,481,770 / month, #1,618 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: LibrariesTopic :: Text Processing :: Markup :: XML |
Evidence: xmlschema-4.3.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “XML schema validation”
- xmlschemaValidates XML documents against XSD schemas and converts XML to/from…
- lxmllxml provides Python bindings to libxml2 and libxslt, enabling…
- saxoncheSaxonC-HE is a Python wrapper for Saxon, an XML processor that runs…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also PyXB-X · xsdata · xsdata-pydantic · schema · event-model · fastjsonschema · jsonschema-rs · voluptuous · kubernetes-validate · doclang