Registry / database / zope.index

zope.index

JSON →
library8.1pypypi✓ verified 87d ago

Provides index implementations (field, text, set, etc.) for use with cataloging systems. Version 8.1, requires Python 3.10+. Maintenance mode.

pip install zope.index
INSTALL
IMPORT
SIG · ZOPE.INDEX
Z
zope.index
databasepythonv8.1
harness data pending
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.

FieldIndex
✓ from zope.index.field import FieldIndex
✗ from zope.index import FieldIndex
FieldIndex is in the field submodule, not top-level.
TextIndex
✓ from zope.index.text import TextIndex
✗ from zope.index import TextIndex
TextIndex is in the text submodule.
SetIndex
✓ from zope.index.set import SetIndex
✗ from zope.index import SetIndex
SetIndex is in the set submodule.

Create a FieldIndex, index two objects, search for one.

from zope.index.field import FieldIndex index = FieldIndex() index.index_object(1, 'value1') index.index_object(2, 'value2') hits = index.search({'any_of': ('value1',)}) print(hits) # Result: {1: 1}
Debug
Known issues
deprecatedzope.index is in maintenance mode. No new features likely. Consider alternatives if starting fresh.
fix
Evaluate if you need full Zope catalog stack; many use cases can be replaced with plain dicts.
affects: >=8.0
gotchaAfter indexing, you must explicitly apply pending updates via index.updateIndex() for some index types (e.g., SetIndex) before search works.
fix
Call index.updateIndex() after batch indexing operations to flush changes.
affects: All
Errors
Common errors & fixes
AttributeError: module 'zope.index' has no attribute 'FieldIndex'
Importing from top-level instead of submodule.
fix
Use 'from zope.index.field import FieldIndex'
zope.interface.interface.InvalidInterface: '...' is not a valid interface
Incorrect interface passed to index constructor (e.g., fieldname wrong).
fix
Check that the interface attribute exists and matches the name expected by the index.
Upgrade
Version history
8.1latest on PyPI · released Nov 18, 2025
Audit
Dependencies
zope.interfacerequiredCore dependency for interface declarations.
Agent activity
38 hits · last 30 days
node
32
OpenAI (training)
1
Resources
zope.index — pip install zope.index · libregistry