Skip to main content

CLI tool for listing paths in the base directory

Project description

fs-search

fs-search is a command-line tool that allows you to search for files and directories within a specified base path. You can customize your search by including or excluding specific file extensions and directories, and the results can be displayed in a user-friendly format with options to save them to a file.

Features

  • Search for files and directories starting from a specified base path.
  • Exclude files based on extensions (-e).
  • Exclude directories from the search (-E).
  • Search only for files (-f) or only for directories (-d).
  • Save the results to a file (-o).
  • Display relative paths instead of full paths (-r).
  • Supports cross-platform usage with pathlib.
  • Colorful output using colorama.
  • Easily extendable for future features.

Installation

You can install fs-search via pip:

pip install fs-search

Usage

Basic Search

Search the current directory for files and directories:

fs-search

Exclude File Extensions

Exclude specific file extensions from the search:

fs-search -e .log -e .tmp

Exclude Directories

Exclude specific directories from the search:

fs-search -E node_modules -E .git

Search Only Files

Search only for files (excluding directories):

fs-search -f

Search Only Directories

Search only for directories (excluding files):

fs-search -d

Save Results to a File

Save the search results to a file:

fs-search -o results.txt

Display Relative Paths

Display relative paths instead of full paths:

fs-search -r

Combine Options

You can combine multiple options:

fs-search -b /path/to/search -e .log -E node_modules -f -o results.txt

Development

To contribute to fs-search, you can clone the repository and install the necessary dependencies:

git clone https://github.com/voyager-2021/fs-search.git
cd fs-search
pip install -e .[dev]

Running Mypy

Run mypy before commiting. To run mypy (using mypy), simply run:

mypy search_fs --strict

Todo

Optimize lol.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project Links

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

fs_search-0.1.1.tar.gz (179.6 kB view details)

Uploaded Source

Built Distribution

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

fs_search-0.1.1-cp312-cp312-win_amd64.whl (89.5 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file fs_search-0.1.1.tar.gz.

File metadata

  • Download URL: fs_search-0.1.1.tar.gz
  • Upload date:
  • Size: 179.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for fs_search-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e73c072c960b9c88d647791543f40c22e55de6cde350ce39c21c90bd4b9ea519
MD5 3c2be12deec97bc2c64aa20d1b873938
BLAKE2b-256 70e3a9740acf459b8e28cc17d2562716421cbfa4b119116bca2825d43265cc1c

See more details on using hashes here.

File details

Details for the file fs_search-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fs_search-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 89.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for fs_search-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3646c698264f0c81d21b56528b5600f0937d6c6fa597894b4321e109411da0c9
MD5 7ff9ac8ad8ebe4a69dd03a918095495a
BLAKE2b-256 fb74e2d653baae741a861c572611877d843fb8cf98f098edb6c1fd114f620132

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