zope.container
Zope Container
What it is and what it does
zope.container is a foundational package in the Zope web framework ecosystem that defines interfaces and provides implementations for container objects—data structures that hold and manage other objects. It supplies two main container types: BTreeContainer, which uses B-tree storage for scalable key-value access, and OrderedContainer, which preserves insertion order. The package also serves as the base for zope.site.folder's Folder implementation. It integrates deeply with Zope's component architecture, persistent object storage, security model, and event system through its 19 runtime dependencies.
The package is used in applications that need to organize persistent objects hierarchically, support traversal and lookup by name, emit lifecycle events when objects are added or removed, and maintain compatibility with Zope's interface-based design patterns. It handles both text and byte keys, supports the PURE_PYTHON environment variable for debugging, and provides utilities like NameChooser for generating unique object names within a container.
Use it for:
- Building hierarchical object stores in Zope applications where containers hold and manage persistent objects with named access.
- Implementing folder-like structures that preserve insertion order or optimize for large datasets using B-tree storage.
- Integrating container lifecycle events (add, remove, modify) into Zope's event system for reactive application logic.
- Developing Zope-based CMS or document management systems that require object containment and traversal.
- Creating custom container types by inheriting from BTreeContainer or OrderedContainer with Zope interface compliance.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides container interfaces and implementations (BTreeContainer, OrderedContainer) for organizing and managing objects in Zope-based applications, with support for object containment, traversal, and lifecycle events.
Yes, if you are building a Zope-based application or framework that requires object containment and lifecycle management. The package is actively maintained, supports modern Python versions (3.10–3.14), has no known vulnerabilities, and is well-integrated into the Zope ecosystem. However, verify that ZPL-2.1 is compatible with your project's license requirements (marked unclear), and be aware of the 19 runtime dependencies—this is a heavyweight addition suitable for Zope-centric projects, not a lightweight utility.
Install
zope-container on PyPI
pip
pip install zope-containeruv
uv add zope-containerpoetry
poetry add zope-containerInstalling zope.container
Before you install
Medium install friction due to 19 runtime dependencies spanning the Zope ecosystem (BTrees, persistent, zope.interface, zope.security, zope.schema, and others). Maintenance is active with recent releases; the package requires Python 3.10+ and has dropped older Python versions progressively. Pre-built wheels available for multiple platforms reduce friction on standard architectures.
License in practice
Licensed under ZPL-2.1 (Zope Public License 2.1), which is OSI-approved but less common than MIT or Apache 2.0. The license treatment is marked unclear in the fact sheet, so verify compatibility with your project's license policy before adoption.
Quickstart
from zope.container.btree import BTreeContainer
from zope.container.ordered import OrderedContainer
container = BTreeContainer()
container['key'] = some_object
Requires Python 3.10 or later; a full Zope environment with persistent object support is typically needed for practical use.
Verify before relying
- Whether ZPL-2.1 is compatible with your project's license requirements (marked 'unclear' in metadata).
- Performance characteristics of BTreeContainer vs OrderedContainer for your specific use case.
- Integration requirements with zope.site.folder and other Zope framework components.
Package facts
| License | ZPL-2.1 (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 19 — BTrees, persistent, zope.cachedescriptors, zope.component, zope.deferredimport, zope.dottedname, zope.event, zope.filerepresentation, zope.i18nmessageid, zope.interface, zope.lifecycleevent, zope.location, zope.proxy, zope.publisher, zope.schema, zope.security, zope.size, zope.traversing, setuptools |
| Maintenance | actively maintained — 272 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 157,542/month — #10,753 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zope_container-7.2-cp310-cp310-macosx_10_9_x86_64.whl; zope_container-7.2-cp310-cp310-macosx_11_0_arm64.whl; zope_container-7.2-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zope_container-7.2-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; zope_container-7.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zope_container-7.2-cp310-cp310-win_amd64.whl; zope_container-7.2-cp311-cp311-macosx_10_9_x86_64.whl; zope_container-7.2-cp311-cp311-macosx_11_0_arm64.whl; zope_container-7.2-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zope_container-7.2-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; zope_container-7.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zope_container-7.2-cp311-cp311-win_amd64.whl; zope_container-7.2-cp312-cp312-macosx_10_9_x86_64.whl; zope_container-7.2-cp312-cp312-macosx_11_0_arm64.whl; zope_container-7.2-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zope_container-7.2-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; zope_container-7.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zope_container-7.2-cp312-cp312-win_amd64.whl; zope_container-7.2-cp313-cp313-macosx_10_9_x86_64.whl; zope_container-7.2-cp313-cp313-macosx_11_0_arm64.whl
Keywords: zope, container
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
BTreesBTrees provides persistent, scalable B-tree…
unclear · top 15,000 on PyPI
zope.annotationStores additional metadata on objects without…
unclear · top 15,000 on PyPI
zope.locationProvides a structural location system for Zope…
unclear · top 15,000 on PyPI
zope.traversingResolves object paths by traversing an object…
unclear · top 15,000 on PyPI
zope.filerepresentationDefines interfaces for representing objects as…
unclear · top 15,000 on PyPI
zope.proxyzope.proxy provides transparent wrapper objects…
unclear · top 15,000 on PyPI
zope.componentImplements the core Zope Component Architecture…
unclear · top 5,000 on PyPI
PersistenceProvides a persistent base class built on…
unclear · top 15,000 on PyPI
zope.interfaceProvides a Python implementation of object…
unclear · top 1,000 on PyPI
zope.lifecycleeventDefines event objects and API functions for…
unclear · top 15,000 on PyPI