Mission:
dirmagic
tells you what type of project/directory structure you're dealing with.
... just like file
/libmagic
for files.
Read more in the documetation
Install:
pip install git+https://github.com/achimgaedke/python-dirmagic.git
Simple examples:
Find all directories containing a python package:
import dirmagic import find_projects, project_types
find_projects(
"/home/achim/Code",
project_types.is_python_project
)
Find the DVC root in your parent directories:
from dirmagic import find_root, project_types
find_root(".", project_types.dvc_repository)
Identify project types contained in directory:
from dirmagic import identify_project
identify_project("Code/some_repo")
See Use Cases for more...