Skip to main content

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 matches
  • cutoff=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


Download files

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

Source Distribution

directoryfinder_mac-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

directoryfinder_mac-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file directoryfinder_mac-0.1.0.tar.gz.

File metadata

  • Download URL: directoryfinder_mac-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for directoryfinder_mac-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7fdbcddbaf802ab84b5e93e50135ad0aea8ee62bd54ea1d09509ca05b6bf7c31
MD5 7ab7a2e21b692f7dffbe35e85ec37fbc
BLAKE2b-256 8bede8f451af659e6d27e8fec7f0febef6d1151c13a29e122e18a34121d3d285

See more details on using hashes here.

File details

Details for the file directoryfinder_mac-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for directoryfinder_mac-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9346266ffb7d7bd80315dbe9bc7eac9cef37a4f6b8e524bee71572152d77aaad
MD5 069470e1d47edf888f76135c8e48ff70
BLAKE2b-256 38868aeb593eb6211ea35d02b9723ff3995a6daadba2317fc2d4830832496ef7

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