{"id":23944,"library":"label-studio-tools","title":"Label Studio Tools","description":"Common tools for Label Studio, including data loading, config parsing, and video keyframe extraction. Current version is 0.0.4, requires Python >=3.6, and is maintained by HumanSignal (formerly Heartex). Releases are infrequent.","status":"active","version":"0.0.4","language":"python","source_language":"en","source_url":"https://github.com/heartexlabs/label-studio-tools","tags":["label-studio","data-labeling","ml","annotation-tools"],"install":[{"cmd":"pip install label-studio-tools","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Wrong import path; correct path includes 'core' module.","wrong":"from label_studio_tools.utils.io import get_local_path","symbol":"get_local_path","correct":"from label_studio_tools.core.utils.io import get_local_path"},{"note":"Missing 'core' leads to ImportError.","wrong":"from label_studio_tools.utils.config import parse_config","symbol":"parse_config","correct":"from label_studio_tools.core.utils.config import parse_config"},{"note":"Wrong import path; correct path includes 'core'.","wrong":"from label_studio_tools.video import is_video_object_tracking","symbol":"is_video_object_tracking","correct":"from label_studio_tools.core.video import is_video_object_tracking"}],"quickstart":{"code":"from label_studio_tools.core.utils.io import get_local_path\nfrom label_studio_tools.core.utils.config import parse_config\n\n# Parse a Label Studio config XML string\nconfig_xml = \"\"\"<View><Text name=\"text\" value=\"$text\"/><Choices name=\"label\" toName=\"text\"><Choice value=\"A\"/><Choice value=\"B\"/></Choices></View>\"\"\"\nparsed = parse_config(config_xml)\nprint(parsed)\n\n# Get local path for a task's data (requires LS_API_KEY env var for non-local storage)\nimport os\nos.environ['LS_API_KEY'] = os.environ.get('LS_API_KEY', '')\n# task_id is needed for storage downloads; for local files, just provide the path\ntry:\n    path = get_local_path('/path/to/data', task_id=123)\n    print(path)\nexcept Exception as e:\n    print(e)","lang":"python","description":"Parse a config XML and get local path for a file. For storage downloads, set LS_API_KEY environment variable and provide a task_id."},"warnings":[{"fix":"Set LS_API_KEY environment variable and pass a valid task_id to get_local_path to use cloud storage. For local files, ensure the path is a local file.","message":"In version 0.0.4, get_local_path now requires LS_API_KEY and a valid task_id to download files from cloud storage. If you omit these, it may fall back to local path or raise an error. Breaking change from earlier versions that did not support cloud storage.","severity":"breaking","affected_versions":">=0.0.4"},{"fix":"Use imports with 'core' module: from label_studio_tools.core.utils.io import get_local_path","message":"The package structure changed between 0.0.1 and 0.0.2. Import paths include 'core' (e.g., label_studio_tools.core.utils.io). Attempting flat imports (label_studio_tools.utils.io) will fail.","severity":"gotcha","affected_versions":">=0.0.2"},{"fix":"Ensure you treat the output as a dict for further processing.","message":"parse_config returns a dictionary; not a string or an object with methods. Do not call it expecting a string representation.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install label-studio-tools' and ensure you are using the correct Python interpreter.","cause":"Package not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'label_studio_tools'"},{"fix":"Upgrade to version 0.0.2+: 'pip install --upgrade label-studio-tools'. Then use correct import paths.","cause":"Likely installed very old version (0.0.1) where 'core' didn't exist, or import path is wrong.","error":"AttributeError: module 'label_studio_tools' has no attribute 'core'"},{"fix":"Set the environment variable LS_API_KEY to your Label Studio API key, or use get_local_path only with local file paths.","cause":"Missing LS_API_KEY when using get_local_path with a non-local URL (e.g., cloud storage).","error":"ValueError: You must set LS_API_KEY environment variable to use get_local_path for storage downloads."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}