--- id: acquisition version: "6.2" license: ZPL-2.1 license_treatment: unclear maintenance: active --- # Acquisition — Acquisition is a mechanism that allows objects to obtain attributes from the containment hierarchy they're in. License: unclear · Maintenance: active · Downloads: 181.8K/mo ## What it is and what it does Acquisition is a Python mechanism that allows objects to dynamically acquire attributes from their containment hierarchy at runtime. Rather than requiring explicit inheritance, an object wrapped in an acquisition context can transparently access attributes from its container or parent objects. This is particularly useful in frameworks like Zope where object hierarchies are deep and dynamic, and behavior should depend on context. The package provides two acquisition styles: implicit (automatic attribute lookup up the containment chain) and explicit (manual lookup via the aq_acquire method). Objects inherit from Acquisition.Implicit or Acquisition.Explicit to enable this behavior. Acquisition wrappers expose the wrapped object and its context through attributes like aq_parent, aq_self, and aq_base. The mechanism relies on ExtensionClass to implement the low-level wrapping and attribute resolution logic. Use it for: - Building hierarchical object systems in web frameworks where child objects need access to parent context without explicit parameter passing. - Implementing dynamic role-based access control where permissions are inherited from container objects. - Creating nested component architectures where behavior adapts based on the object's position in the containment tree. - Zope application development where acquisition is a core pattern for managing object relationships and context. - Reducing boilerplate in deeply nested object structures by allowing implicit attribute resolution from ancestors. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Acquisition implements a mechanism for Python objects to automatically obtain attributes from their containment hierarchy at runtime, enabling objects to inherit behavior from their containers without explicit inheritance. Yes, if you are building Zope applications or need a framework-level acquisition pattern for hierarchical object systems. The package is actively maintained, has no known vulnerabilities, and supports current Python versions. Install friction is moderate due to compiled dependencies, but wheels are widely available. Verify ZPL-2.1 license compatibility first. Not recommended for general-purpose Python projects; acquisition is a specialized pattern most valuable in web frameworks that depend on it. ## Install pip install acquisition uv add acquisition poetry add acquisition ## Installing Acquisition Before you install: Medium install friction due to compiled extension requirements (wheels provided for Python 3.10–3.13 across multiple platforms). Actively maintained with recent releases; last commit 2026-08-14. Depends on ExtensionClass and zope.interface, both stable Zope ecosystem packages. License in practice: Licensed under ZPL-2.1 (Zope Public License 2.1), a permissive open-source license. License treatment is marked unclear in the fact sheet, so verify ZPL-2.1 compatibility with your project's legal requirements before use. Quickstart: import ExtensionClass from Acquisition import Implicit class Container(ExtensionClass.Base): color = 'red' class Item(Implicit): def get_color(self): return self.color container = Container() item = Item() container.item = item print(container.item.get_color()) # Outputs: red Requires ExtensionClass, a compiled C extension. Python 3.10 or later is required (supports 3.10, 3.11, 3.12, 3.13, 3.14). Verify before relying: - Whether ZPL-2.1 is compatible with your project's license requirements (license_treatment marked unclear). - Performance characteristics and overhead of acquisition wrappers in high-throughput scenarios. - Compatibility with non-CPython implementations beyond PyPy (classifier lists PyPy but no wheels provided). ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 181.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags attribute acquisition from containers, implicit object inheritance, zope acquisition pattern, runtime behavior from environment, container-based attribute lookup, zope-ecosystem, object-hierarchy, context-acquisition [View on SkillFed](https://skillfed.io/packages/acquisition) · [View on PyPI](https://pypi.org/project/acquisition/)