Find files/folders in specific macOS directories using fuzzy search.
Project description
📁 directoryFinder_mac
directoryFinder_mac is a simple Python library that helps developers search for files or folders path by name using fuzzy matching logic inside specific directories (like Desktop, Documents, Downloads, etc.) on macOS.
It is especially useful in voice-assisted developer tools where interacting with the file system through speech is required.
🔧 Installation
pip install directoryFinder_mac
🚀Example Usage
from directoryFinder_mac import find_file_in_dirs
results = find_file_in_dirs("file_name", ["Desktop", "Documents"], cutoff=0.7)
print(results)
Output
['/Users/yourname/Desktop/file_name', '/Users/yourname/Documents/file_name']
⚙️Parameters
find_file_in_dirs(file_name, folder_names, cutoff=0.7)
-
file_name (str, required): The name of the file or folder you're searching for. Matching is case-insensitive and fuzzy.
-
folder_names (list, required): List of directories relative to the home directory to search in. Example: ["Desktop", "Downloads"] for mac.
-
cutoff (float, optional): Fuzzy matching threshold between 0 and 1. Default is 0.7. Higher means stricter matching.
🔍 How It Works – Fuzzy Matching Logic
Often while using speech recognition, minor misinterpretations can occur. For example:
- You say:
recognition dot pi - Actual file:
recognition.py
These types of small inconsistencies (like “dot pi” instead of “.py”) are common due to voice transcription errors or human inaccuracies.
To address this, directoryFinder_mac uses fuzzy matching behind the scenes. Fuzzy matching doesn’t require an exact match — instead, it finds the closest possible match to your spoken or typed input using a similarity score.
You can also control the tolerance level using the cutoff parameter:
cutoff=1.0→ Only exact matchescutoff=0.7→ Allows more relaxed matches (default)
Note: If there are mutiple folders or files with same name then you need to check my library directorySelector for handling it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file directoryfinder_mac-0.1.1.tar.gz.
File metadata
- Download URL: directoryfinder_mac-0.1.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca1d14cabede19b04f7e16a08e0ba981cbc1b3f44936af2f1b3a4be8aae5170a
|
|
| MD5 |
c5541450809f351b76108e3132ca6ca4
|
|
| BLAKE2b-256 |
74c7cb91ceadb1979dce6af9fbeefa1afe4eeaba0974a966a3238fc057033192
|
File details
Details for the file directoryfinder_mac-0.1.1-py3-none-any.whl.
File metadata
- Download URL: directoryfinder_mac-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e7f001bd01e1a40f0c71d1c7416fcd573a9ed84d81c6fe6a6629d5c2c6e70f7
|
|
| MD5 |
f9cc8c3ccafa1ed66139fd22b12bd9e0
|
|
| BLAKE2b-256 |
4ef5c92b362e46ea8841f11da44bd5db69a47132643571bbdd80be8ffb36b941
|