project_path is a Python library designed to help you easily locate the path of your project by searching for specific files in the current directory and its parent directories.
pip install prjpath.
get_project_path(add_to_PATH=True) This function returns the path of the project by checking for the existence of either 'main.py' or 'README.md' in the current directory or its parent directories. If found, it returns that path; otherwise, it moves one directory up until it reaches the root. If the root is reached, it returns the path where the script using the library is located.
add_to_PATH (bool, optional): If True, adds the project path to sys.path. Defaults to False.
str: The path of the project.
path_to_be_appended (str, optional):
The path to be appended to sys.path. Defaults to the project path obtained from get_project_path().
bool :True if it was added correctly, False otherwise
Contributions are always welcome!