https://github.com/furkanonder/bor
User-friendly, tiny source code searcher written by pure Python.
https://github.com/furkanonder/bor
abstract-syntax-tree code-search search
Last synced: 27 days ago
JSON representation
User-friendly, tiny source code searcher written by pure Python.
- Host: GitHub
- URL: https://github.com/furkanonder/bor
- Owner: furkanonder
- License: mit
- Created: 2021-09-16T14:43:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-10T19:28:53.000Z (almost 3 years ago)
- Last Synced: 2025-04-19T15:45:14.410Z (about 1 month ago)
- Topics: abstract-syntax-tree, code-search, search
- Language: Python
- Homepage:
- Size: 157 KB
- Stars: 107
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Installation
_bor_ can be installed by running `pip install bor`. It requires Python 3.8.0+ to run.
## Usage
_bor_ currently supports `class` and `def` keywords. Other Python keywords will be added
in the future releases.```sh
bor {keyword} {pattern}
```By default, _bor_ runs in your current directory. You can run _bor_ with the specific
source file or directory:```sh
bor {keyword} {pattern} {source_file_or_directory}
```## Configuration
By default, if _bor_ encounters an error(syntax, indentation error etc.) while analyzing
files, it will stop working. If you want to the ignore errors, you can use
`--ignore-error` or `-i` argument. For example;```sh
bor class Cat --ignore-error
```## Example Usages
`Cat` is equivalent in the regular expression as `^Cat$`
```sh
bor class Cat
```Output:
```sh
Cat at examples/test.py:18
```---
`.Cat` is equivalent in the regular expression as `Cat$`
```sh
bor class .Cat
```Output:
```sh
Cat at examples/test.py:18
BlueCat at examples/test.py:26
```---
`get.` is equivalent in the regular expression as `^get`
```sh
bor def get. examples/test.py
```Output:
```sh
get_value at examples/test.py:5
get_blue_value at examples/test.py:11
get_purple_value at examples/test.py:14
get_meow at examples/test.py:22
```---
`.cat.` is equivalent in the regular expression as `cat+`
```sh
bor def .cat.
```Output:
```sh
catch_me_if_you_can at examples/test.py:8
am_i_blue_cat at examples/test.py:30
where_is_the_cat at examples/test.py:38
```