python-zeep

A modern Python SOAP client for WSDL-described web services, built on lxml and requests/httpx.

Library
PyPI
v4.3.3
2,008stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
71/100Good
Development Activity44
Maintenance52
Community88
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture82
Code Quality88
Innovation62
Learning Curve90

Zeep is a Python SOAP client that parses a service’s WSDL document and turns its operations, types, and bindings into a Pythonic API. Instead of hand-writing XML envelopes, developers call client.service.SomeOperation(...) and Zeep handles serialization, namespace resolution, and response parsing against the WSDL-defined XSD schema.

It supports SOAP 1.1, SOAP 1.2, and plain HTTP bindings, WS-Addressing headers, and WSSE security (UsernameToken and X.509 signing) for services that require message-level authentication. A synchronous Client (via requests) and an AsyncClient (via httpx) share the same binding and type layer, so async support doesn’t require a separate implementation.

Zeep is widely used to integrate with legacy enterprise and government SOAP APIs — payment gateways, shipping carriers, tax and compliance services, and internal corporate systems — where WSDL-first SOAP is still the interface of record. The maintainer describes the library as stable and feature-complete for the SOAP specification, with ongoing maintenance focused on bug fixes and Python version compatibility rather than new protocol features.

What You Get

  • A Client that parses a WSDL URL or local file and exposes each operation as a Python method under client.service
  • Support for SOAP 1.1, SOAP 1.2, and plain HTTP bindings within the same client interface
  • WS-Addressing header support and WSSE UsernameToken/X.509 signing for authenticated SOAP messaging
  • An AsyncClient built on httpx sharing the same binding/type layer as the sync client
  • A Settings context manager to toggle strict XML parsing, forbid external entity/DTD fetches, and add extra HTTP headers per call
  • Pluggable transport caching (including a built-in SqliteCache) to avoid re-fetching and re-parsing WSDL/XSD documents on every run
  • A zeep <wsdl-url> CLI command to quickly inspect a WSDL’s services and operations without writing code

Common Use Cases

  • Calling legacy enterprise SOAP APIs (ERP, CRM, government, banking) from Python application code
  • Integrating with shipping-carrier or logistics APIs that only expose WSDL/SOAP endpoints
  • Building internal bridges between modern Python services and older internal SOAP systems
  • Automating tax, compliance, or payment-gateway calls where the vendor only publishes a WSDL
  • Signing and authenticating SOAP requests with WSSE UsernameToken or X.509 certificates for secure B2B integrations

Under The Hood

Architecture Zeep is layered around a Client (in client.py) that owns a parsed wsdl.Document, a Transport, and an XSD type registry. The Document (under zeep/wsdl/) walks the WSDL’s types, message, portType, binding, and service elements, resolving each into binding objects (zeep/wsdl/bindings/) that know how to serialize a call into a SOAP envelope and deserialize the response. Calling client.service.Operation(...) routes through a ServiceProxy/OperationProxy (proxy.py) to the bound _binding._create() method, which in turn defers to the XSD layer (zeep/xsd/) to marshal Python values into schema-typed XML elements. This keeps protocol concerns (SOAP envelope shape, WS-Addressing headers, WSSE signing) separate from schema/type concerns (XSD complex types, simple types, element trees), so an AsyncClient can reuse the same binding and XSD code with only the transport swapped for an httpx-based AsyncTransport.

Tech Stack Zeep is pure Python (99.9% of the codebase) targeting Python 3.10–3.14 plus PyPy3, packaged with a standard setuptools build backend and a uv.lock for reproducible dev environments. Its core runtime dependencies are lxml for XML parsing, requests for synchronous HTTP, attrs for internal data classes (e.g. Settings), isodate for ISO 8601 duration/date handling, and platformdirs for cache-file locations; the optional async extra pulls in httpx and packaging for the AsyncClient, and an xmlsec extra enables X.509 message signing. There is no database or web framework involvement — it’s a client library, not a service.

Code Quality The repository has an extensive test suite (tests/, roughly 480+ test functions) run via pytest with pytest-asyncio, pytest-httpx, requests_mock, and freezegun for time-dependent tests, plus branch-coverage reporting via coverage[toml]. CI (.github/workflows/python-test.yml) runs ruff check/ruff format --check for lint/format enforcement and executes the full test matrix across Ubuntu, macOS, and Windows on every supported Python version. A mypy.ini covers src/, benchmark/, examples/, and tests/ for static type checking. Error handling uses a dedicated zeep.exceptions module with specific exception types (e.g. Fault, ValidationError, TransportError) rather than swallowing failures silently.

What Makes It Unique Zeep’s distinguishing choice is unifying SOAP 1.1, SOAP 1.2, and async support behind one WSDL-driven object model, rather than requiring separate client code per binding style — a common pain point with older Python SOAP libraries. Its Settings object doubles as a thread-local context manager, letting callers toggle strict parsing, external-reference restrictions (as an SSRF mitigation for untrusted WSDLs), or extra headers scoped to a single call block without mutating global client state. Combined with built-in transport-level caching of parsed WSDL/XSD documents, this makes it comparatively low-friction for a protocol area (WSDL/SOAP) that most modern HTTP tooling has moved away from.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search