py_everything.search
¶
Source code: py_everything/search.py
This module deals with search operations, like files, lists, etc.
- py_everything.search.searchFiles(keyword, path)¶
Searches
path
for files matching withkeyword
.- Parameters
keyword (str) – Word to match files with
path (str) – Full path to directory to search in
- Returns list
List of matches
- py_everything.search.searchDirs(keyword, path)¶
Searches
path
for directories matching withkeyword
.- Parameters
keyword (str) – Word to match directories with
path (str) – Full path to directory to search in
- Returns list
List of matches
- py_everything.search.searchExts(keyword, path)¶
Searches
path
for file extensions matching withkeyword
.- Parameters
keyword (str) – Extension to match file extensions with
path (str) – Full path to directory to search in
- Returns list
List of matches
- py_everything.search.searchList(listOfTerms, query, filter='in)¶
Searches
listOfTerms
for terms matching withquery
.- Parameters
listOfTerms (str) – List to search in
query (str) – Word to verify matches with
filter – Specify way if searching. Choices - ‘in’, ‘start’, ‘end’, ‘exact’.
- Returns list
List of matches
Note
filter
is set to ‘in’ by default. ‘in’ - Checks ifquery
is in term. ‘start’ - Checks if term starts withquery
. ‘end’ - Checks if term ends withquery
. ‘exact’ - Checks if term ==query
.