skillfed

zope.container

Zope Container

zope-container v7.2 157.5K downloads/30d#10,753 on PyPI4
License unclear ZPL-2.1 Active released

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-container

uv

uv add zope-container

poetry

poetry add zope-container

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: Zope :: 3Intended Audience :: DevelopersLicense :: OSI Approved :: Zope Public LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTP

Tags

zope container object managementbtree container implementationordered container zopezope object containmentzope traversal and containerspersistent object containerszope folder implementation
zope-frameworkobject-persistencebtree-storage

More WWW/HTTP packages