Code Monkey home page Code Monkey logo

b2_fuzzy_helpers's Introduction

b2_fuzzy_helpers: Fuzzy basf2 help scripts

Basf2 help scripts for easily finding a module or variable description from the command line with an incremental fuzzy search via fzf.

Demo session

b2fuzzy-modules and b2fuzzy-variables demo session

Note: In the latest version I renamed the fuzzy helper scripts from b2help-... to b2fuzzy-variables and b2fuzzy-modules to avoid name conflicts with the new built-in basf2 help scripts starting with b2help-.

Install

First, make sure you have basf2 set up. Then, there are two ways how to install the package:

Easiest: Installation from github

You can directly install the package with pip from github via

python3 -m pip install --user "git+https://github.com/meliache/b2_fuzzy_helpers"

Developer install

If you want to install the package locally, you can also clone it and then install it with flit.

git clone https://github.com/meliache/b2_fuzzy_helpers
cd b2_fuzzy_helpers
flit install --user

Optionally add the -s option to install via symbolic links (editable).

If the scripts are still not found after installation, make sure that your ~/.local/bin directory is in the PATH. If not, you can add it by adding the following line to your shell init file (e.g. ~/.bashrc):

export PATH=$HOME/.local/bin:$PATH

and source the file again or open a new terminal.

Usage

The package installs the scripts

  • b2fuzzy-variables
  • b2fuzzy-modules

After installing, you can run these commands from terminal, but rememeber to set up basf2 first. You will be presented a list of candidates (modules/variables). Start typing and the list of candidates will be narrowed down with fuzzy matching to candidates containing the substring. You can provide multipe substrings, spaces will be interpreted as logical "and". After typing enter, you will see a description for the current candidate.

See the fzf docs for further information how the fuzzy matching works.

Author

Michael Eliachevitch

b2_fuzzy_helpers's People

Contributors

meliache avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

b2_fuzzy_helpers's Issues

Cache variable and module descriptions

$ could cache the variable and module descriptions via json files in add a file
in something like

$HOME/.cache/b2_fuzzy_helpers/<release/revision>

which would remove the latency from obtaining the descriptions in future calls

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.