{"id":5607,"library":"diraccommon","title":"DIRAC Common Utilities","description":"diraccommon is a Python library providing stateless utilities extracted from the main DIRAC framework for use by DiracX and other projects. As of version 9.1.6, it requires Python 3.11 or later and is actively maintained with frequent integration releases, indicating a rapid development and release cadence.","status":"active","version":"9.1.6","language":"en","source_language":"en","source_url":"https://github.com/DIRACGrid/DIRAC","tags":["DIRAC","utility","common","HEP","grid","workflow","stateless"],"install":[{"cmd":"pip install diraccommon","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Common return value objects often used in DIRAC projects. While 'diraccommon' provides utilities, these are fundamental throughout DIRAC.","symbol":"S_OK, S_ERROR","correct":"from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR"},{"note":"Specific utility imports will vary depending on the functionality required. 'diraccommon' typically exposes modules under the 'DIRAC.Core.Utilities' namespace.","symbol":"get_example_value","correct":"from DIRAC.Core.Utilities.SomeUtilityModule import get_example_value"}],"quickstart":{"code":"from DIRAC.Core.Utilities.List import uniqueElements\n\nmy_list = [1, 2, 2, 3, 4, 4, 5]\nunique_items = uniqueElements(my_list)\n\nprint(f\"Original list: {my_list}\")\nprint(f\"Unique elements: {unique_items}\")","lang":"python","description":"This example demonstrates using a common utility function, `uniqueElements`, from `DIRAC.Core.Utilities.List` to process a list. Many of `diraccommon`'s utilities reside within the `DIRAC.Core.Utilities` sub-packages."},"warnings":[{"fix":"Ensure your Python environment is version 3.11 or newer before upgrading or installing `diraccommon`.","message":"Python version requirement changed to 3.11 or higher. Older Python environments (e.g., 3.10 and below) are no longer supported.","severity":"breaking","affected_versions":"9.0.0+"},{"fix":"For existing DIRAC deployments, administrators must follow the recommended MySQL and CS deployment steps detailed in the release notes for v9.1.1, including `DROP TABLE AccountingCache;` and removing specific CS entries.","message":"Database schema changes were introduced in version 9.1.1, including the removal of the `AccountingCache` table from `ResourceManagementDB` and removal of `ResourceStatus/StatusTypes` entries from CS.","severity":"breaking","affected_versions":"9.1.1+"},{"fix":"Administrators upgrading existing DIRAC deployments to 9.1.0 or later must execute the recommended MySQL changes, including ALTER TABLE and DROP TABLE statements, as described in the v9.1.0 release notes.","message":"Significant database schema changes were introduced in version 9.1.0, including new indices on `JobDB.Jobs` and `PilotAgentsDB.PilotAgents`, and the dropping of `NodeHistory`, `NodeLog`, and `NodeStatus` tables from `ResourceStatusDB`.","severity":"breaking","affected_versions":"9.1.0+"},{"fix":"Update any scripts or configurations that use `--diracx-dist-dir` to use `--diracx-src-dir` instead.","message":"The CLI argument `--diracx-dist-dir` was replaced with `--diracx-src-dir` in related `DiracX` components. Users migrating or updating scripts that interact with `DiracX` via CLI should be aware of this change.","severity":"gotcha","affected_versions":"9.1.3+"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}