Skip to content

A grep like python utility to perform fast searches for patterns in files and/or directories containing these files.

Notifications You must be signed in to change notification settings

sauravbiswasiupr/HydraGrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Hydra

Welcome to HydraGrep. HydraGrep is a grep like utility that lets you search for patterns in single files or directories containing files. It is by no means a distributed log search engine (atleast as of now). It uses multiprocessing to search for the requested pattern recursively, starting from the provided directory.

Usage

hydragrep.py [-h] [-d BASEDIR] [-p PATTERN]

optional arguments:
  -h, --help  show this help message and exit
  -d BASEDIR  Directory to invoke hydragrep
  -p PATTERN  Pattern to search

Differences with UNIX grep

HydraGrep uses a ProcessPoolExecutor from the concurrent.futures module in the background. It defaults to the system default for the number of parallel workers to use in the pool.

Inherently, UNIX grep is not parallelizable by default. It needs to be invoked with xargs to be parallelized. There is no such external requirement for HydraGrep. It will, by default, use the maximum number of cores available on the machine.

Inspiration

The name HydraGrep is inspired by the Greek Mythological beast called Hydra which was a serpentine monster with many heads. The heads are analogous to the many threads it uses to run the scans.

About

A grep like python utility to perform fast searches for patterns in files and/or directories containing these files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages