{"id":24430,"library":"pytest-item-dict","title":"pytest-item-dict","description":"A pytest plugin that provides a hierarchical dict of session.items, enabling easy access to test items by node ID or custom keys. Current version 1.1.2, requires Python >=3.11. Released as needed.","status":"active","version":"1.1.2","language":"python","source_language":"en","source_url":"https://github.com/anogowski/pytest-item-dict","tags":["pytest","plugin","test-collection","hierarchical-dict","item-dict"],"install":[{"cmd":"pip install pytest-item-dict","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Plugin extends pytest session","package":"pytest","optional":false}],"imports":[{"wrong":"from pytest_item_dict import item_dict","symbol":"item_dict","correct":"from pytest_item_dict import item_dict"}],"quickstart":{"code":"import pytest\nfrom pytest_item_dict import item_dict\n\npytest.main(['-v', '--collect-only'])\n# Access items via item_dict()\nitems = item_dict()\nprint(items.keys())","lang":"python","description":"Collect tests and get hierarchical dict."},"warnings":[{"fix":"Ensure pytest session has run before calling item_dict().","message":"item_dict() can only be called after pytest session has collected items, typically after a test run or --collect-only.","severity":"gotcha","affected_versions":"all"},{"fix":"Use node IDs as keys or extend the plugin for custom keys.","message":"The hierarchical dict keys are based on node IDs; custom keys require modifying the plugin.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.1.2':29 '3.11':32 'access':17 'collect':40 'current':27 'custom':25 'dict':4,12,43,46 'easi':16 'enabl':15 'hierarch':11,42 'hierarchical-dict':41 'id':23 'item':3,20,45 'item-dict':44 'key':26 'need':35 'node':22 'plugin':7,37 'provid':9 'pytest':2,6,36 'pytest-item-dict':1 'python':31 'releas':33 'requir':30 'session.items':14 'test':19,39 'test-collect':38 'version':28","created_at":"2026-05-01T08:13:01.794711+00:00","updated_at":"2026-05-01T08:13:01.794711+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'item_dict' from 'pytest_item_dict' (/tmp/tmpzdy_utn8/venv/lib/python3.12/site-packages/pytest_item_dict/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.3.7","cli_name":"pytest","cli_version":"pytest 9.0.3","type":"library","homepage":null,"github":"https://github.com/anogowski/pytest-item-dict","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pytest-item-dict/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}