Skip to main content

Simple CLI application for searching keywords/phrases or regular expression patterns from text files.

Project description

find-it

Simple CLI application for searching keywords/phrases or regular expression patterns from text files.

Usage

usage: find-from-files [-h] [-l] [-r] [-s [SUFFIX ...]] [-S [SKIP ...]] [-a]
  [-q] [-qq] base_directory search_string

This script can be useful, e.g., for analyzing log files. When used without the
--regex flag, it traverses through directories starting from the
<base_directory> and prints the name of the file containing <search_string> and
the line that it is on. This is handy if you want to quickly find the files
that contain the string you are looking for. When used with the --regex flag,
it searches for the <search_string> with Python regular expression function
re.findall() in the files, and prints a summary containing the matches and
their number. This allows you to search for all occurrences of a pattern in
files. If the --whole-line flag is used, the whole line is printed instead of
just the match (does nothing without the --regex flag).

positional arguments:
  base_directory        Base directory to start the search from.
  search_string         String/regex to search for.

options:
  -h, --help            show this help message and exit
  -l, --whole-line      Search for the whole line containing the search string.
                        Only works with the --regexp flag.
  -r, --regexp          Search using regular expression.
  -s, --suffix [SUFFIX ...]
                        File suffix to search for. Files without this suffix
                        will be skipped.
  -S, --skip [SKIP ...]
                        Skip folders that start with this prefix.
  -a, --no-ansi         Do not use ANSI codes for output. Redirections never
                        contain ANSI codes.
  -q, --quiet           Do not print skipped folders or files.
  -qq, --quieter        Do not print skipped folders or files, and only print
                        the files that contain the search string/pattern.

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

find_from_files-1.0.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

find_from_files-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: find_from_files-1.0.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for find_from_files-1.0.0.tar.gz
Algorithm Hash digest
SHA256 37bb15539d3cab5d326f2ed842432c724d4e0189eb1669b51e4847c4368ec5a3
MD5 aaa2bac7ce7f3875118269a63139215a
BLAKE2b-256 f35b7c37f76dd9b3fb6c77df966365946e2467de3f3b6ac90ab3f69430b076d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: find_from_files-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for find_from_files-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c48e8a048c039bd7900387a955e5884d7ad752dec69eb9f1bcdcc0bfe6d3f5c4
MD5 c9a6fade06fe4ffac3e4b188cd860c46
BLAKE2b-256 06c697e3d29dcba1300b1d2ad54c436ab184d1db0965ef279f3beb2d07d16b4b

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