"Universal" Text Finder
=======================
[![Test Status](https://travis-ci.org/TheDataLeek/black-arrow.svg?branch=master)](https://travis-ci.org/TheDataLeek/black-arrow)
[![Coverage Status](https://coveralls.io/repos/github/TheDataLeek/black-arrow/badge.svg?branch=master)](https://coveralls.io/github/TheDataLeek/black-arrow?branch=master)
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](./img/demo.png)
You can also supply it with regular expressions and it handles them natively.
![png](./img/demo2.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
```bash
┬─[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
Raw data
{
"_id": null,
"home_page": "https://github.com/TheDataLeek/black-arrow",
"name": "blackarrow",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6.2,<4.0.0",
"maintainer_email": "",
"keywords": "development,searching,text,find,replace",
"author": "Zoe Farmer",
"author_email": "zoe@dataleek.io",
"download_url": "https://files.pythonhosted.org/packages/76/75/777922dcba834988f32d5a11cfb1d4e3d7497a39df0e981f6188b2029378/blackarrow-1.3.2.tar.gz",
"platform": null,
"description": "\"Universal\" Text Finder\n=======================\n\n[![Test Status](https://travis-ci.org/TheDataLeek/black-arrow.svg?branch=master)](https://travis-ci.org/TheDataLeek/black-arrow)\n[![Coverage Status](https://coveralls.io/repos/github/TheDataLeek/black-arrow/badge.svg?branch=master)](https://coveralls.io/github/TheDataLeek/black-arrow?branch=master)\n\nIt's basically just grep in python... Nothing fancy, just an easy extensible way\nto find things....\n\nYeah, I know, it's \"reinventing the wheel\" but ehhh, this is easier to extend to\ncover any and all weird cases without having to memorize a bunch of obscure\ncombinations of bash commands.\n\nThat out of the way, let's talk about what this *actually does*...\n\n## Quick Overview\n\nEssentially Black Arrow (or `ba` for short) is a way to search through every line in every file and\nfind matching keyword *or* regular expressions. It uses smart case, so if the search term is all\nlowercase it defaults to case-insensitive (mostly for ease of use).\n\n![png](./img/demo.png)\n\nYou can also supply it with regular expressions and it handles them natively.\n\n![png](./img/demo2.png)\n\nOther features include -\n\n* excluding certain files or paths,\n* replacing any matches that have been found,\n* specifying the max depth to search (good for large directory structures),\n* \"pipe\" mode for unix piping,\n* open the files in the `$EDITOR` for manual parsing. \n\n## Installation\n\n```\n\u252c\u2500[zoe@fillory:~/Dropbox/Projects/black-arrow]\u2500[09:22:12 PM]\n\u2570\u2500>$ pip install --user blackarrow\n```\n\n## Black-Arrow Script\n\n```bash\n\u252c\u2500[zoe@fillory:~/Dropbox/Projects/black-arrow]\u2500[09:33:40 PM]\n\u2570\u2500>$ ./black-arrow/blackarrow.py -h\nusage: ba [-h] [-d DIRECTORIES [DIRECTORIES ...]] [-i IGNORE [IGNORE ...]]\n [-f FILENAME [FILENAME ...]] [-w WORKERS] [-p] [-e] [-l]\n [-r REPLACE] [-D DEPTH] [--dev]\n R\n\npositional arguments:\n R Search term (regular expression)\n\noptional arguments:\n -h, --help show this help message and exit\n -d DIRECTORIES [DIRECTORIES ...], --directories DIRECTORIES [DIRECTORIES ...]\n Director(y|ies) to run against\n -i IGNORE [IGNORE ...], --ignore IGNORE [IGNORE ...]\n Things to ignore (regular expressions)\n -f FILENAME [FILENAME ...], --filename FILENAME [FILENAME ...]\n Filename search term(s)\n -w WORKERS, --workers WORKERS\n Number of workers to use (default numcores, with\n fallback 6 unless set)\n -p, --pipe Run in \"pipe\" mode with brief output\n -e, --edit Edit the files?\n -l, --lower Check strict lower case?\n -r REPLACE, --replace REPLACE\n Replace text found in place with supplied\n -D DEPTH, --depth DEPTH\n Directory depth to search in\n --dev Run in development mode (NO OUTPUT)\n```\n\n#### The Name\n\n*\"Arrow! Black arrow! I have saved you to the last. You have never failed me and\nI have always recovered you. I had you from my father and he from of old. If\never you came from the forges of the true king under the Mountain, go now and\nspeed well!\"*\n\n\u2015 J.R.R. Tolkien, The Hobbit\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A fast keyword searcher",
"version": "1.3.2",
"project_urls": {
"Homepage": "https://github.com/TheDataLeek/black-arrow",
"Repository": "https://github.com/TheDataLeek/black-arrow"
},
"split_keywords": [
"development",
"searching",
"text",
"find",
"replace"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7126f654e00532a424aece7b844dfa341428aaca1e84e60628348b4aae7ecdde",
"md5": "1f9d0fd741bc6a8bdf04616731659cd3",
"sha256": "61414fcc41541d6d934cde940a5aed330a5c195dace9f7dd6e49de9cb00ad8bb"
},
"downloads": -1,
"filename": "blackarrow-1.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1f9d0fd741bc6a8bdf04616731659cd3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6.2,<4.0.0",
"size": 8833,
"upload_time": "2024-02-23T22:57:04",
"upload_time_iso_8601": "2024-02-23T22:57:04.076836Z",
"url": "https://files.pythonhosted.org/packages/71/26/f654e00532a424aece7b844dfa341428aaca1e84e60628348b4aae7ecdde/blackarrow-1.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7675777922dcba834988f32d5a11cfb1d4e3d7497a39df0e981f6188b2029378",
"md5": "99bd7f230ddf02a50589a7a676138405",
"sha256": "b76951979bdee0a74ca9b5b03a0fbd93ce06f968782ea3dac496502ecf292a59"
},
"downloads": -1,
"filename": "blackarrow-1.3.2.tar.gz",
"has_sig": false,
"md5_digest": "99bd7f230ddf02a50589a7a676138405",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.2,<4.0.0",
"size": 7492,
"upload_time": "2024-02-23T22:57:05",
"upload_time_iso_8601": "2024-02-23T22:57:05.949955Z",
"url": "https://files.pythonhosted.org/packages/76/75/777922dcba834988f32d5a11cfb1d4e3d7497a39df0e981f6188b2029378/blackarrow-1.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-23 22:57:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TheDataLeek",
"github_project": "black-arrow",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "blackarrow"
}