{"id":3980,"library":"domdf-python-tools","title":"Helpful functions for Python","description":"domdf-python-tools is a Python library providing a comprehensive collection of helpful functions and tools for various development tasks, encompassing utilities for strings, paths, dates, and more. It is actively maintained with a regular release cadence, primarily focusing on minor and patch updates. The current version is 3.10.0.","status":"active","version":"3.10.0","language":"en","source_language":"en","source_url":"https://github.com/domdfcoding/domdf_python_tools","tags":["utilities","tools","development","path","string","documentation","helpers"],"install":[{"cmd":"pip install domdf-python-tools","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Requires Python 3.6 or newer.","package":"python","optional":false}],"imports":[{"note":"A utility function to convert string representations of truth to True or False.","symbol":"true_str","correct":"from domdf_python_tools.utils import true_str"},{"note":"A subclass of list that supports custom delimiters in format strings.","symbol":"StringList","correct":"from domdf_python_tools.stringlist import StringList"},{"note":"A subclass of pathlib.Path with additional methods and a default encoding of UTF-8.","symbol":"PathPlus","correct":"from domdf_python_tools.paths import PathPlus"}],"quickstart":{"code":"from domdf_python_tools.utils import true_str\nfrom domdf_python_tools.stringlist import StringList\nfrom domdf_python_tools.paths import PathPlus\nimport os\n\n# Using a utility function\nprint(f\"Converting 'True' to boolean: {true_str('True')}\")\nprint(f\"Converting 'false' to boolean: {true_str('false')}\")\n\n# Using StringList for custom delimited output\nmy_list = StringList([1, 2, 3], delimiter=\"|\")\nprint(f\"Custom delimited list: {my_list}\")\n\n# Using PathPlus for extended path operations\ncurrent_dir = PathPlus(os.getcwd())\nprint(f\"Current directory path (PathPlus): {current_dir}\")\nprint(f\"Is current directory a directory? {current_dir.is_dir()}\")\n","lang":"python","description":"This quickstart demonstrates key utilities from `domdf-python-tools`, including boolean string conversion, custom delimited lists, and extended `pathlib.Path` functionality."},"warnings":[{"fix":"Review the MIT License for compliance if migrating from an LGPLv3+ licensed version.","message":"The license changed from LGPLv3+ to MIT License starting with version 3.0.0. Users upgrading from versions prior to 3.0.0 should be aware of this license change.","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Always use `import domdf_python_tools` or `from domdf_python_tools import ...` in your Python code after installing with `pip install domdf-python-tools`.","message":"The PyPI package name is `domdf-python-tools` (with hyphens), but the Python import name uses underscores: `domdf_python_tools`. This is a common pattern but can trip up new users.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure you are using the latest available version of `domdf-python-tools` and check its release notes for explicit compatibility with the target Python version. If encountering issues with Python 3.14 or newer, consider checking for distribution-specific patches or reporting an upstream issue if using the latest library version.","message":"Some versions of `domdf-python-tools` (e.g., prior to a fix in Fedora's `3.9.0-7.fc43` package) have exhibited compatibility issues with newer Python versions, specifically Python 3.14, leading to `AssertionError` in tests related to string processing (e.g., `test_words.py::test_alpha_sort`).","severity":"gotcha","affected_versions":"<3.9.0 (and potentially others with Python 3.14+)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}