GithubHelp home page GithubHelp logo

am0stafa / file-search-cli Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 7 KB

A CLI tool that searches for a file in a given directory either by name or extension and also always for fuzzy search

Python 100.00%
cli fuzzing search

file-search-cli's Introduction

CLI File Search Tool

This is a command-line tool for searching for files in a given directory. It allows for searching by name or extension, and also includes fuzzy search functionality to allow for more flexible searching.

Prerequisites

To run this tool, you'll need to have Python 3 installed on your machine. You'll also need to install the argparse and fuzzywuzzy packages using pip:

pip install argparse fuzzywuzzy

Usage

To use the tool, open a terminal window and navigate to the directory containing the search.py file. Then, run the following command:

python search.py [-h] [-f FILE] [-e EXTENSION] [-fz FUZZY] [-p PATH]

The tool takes several optional arguments:

  • -h, --help: Shows the help message and exits.
  • -f FILE, --file FILE: The name of the file to search for.
  • -e EXTENSION, --extension EXTENSION: The file extension to search for. You can specify multiple extensions separated by commas.
  • -fz FUZZY, --fuzzy FUZZY: A fuzzy search query for the file name.
  • -p PATH, --path PATH: The path to start searching from. If not specified, the tool will search in the current directory.

Examples

To search for a file named main.py in the current directory and its subdirectories:

To search for all Python files in the /home/user/projects directory and its subdirectories:

** its important to note that sometimes you will need to put the search.py file in the root directory

Limitations

This tool has a few limitations to keep in mind:

  • The search functionality only works with files, not directories.
  • The fuzzy search algorithm may not always return the expected results, particularly if the search query is very similar to multiple file names in the directory. It's recommended

file-search-cli's People

Contributors

am0stafa avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.