In my opinion, a good idea would be to either have a project directory structure that you can use a signature for the project/framework, that you can use within the tool as a list of signature-like structures, for example
PROJECT_STRUCTURE_SIGNATURES = [ "custom_project", "custom_project/tests", "custom_project/build", "custom_project/config", "config/environments" ]
and then just check if any(signature in os.getcwd() for signature in PROJECT_STRUCTURE_SIGNATURES)
.
if the project structure is not too complex, I suppose that would be a start in order to identify the requirements that you're looking for.
However, if this is not the case, then I suppose a dictionary-like structure that you could use to traverse the key-value pairs similar to the project's file structure and check the current directory against those would be a better idea, where if none of the elements from the nested dictionary traversal matches, then the directory is not within the project structure.