Public API¶
Search the Python documentation from your terminal.
Data:
Directory in which cached files are stored. |
Functions:
|
Returns the path to the cache subdirectory for the given URL. |
|
Download the Sphinx |
|
Find the complete documentation URL for the given function, class, method etc. |
|
Resolve any redirects in the given URL. |
-
cache_dir
= PosixPathPlus('/home/docs/.cache/searchdocs')¶ Type:
PosixPathPlus
Directory in which cached files are stored.
-
download_objects_inv
(docs_url)[source]¶ Download the Sphinx
objects.inv
file for the documentation available at the given URL.- Parameters
docs_url (
Union
[str
,RequestsURL
]) – The base URL for the documentation, e.g."https://docs.python.org/3/"
.- Return type
- Returns
The filename of the cached file.
-
find_url
(docs_url, search_term)[source]¶ Find the complete documentation URL for the given function, class, method etc.
- Parameters
docs_url (
Union
[str
,RequestsURL
]) – The base URL for the documentation, e.g."https://docs.python.org/3/"
.search_term (
str
) – The object to search for, e.g.'TemporaryDirectory'
.
- Return type
- Returns
The url of the object in the documentation, e.g.
URL('https://docs.python.org/3/'library/tempfile.html#tempfile.TemporaryDirectory')
.
-
resolve_url
(url)[source]¶ Resolve any redirects in the given URL.
- Parameters
url (
Union
[str
,RequestsURL
])- Return type