lsfiles

Path object VC index.

class lsfiles.LSFiles[source]

Bases: MutableSequence[Path]

Index all Python files in project.

args(reduce: bool = False) tuple[str, ...][source]

Return tuple suitable to be run with starred expression.

Parameters:
reduce: bool = False

reduce()

Returns:

Tuple of Path objects or str repr.

populate(exclude: str | None = None) None[source]

Populate object with index of versioned Python files.

Parameters:
exclude: str | None = None

List of paths to exclude.

reduce() list[_Path][source]

Get all relevant python files starting from project root.

Returns:

List of project’s Python file index, reduced to their root, relative to $PROJECT_DIR. Contains no duplicate items so $PROJECT_DIR/dir/file1.py and $PROJECT_DIR/dir/file2.py become $PROJECT_DIR/dir but PROJECT_DIR/file1.py and $PROJECT_DIR/file2.py remain as they are.