Skip to main content

Fuzzy Search documentation from the CLI

Project description

Doc-FZF: Modular CLI Documentation Fuzzy Finder

Fuzzy Search documentation from the CLI and open them in the browser.

See it in action here https://terminalizer.com/view/2c3935cf1418

Disclaimer This tool was built to learn FZF capabilities. Feel free to use it or extend it.

Usage

doc-fzf ansible
doc-fzf ansible -q yum

Installation

pip3 install doc-fzf

Verify your installation:

doc-fzf -h
usage: doc-fzf.py [-h] [-q QUERY] module_name

doc-fzf.

positional arguments:
module_name  Name of the module to search

optional arguments:
-h, --help   show this help message and exit
-q QUERY     Query the docs

Extending Doc-FZF

doc-fzf is a modular application. It can load modules at runtime that scrap websites in any way you like.

Any module should always contain:

  • class name must always be Scrapper(FZFDoc)
  • self.documentation_url attribute
  • def get_documentation(self): function that must always return a tuple ("url", "description")
from doc_fzf.pyfzf import FZFDoc


class Scrapper(FZFDoc):
    def __init__(self):
        self.base_url = "https://docs.python.org/3"
        self.documentation_url = "{0}/py-modindex.html".format(self.base_url)
        FZFDoc.__init__(self, self.documentation_url)

    def get_documentation(self):
        """ Return a tuple of (url, description)
        """
        docs = get_online_documentation()
        for doc in docs:
            yield (doc.url, doc.description)

Here is the ansible documentation example

Road Map

  • Module definition
  • FZFDoc base class
  • File system cache layer
  • Load modules at runtime

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doc-fzf-0.0.7.tar.gz (5.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page