M BUZZ CRAZE NEWS
// general

Do we have offline Python documentation browser in Ubuntu repositories to have one "point of service" to read and search the Python docs and APIs?

By Joseph Russell

The question is in the title. As a use case one can imagine the situation about finding function basing on its known functionality.

I already know about Zeal which is packaged. It downloads documentation sets from Dash project. This is great but the Python versions differ from installed on system. They are usually newer.

The DevHelp application do not know about Python libraries. The search on pydoc3 -p 8080 does not work as expected. KHelpCenter does not know about Python. The doc-central package seems to be broken for long time. dochelp shows only index from /usr/share/doc-help and does not provide full-text search.

What else should I try to have ability for reading and searching Python documentation offline from /usr/share/doc (and similar locations)?
My system reports that I have 467 folders there (ls -1d /usr/share/doc/*python* | wc -l).

2 Answers

If you're talking about the documentation for Python itself (installable from the python3-doc package which depends on the actual system Python version's doc package), then you can just run a web server from /usr/share/doc/python3/html (e.g., using python3 -m http.server). The Python docs use Sphinx, which supports client-side searching.

Example using 18.04:

  • The index page:

    The sidebar links are mostly external.

  • The reference section:

  • Searching:

5

I have created Bash shell script for searching locally installed Python documentation on Debian-based systems (such as Ubuntu) and placed it at GitHub.

This script allows one to run first preliminary full-text search to get Python package name and way to read the relevant documentation in the HTML-format.

It uses aptitude for Python package selection, html2text and/or pandoc packages to run the conversion from HTML to plain-text to get better search results.

The script shows found local HTML documents in default web-browser and provides information about further methods of documentation reading - via DevHelp, DocHelp or web-browser.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy