Skip to content

Ulauncher extension to search and view installed Python 3 modules' and packages' built-in documentation

License

Notifications You must be signed in to change notification settings

pbkhrv/ulauncher-pydoc

Repository files navigation

ulauncher-pydoc

A Ulauncher extension to search and view installed Python modules' and packages' documentation derived from docstrings. It uses the pydoc module from the Python standard library to generate the documentation and make it available via HTTP.

Usage

Open Ulauncher and type in "pyd " to start the extension. If everything is configured correctly, you'll see information about your system-installed Python 3 version and its packages:

All modules, no query

Start typing a query to search for a matching top level package or module name. It uses the same fuzzy string search algorithm as Ulauncher itself.

Query 1

Type in . (dot) after the package name to search submodules and nested packages, or press Alt+Enter to complete the name of the selected search result item.

Whenever there's an exact match on the query, you can choose to open that module's source file in your default editor:

Query 2

Use a wildcard * to match on any part of the name, regardless of the nesting level:

Wildcard query

Characters before the wildcard must be present in the name for it to match:

Wildcard query 2

Select a module or package and press Enter to see its documentation (generated by pydoc) in the browser:

View documentation

Installation

Open Ulauncher preferences window -> Extensions -> "Add extension" and paste the following url:

https://github.com/pbkhrv/ulauncher-pydoc

Development

I use the following tools while working on this extension:

  • Black code formatter
  • pytest
  • pylint with the flake8 plugin
  • mypy static type checker

You can install them in one shot (except for Black - that's up to you) by running:

pip install -r scripts/requirements.txt

Check PEP8 compliance, perform static type analysis and run unit tests:

make test

Backup the "production" version of the extension and symlink the development version into Ulauncher's extension directory:

make symlink

Quit Ulauncher. Then run it in debug mode:

make run_ul

Run extension in the terminal, connect it to Ulauncher in debug mode:

make run

(if that doesn't work, check the connection string URL printed out by Ulauncher and modify the Makefile accordingly.)

Unlink the development version of the extension from Ulauncher and replace it with whatever was there before:

make unlink

Contributions

Issues and pull requests are welcome!

License

MIT license. See LICENSE file for details.

About

Ulauncher extension to search and view installed Python 3 modules' and packages' built-in documentation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published