Skip to main content

Fast Windows/Linux file and directory search engine library.

Project description

fastfind

fastfind is a lightweight python library that lets you search files or directories extremely fast on Windows/Linux in your code while providing high customizability.

Installation

Use the following command to install fastfind:

pip install fastfind

Usage

Make sure to first import the library before using it in your code.

import fastfind

Then you can search for a file/folder by using:

result = fastfind.search(query="hidden_file", search_type="any", max_results=1000, timeout=5.0, roots=["C:\\Users"], all_dirs=True, max_files_per_dir=30, exact_match=True, exclude_folders=["C:\\Program_Files"], exclude_keywords=[".txt"])

Argument Datatype Explanation Default Value
query str The name of the file/folder you want to search for. Here you can use Wildcards! Required
roots list[str] or None The root directories to search, if None are provided all drives and folders will be searched. None
exact_match bool When set to True, the given query has to exactly match the file/folders name instead of just containing it. False
search_type str, use: "any", "file" or "dir" Whether you want to search only for files, folders or both. any
max_results int How many results will be returned before stopping. 1000
timeout float The time in s of how long it takes before the library times out and stops searching. 5.0
all_dirs bool If set to True, all files, including system files, will be searched that would otherwise wouldn't be searched due to better performance. False
max_files_per_dir int or None Limts how many files can be output from one single directory. None
exclude_folders list[str] or None Folders whose content will be excluded in the search. The folder itself can still be found. All subfolders will still be searched. This is not affected by using all_dirs. None
exclude_keywords list[str] or None Excludes results that have these given keywords in them. Here you can use Wildcards! None

[!IMPORTANT] When you want to include all subfolders of a folder in "exclude_folders" or "roots" use '/Folder/Path/.' ! When only using '/Folder/Path/' all subfolders will still be searched (exclude_folders) or won't be searched (roots):

Example C:/Users C:/Users/User C:/Users/User/documents C:/Users/User/file.txt
exclude_folders=[r"C:/Users"] visible hidden visible visible
exclude_folders=[r"C:/Users/."] visible hidden hidden hidden

Wildcards

In the arguments query and exclude_keywords you can choose to use the wildcards * and ?.

* : Stands for any formation of letters/numbers/symbols of any length. So query="h*e" would return house and handsome.
? : Stands for one single character of any kind (letter/number/symbol). So query = "b?ll" would return ball and bell

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastfind-1.0.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastfind-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file fastfind-1.0.0.tar.gz.

File metadata

  • Download URL: fastfind-1.0.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for fastfind-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4d95793447ea4ee0939c00669391ab7fe76a2eb0a1ede809dea8811b389a01cf
MD5 c7c299c36fe575c9b6ac901a7f7f8c51
BLAKE2b-256 12f99b2c925263544964d41d8a022851f5269becd18cb1cd53834839bfffddfe

See more details on using hashes here.

File details

Details for the file fastfind-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fastfind-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for fastfind-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54a54088733484ebd3485645fb8fc64376d746f962fa216f551cc710b1c60632
MD5 7c5206e9041a25f59058edd29c43625d
BLAKE2b-256 e480ad3014d5ddad594a11c8dc49ef2a0562c6edeea8b42178deefea055805b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page