Helpful functions for Python

3.10.0 · active · verified Sat Apr 11

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.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates key utilities from `domdf-python-tools`, including boolean string conversion, custom delimited lists, and extended `pathlib.Path` functionality.

from domdf_python_tools.utils import true_str
from domdf_python_tools.stringlist import StringList
from domdf_python_tools.paths import PathPlus
import os

# Using a utility function
print(f"Converting 'True' to boolean: {true_str('True')}")
print(f"Converting 'false' to boolean: {true_str('false')}")

# Using StringList for custom delimited output
my_list = StringList([1, 2, 3], delimiter="|")
print(f"Custom delimited list: {my_list}")

# Using PathPlus for extended path operations
current_dir = PathPlus(os.getcwd())
print(f"Current directory path (PathPlus): {current_dir}")
print(f"Is current directory a directory? {current_dir.is_dir()}")

view raw JSON →