<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Introduction](#introduction)
- [Configuration file](#configuration-file)
- [Usage](#usage)
- [Usage examples](#usage-examples)
- [Tips](#tips)
- [How do I get started?](#how-do-i-get-started)
- [Installation](#installation)
- [Using Pip](#using-pip)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
# Introduction
`bt-cheater` is a general-purpose cheatsheet tool powered by python.
The tool provides a way search through snippets of text stored in plain-text files using keywords, and all from the commandline.
The search logic relies on a simple structure for the text: a cheat _header_ and _body_, e.g.
```
# python ternary assignments # ternary # variables
This is a note on python ternary variable assignments
# bash loops # loops
This is text on bash loop structures
# civil # war # us
Dates: Apr 12, 1861 - May 9, 1865
```
As illustrated above, the header is comprised of _Cheat Terms_, which are keywords delimited by octothorpes (#).
The whitespace padding is optional and improves readability.
# Configuration file
`cheater` can read yaml config files formatted as:
```
search:
paths:
- ~/Documents/notes
- ${HOME}/Documents/more_notes
- ~/notes
filters:
- md
- txt
```
These are the settings recognized by the tool:
| Key | Value |
|:--------|:-------------------------------------------|
| paths | List of cheat file paths to search against |
| filters | List of file extensions to search for |
If no config file is specified, the tool will attempt to read one from the following locations, in order of precedence:
- /etc/bt-cheater/config.yaml
- ./config.yaml
- ~/.bt-cheater/config.yaml
# Usage
```
Usage: cheater find [OPTIONS] TOPICS...
Find cheat notes according to keywords
Options:
--version Show the version and exit.
-e, --explode-topics Write results to their own cheat files
-c, --cheatfile TEXT Manually specify cheat file(s) to search
against
-p, --cheatfile-path TEXT Manually specify cheat file paths to search
against
-a, --any Any search term can occur in the topic header
(default is "all")
-b, --search-body Search against cheat note content instead of
topic headers
--no-pause Do not pause between topic output
--help Show this message and exit.
Examples:
bt-cheater find -c ~/Documents/cheats.md foo bar baz
bt-cheater find -c ~/Documents/cheats.md foo bar baz
bt-cheater -C my_special_config.yaml find -c ~/Documents/cheats.md foo bar baz
If no config file is specified, the tool will attempt to read one from the
following locations, in order of precedence:
- /etc/bt-cheater/config.yaml
- ./config.yaml
- ~/.bt-cheater/config.yaml
```
## Usage examples
Given: Your config file is configured to search through '~/Documents/notes'
for cheat files, that is, your configuration file is ~/.bt-cheater/config.yaml, with contents: <br />
```yaml
search:
paths:
- ${HOME}/Documents/notes
filters:
- md
- txt
```
* You want to find topic headers containing the words _foo_ _bar_ and _baz_
* `bt-cheater find foo bar baz`
* You want to search a specific cheat file, _~/Documents/cheats.md_, for topic headers containing the words _foo_ _bar_ and _baz_
* `bt-cheater find -c ~/Documents/cheats.md foo bar baz`
* Same as above, but you also want to specify your own configuration file _my_special_config.yaml_
* `bt-cheater -C my_special_config.yaml find -c ~/Documents/cheats.md foo bar baz`<br />
**Note:** Because you explicitly specified the cheat file, any cheat paths defined in your config will be skipped
# Tips
As bodies of text may overlap in their keyword designation, specifying multiple terms
can help narrow down search results if you specify a search condition.
As such, the default search logic is _all_, where all search terms must occur in the topic header (logically equivalent to AND).
If you want to broaden your search criteria, use the `-a/--any` flag, instructing `bt-cheater` to consider _any_ search term present in the topic header (logically equivalent to OR).
# How do I get started?
## Installation
### Using Pip
- Form pypi.org `pip install bt-cheater`
- Directly from the repo `pip install git+https://github.com/berttejeda/bert.cheater.git`
Or clone this repo, switch to the project root `cd bert.cheater`, and `pip install -e .`,
then calling `python bertdotcheater/cli.py --help`
Raw data
{
"_id": null,
"home_page": "https://github.com/berttejeda/bert.cheater",
"name": "bt-cheater",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "md,markdown,cheatsheet,notes,snippets",
"author": "Engelbert Tejeda",
"author_email": "berttejeda@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/19/e9/b10e89aea945441c51f0def2851bcd93794bbbb6ce08fba5a67e56d88957/bt-cheater-2.1.0.tar.gz",
"platform": null,
"description": "<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [Introduction](#introduction)\n- [Configuration file](#configuration-file)\n- [Usage](#usage)\n - [Usage examples](#usage-examples)\n- [Tips](#tips)\n- [How do I get started?](#how-do-i-get-started)\n - [Installation](#installation)\n - [Using Pip](#using-pip)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n# Introduction\n\n`bt-cheater` is a general-purpose cheatsheet tool powered by python.\n\nThe tool provides a way search through snippets of text stored in plain-text files using keywords, and all from the commandline.\n\nThe search logic relies on a simple structure for the text: a cheat _header_ and _body_, e.g.\n\n```\n# python ternary assignments # ternary # variables\n This is a note on python ternary variable assignments\n# bash loops # loops\n This is text on bash loop structures\n# civil # war # us\n Dates: Apr 12, 1861 - May 9, 1865\n```\n\nAs illustrated above, the header is comprised of _Cheat Terms_, which are keywords delimited by octothorpes (#). \n\nThe whitespace padding is optional and improves readability.\n\n# Configuration file\n\n`cheater` can read yaml config files formatted as:\n\n```\nsearch:\n paths:\n - ~/Documents/notes\n - ${HOME}/Documents/more_notes\n - ~/notes\n filters:\n - md\n - txt\n```\n\nThese are the settings recognized by the tool:\n\n| Key | Value |\n|:--------|:-------------------------------------------|\n| paths | List of cheat file paths to search against |\n| filters | List of file extensions to search for |\n\nIf no config file is specified, the tool will attempt to read one from the following locations, in order of precedence:\n\n- /etc/bt-cheater/config.yaml\n- ./config.yaml\n- ~/.bt-cheater/config.yaml\n\n# Usage\n\n```\nUsage: cheater find [OPTIONS] TOPICS...\n\n Find cheat notes according to keywords\n\nOptions:\n --version Show the version and exit.\n -e, --explode-topics Write results to their own cheat files\n -c, --cheatfile TEXT Manually specify cheat file(s) to search\n against\n -p, --cheatfile-path TEXT Manually specify cheat file paths to search\n against\n -a, --any Any search term can occur in the topic header\n (default is \"all\")\n -b, --search-body Search against cheat note content instead of\n topic headers\n --no-pause Do not pause between topic output\n --help Show this message and exit.\n\n Examples:\n bt-cheater find -c ~/Documents/cheats.md foo bar baz\n bt-cheater find -c ~/Documents/cheats.md foo bar baz\n bt-cheater -C my_special_config.yaml find -c ~/Documents/cheats.md foo bar baz\n\n If no config file is specified, the tool will attempt to read one from the\n following locations, in order of precedence:\n\n - /etc/bt-cheater/config.yaml \n - ./config.yaml \n - ~/.bt-cheater/config.yaml\n```\n\n## Usage examples\n\nGiven: Your config file is configured to search through '~/Documents/notes' \nfor cheat files, that is, your configuration file is ~/.bt-cheater/config.yaml, with contents: <br />\n```yaml\nsearch:\n paths:\n - ${HOME}/Documents/notes\n filters:\n - md\n - txt\n```\n\n* You want to find topic headers containing the words _foo_ _bar_ and _baz_\n * `bt-cheater find foo bar baz`\n* You want to search a specific cheat file, _~/Documents/cheats.md_, for topic headers containing the words _foo_ _bar_ and _baz_\n * `bt-cheater find -c ~/Documents/cheats.md foo bar baz`\n* Same as above, but you also want to specify your own configuration file _my_special_config.yaml_\n * `bt-cheater -C my_special_config.yaml find -c ~/Documents/cheats.md foo bar baz`<br />\n **Note:** Because you explicitly specified the cheat file, any cheat paths defined in your config will be skipped\n\n# Tips\n\nAs bodies of text may overlap in their keyword designation, specifying multiple terms\ncan help narrow down search results if you specify a search condition.\n\nAs such, the default search logic is _all_, where all search terms must occur in the topic header (logically equivalent to AND).\n\nIf you want to broaden your search criteria, use the `-a/--any` flag, instructing `bt-cheater` to consider _any_ search term present in the topic header (logically equivalent to OR).\n\n# How do I get started?\n\n## Installation\n\n### Using Pip\n\n- Form pypi.org `pip install bt-cheater`\n- Directly from the repo `pip install git+https://github.com/berttejeda/bert.cheater.git`\n\nOr clone this repo, switch to the project root `cd bert.cheater`, and `pip install -e .`,\nthen calling `python bertdotcheater/cli.py --help`\n",
"bugtrack_url": null,
"license": "",
"summary": "Bert's Cheat Notes cli",
"version": "2.1.0",
"project_urls": {
"Homepage": "https://github.com/berttejeda/bert.cheater"
},
"split_keywords": [
"md",
"markdown",
"cheatsheet",
"notes",
"snippets"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "93ddfd2f70eaff2c6cafa3cd3cd1a08b13c1415bab79e90ab745609f9b34c1a1",
"md5": "25614c6474a1ac34847896d40442b1a5",
"sha256": "ee206b8e42940e3f2de77e008aa16a7e5922c76bf06bf5421707361be23a609c"
},
"downloads": -1,
"filename": "bt_cheater-2.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "25614c6474a1ac34847896d40442b1a5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9644,
"upload_time": "2024-01-26T17:31:57",
"upload_time_iso_8601": "2024-01-26T17:31:57.600909Z",
"url": "https://files.pythonhosted.org/packages/93/dd/fd2f70eaff2c6cafa3cd3cd1a08b13c1415bab79e90ab745609f9b34c1a1/bt_cheater-2.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "19e9b10e89aea945441c51f0def2851bcd93794bbbb6ce08fba5a67e56d88957",
"md5": "42a02161dc22c6a38c275d08cab84d61",
"sha256": "260e4c77e7ee9cfdebc8c239fd1116128329a12de842c0342b39a6e5eab27cdb"
},
"downloads": -1,
"filename": "bt-cheater-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "42a02161dc22c6a38c275d08cab84d61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 14414,
"upload_time": "2024-01-26T17:32:00",
"upload_time_iso_8601": "2024-01-26T17:32:00.835467Z",
"url": "https://files.pythonhosted.org/packages/19/e9/b10e89aea945441c51f0def2851bcd93794bbbb6ce08fba5a67e56d88957/bt-cheater-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-26 17:32:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "berttejeda",
"github_project": "bert.cheater",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "bt-cheater"
}