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 with keyword.

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 with keyword.

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 with keyword.

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 with query.

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 if query is in term. ‘start’ - Checks if term starts with query. ‘end’ - Checks if term ends with query. ‘exact’ - Checks if term == query.