Skip to main content

"Universal" Text Finder

Test Status Coverage Status

It's basically just grep in python... Nothing fancy, just an easy extensible way to find things....

Yeah, I know, it's "reinventing the wheel" but ehhh, this is easier to extend to cover any and all weird cases without having to memorize a bunch of obscure combinations of bash commands.

That out of the way, let's talk about what this actually does...

Quick Overview

Essentially Black Arrow (or ba for short) is a way to search through every line in every file and find matching keyword or regular expressions. It uses smart case, so if the search term is all lowercase it defaults to case-insensitive (mostly for ease of use).

png

You can also supply it with regular expressions and it handles them natively.

png

Other features include -

  • excluding certain files or paths,
  • replacing any matches that have been found,
  • specifying the max depth to search (good for large directory structures),
  • "pipe" mode for unix piping,
  • open the files in the $EDITOR for manual parsing.

Installation

┬─[zoe@fillory:~/Dropbox/Projects/black-arrow]─[09:22:12 PM]
╰─>$ pip install --user blackarrow

Black-Arrow Script

┬─[zoe@fillory:~/Dropbox/Projects/black-arrow]─[09:33:40 PM]
╰─>$ ./black-arrow/blackarrow.py -h
usage: ba [-h] [-d DIRECTORIES [DIRECTORIES ...]] [-i IGNORE [IGNORE ...]]
          [-f FILENAME [FILENAME ...]] [-w WORKERS] [-p] [-e] [-l]
          [-r REPLACE] [-D DEPTH] [--dev]
          R

positional arguments:
  R                     Search term (regular expression)

optional arguments:
  -h, --help            show this help message and exit
  -d DIRECTORIES [DIRECTORIES ...], --directories DIRECTORIES [DIRECTORIES ...]
                        Director(y|ies) to run against
  -i IGNORE [IGNORE ...], --ignore IGNORE [IGNORE ...]
                        Things to ignore (regular expressions)
  -f FILENAME [FILENAME ...], --filename FILENAME [FILENAME ...]
                        Filename search term(s)
  -w WORKERS, --workers WORKERS
                        Number of workers to use (default numcores, with
                        fallback 6 unless set)
  -p, --pipe            Run in "pipe" mode with brief output
  -e, --edit            Edit the files?
  -l, --lower           Check strict lower case?
  -r REPLACE, --replace REPLACE
                        Replace text found in place with supplied
  -D DEPTH, --depth DEPTH
                        Directory depth to search in
  --dev                 Run in development mode (NO OUTPUT)

The Name

"Arrow! Black arrow! I have saved you to the last. You have never failed me and I have always recovered you. I had you from my father and he from of old. If ever you came from the forges of the true king under the Mountain, go now and speed well!"

― J.R.R. Tolkien, The Hobbit

Metadata

Release files for blackarrow 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blackarrow 1.3.2
File Size Uploaded
blackarrow-1.3.2.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blackarrow 1.3.2
File Interpreter ABI Platform
blackarrow-1.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / blackarrow-1.3.2.tar.gz

Download URL blackarrow-1.3.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b76951979bdee0a74ca9b5b03a0fbd93ce06f968782ea3dac496502ecf292a59
BLAKE2b-256 checksum
How to use checksums
7675777922dcba834988f32d5a11cfb1d4e3d7497a39df0e981f6188b2029378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/5.4.0-171-generic

Release files / blackarrow-1.3.2-py3-none-any.whl

Download URL blackarrow-1.3.2-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61414fcc41541d6d934cde940a5aed330a5c195dace9f7dd6e49de9cb00ad8bb
BLAKE2b-256 checksum
How to use checksums
7126f654e00532a424aece7b844dfa341428aaca1e84e60628348b4aae7ecdde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/5.4.0-171-generic

Release history Release notifications | RSS feed

This release

1.3.2 This release

2 release files

1.3.1

2 release files

1.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page