Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ZCatalog
✓ from Products.ZCatalog.ZCatalog import ZCatalog
✗ from ZCatalog import ZCatalog
ZCatalog is a Zope product, must be imported from Products package
Catalog
✓ from Products.ZCatalog.Catalog import Catalog
✗ from ZCatalog.Catalog import Catalog
Same as above, wrong top-level package
CatalogBrains
✓ from Products.ZCatalog.CatalogBrains import CatalogBrains
✗ from ZCatalog.CatalogBrains import CatalogBrains
Common mistake: omitting Products.
Create a ZCatalog, add a field index, catalog a dictionary, and search. Requires a Zope environment.
from Products.ZCatalog.ZCatalog import ZCatalog
catalog = ZCatalog('my_catalog')
catalog.addIndex('title', 'FieldIndex')
doc = {'id': 1, 'title': 'Hello World'}
catalog.catalog_object(doc, doc['id'])
results = catalog.searchResults(title='Hello')
print(len(results))
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'ZCatalog'
Importing without the Products prefix.
fixUse 'from Products.ZCatalog.ZCatalog import ZCatalog'.
TypeError: catalog_object() argument 1 must be a dictionary or persistent object, not X
Passing a non-compliant object without an id.
fixPass a dictionary with an 'id' key or a persistent object.
KeyError: 'id'
Object missing an 'id' key.
fixInclude an 'id' key in the dictionary or ensure the persistent object has an id attribute.
Upgrade
Version history
7.3latest on PyPI · released Nov 22, 2025
Audit
Dependencies
ZoperequiredZCatalog is designed to run inside Zope
BTreesrequiredUsed for persistent indexing structures
zope.interfacerequiredInterface definitions