{"id":45837,"library":"products-zcatalog","title":"ZCatalog","description":"ZCatalog is Zope's indexing and search solution, providing full-text, field, and keyword indexing with a catalog-like API. Version 7.3 supports Python >=3.10. It is part of the Zope ecosystem, released on a rolling basis.","status":"active","version":"7.3","language":"python","source_language":"en","source_url":"https://github.com/zopefoundation/Products.ZCatalog","tags":["zope","catalog","indexing","search","ZODB"],"install":[{"cmd":"pip install products-zcatalog","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"ZCatalog is designed to run inside Zope","package":"Zope","optional":false},{"reason":"Used for persistent indexing structures","package":"BTrees","optional":false},{"reason":"Interface definitions","package":"zope.interface","optional":false}],"imports":[{"note":"ZCatalog is a Zope product, must be imported from Products package","wrong":"from ZCatalog import ZCatalog","symbol":"ZCatalog","correct":"from Products.ZCatalog.ZCatalog import ZCatalog"},{"note":"Same as above, wrong top-level package","wrong":"from ZCatalog.Catalog import Catalog","symbol":"Catalog","correct":"from Products.ZCatalog.Catalog import Catalog"},{"note":"Common mistake: omitting Products.","wrong":"from ZCatalog.CatalogBrains import CatalogBrains","symbol":"CatalogBrains","correct":"from Products.ZCatalog.CatalogBrains import CatalogBrains"}],"quickstart":{"code":"from Products.ZCatalog.ZCatalog import ZCatalog\ncatalog = ZCatalog('my_catalog')\ncatalog.addIndex('title', 'FieldIndex')\ndoc = {'id': 1, 'title': 'Hello World'}\ncatalog.catalog_object(doc, doc['id'])\nresults = catalog.searchResults(title='Hello')\nprint(len(results))","lang":"python","description":"Create a ZCatalog, add a field index, catalog a dictionary, and search. Requires a Zope environment."},"warnings":[{"fix":"Update imports to use Products.ZCatalog prefix.","message":"The old import path 'from ZCatalog import ZCatalog' is deprecated and removed in recent versions. Use 'from Products.ZCatalog.ZCatalog import ZCatalog'.","severity":"deprecated","affected_versions":">=6.0"},{"fix":"Upgrade to Python 3.10 or later.","message":"Python 3.10+ required as of version 7.x. Dropped Python 2.7 and 3.8 support.","severity":"breaking","affected_versions":">=7.0"},{"fix":"Ensure objects passed to catalog_object are persistent subclasses or dict with 'id'.","message":"ZCatalog uses persistent storage (ZODB). Objects must be persistent or dict-like with an 'id' key. Non-persistent objects may cause transaction errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'3.10':28 '7.3':25 'api':23 'basi':40 'catalog':21,42 'catalog-lik':20 'ecosystem':35 'field':14 'full':12 'full-text':11 'index':6,17,43 'keyword':16 'like':22 'part':31 'provid':10 'python':27 'releas':36 'roll':39 'search':8,44 'solut':9 'support':26 'text':13 'version':24 'zcatalog':1,2 'zodb':45 'zope':4,34,41","created_at":"2026-06-07T12:56:58.652834+00:00","updated_at":"2026-06-07T12:56:58.652834+00:00","problems":[{"fix":"Use 'from Products.ZCatalog.ZCatalog import ZCatalog'.","cause":"Importing without the Products prefix.","error":"ModuleNotFoundError: No module named 'ZCatalog'"},{"fix":"Pass a dictionary with an 'id' key or a persistent object.","cause":"Passing a non-compliant object without an id.","error":"TypeError: catalog_object() argument 1 must be a dictionary or persistent object, not X"},{"fix":"Include an 'id' key in the dictionary or ensure the persistent object has an id attribute.","cause":"Object missing an 'id' key.","error":"KeyError: 'id'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/zopefoundation/Products.ZCatalog","github":"https://github.com/zopefoundation/Products.ZCatalog","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}