--- id: zope-proxy version: "7.2" license: ZPL-2.1 license_treatment: unclear maintenance: active --- # zope.proxy — Generic Transparent Proxies License: unclear · Maintenance: active · Downloads: 396.1K/mo ## What it is and what it does zope.proxy is a generic proxy wrapper library that lets you wrap Python objects to intercept and control their behavior. It's implemented primarily as a C extension, which allows it to do things difficult or impossible in pure Python—like lie about an object's __class__ and proxy all internal slots (__int__, __str__, __add__, etc.). The package also includes a pure-Python fallback for environments like PyPy where the C extension cannot be built. The main use case is implementing policies like access checking, location brokering, or other cross-cutting concerns by wrapping objects transparently. When code accesses the wrapped object, the proxy intercepts the operation and applies the policy before delegating to the real object. The wrapper is designed to be mostly invisible to the caller—it proxies nearly all operations and attributes of the wrapped object, making it suitable for frameworks like Zope that need fine-grained control over object access without rewriting application code. Use it for: - Implementing role-based access control by wrapping objects and checking permissions on attribute access. - Building location-aware object hierarchies where proxies track the container context of wrapped objects. - Creating security layers in web frameworks that need to restrict what code can access on sensitive objects. - Wrapping third-party objects to add logging, caching, or other cross-cutting behavior without modifying the original class. - Enforcing immutability or read-only views of objects by proxying and blocking write operations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. zope.proxy provides transparent wrapper objects that intercept and control access to wrapped objects, implemented as a C extension for performance and to support advanced features like lying about __class__. Yes, if you need transparent object wrapping with full attribute and method proxying. The C extension provides performance and capabilities (like __class__ manipulation) that pure Python cannot match. Install friction is moderate due to compilation, but prebuilt wheels cover most platforms. No known vulnerabilities, actively maintained, and ZPL-2.1 license is permissive. Best suited for framework or library developers; less relevant for typical application code unless you specifically need proxy-based access control. ## Install pip install zope-proxy uv add zope-proxy poetry add zope-proxy ## Installing zope.proxy Before you install: Medium install friction due to C extension compilation, but prebuilt wheels are available for common platforms (macOS, Linux, Windows on x86_64 and ARM64). Package is actively maintained with recent release on 2026-04-30. License in practice: Licensed under ZPL-2.1 (Zope Public License 2.1), which is a permissive open-source license similar to the Apache License. No notable restrictions for typical use. Quickstart: pip install zope.proxy from zope.proxy import ProxyBase from zope.interface import Interface, implementer class MyClass: def method(self): return "original" obj = MyClass() proxied = ProxyBase(obj) print(proxied.method()) Requires Python 3.10 or later; C extension requires a C compiler and development headers unless prebuilt wheels are used. Verify before relying: - Whether the C extension provides measurable performance benefits over pure Python for typical use cases. - What specific access-control policies are commonly implemented with zope.proxy in production systems. ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 396.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags transparent object wrapper, proxy pattern implementation, access control via proxies, object interception layer, generic proxy objects, zope proxy wrapper, attribute access control, proxy-pattern, access-control, zope-ecosystem [View on SkillFed](https://skillfed.io/packages/zope-proxy) · [View on PyPI](https://pypi.org/project/zope-proxy/)