seed_intersphinx_mapping

Populate the Sphinx ‘intersphinx_mapping’ dictionary from the project’s requirements.

Changed in version 0.5.0: The functions formerly in seed_intersphinx_mapping.core can now be found here.

Functions:

fallback_mapping(​)

Returns the fallback mapping for projects that do not provide a link to their documentation on PyPI.

get_sphinx_doc_url(​pypi_name)

Returns the URL to the given project’s Sphinx documentation.

seed_intersphinx_mapping(​*requirements)

Returns an intersphinx mapping dictionary for the project’s requirements.

fallback_mapping()[source]

Returns the fallback mapping for projects that do not provide a link to their documentation on PyPI.

The mapping is loaded from JSON data on demand, and consists of project_name: url pairs.

Return type

Dict[str, str]

get_sphinx_doc_url(pypi_name)[source]

Returns the URL to the given project’s Sphinx documentation.

Not all projects include this URL in their distributions, and therefore it may not be possible to determine it from PyPI.

Responses are cached to prevent overloading the PyPI server. The cache can be cleared as follows:

python3 -m seed_intersphinx_mapping
Parameters

pypi_name (str) – The name of the project on PyPI

Return type

str

Returns

The URL of the project’s Sphinx documentation.

Raises

Changed in version 0.4.0: Now raises InvalidRequirement rather than apeye.slumber_url.exceptions.HttpNotFoundError if the project could not be found on PyPI.

seed_intersphinx_mapping(*requirements)[source]

Returns an intersphinx mapping dictionary for the project’s requirements.

Parameters

*requirements (Union[Requirement, str]) – The requirements to find the documentation for.

Changed in version 0.4.0: Now takes the requirements as arguments rather than a directory to read the requirements.txt file from.

Return type

Dict[str, Tuple[str, Optional[str]]]