Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
Python documentation libraries generate documentation websites and API references from Markdown, reStructuredText, and source code. An API generator imports or parses each module and renders its docstrings and type annotations as reference pages. These libraries let open-source projects and internal teams publish documentation that stays in step with their code.
Popularity
Sphinx has the most monthly downloads in this comparison, at 20.3M.
@app.command()
def build_all():
"""
Build mkdocs site for en, and then build each language inside, end result is located
at directory ./site/ with each language inside.
"""
site_path = Path("site").absolute()
update_languages(lang=None)
current_dir = os.getcwd()
os.chdir(en_docs_path)
typer.echo("Building docs for: en")
mkdocs.commands.build.build(mkdocs.config.load_config(site_dir=str(site_path)))
os.chdir(current_dir)
langs = []
for lang in get_lang_paths():
if lang == en_docs_path or not lang.is_dir():
continue
langs.append(lang.name)
cpu_count = os.cpu_count() or 1
with Pool(cpu_count * 2) as p:
p.map(build_lang, langs)
mkdocstrings
Generates documentation from source code for MkDocs.
@staticmethod
def load_inventory(
in_file: BinaryIO,
url: str,
base_url: str | None = None,
domains: list[str] | None = None,
**kwargs: Any, # noqa: ARG004
) -> Iterator[tuple[str, str]]:
"""Yield items and their URLs from an inventory file streamed from `in_file`.
This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.BaseHandler.load_inventory`][]).
Arguments:
in_file: The binary file-like object to read the inventory from.
url: The URL that this file is being streamed from (used to guess `base_url`).
base_url: The URL that this inventory's sub-paths are relative to.
domains: A list of domain strings to filter the inventory by, when not passed, "py" will be used.
**kwargs: Ignore additional arguments passed from the config.
Yields:
Tuples of (item identifier, item URL).
"""
domains = domains or ["py"]
if base_url is None:
base_url = posixpath.dirname(url)
for item in Inventory.parse_sphinx(in_file, domain_filter=domains).values():
yield item.name, posixpath.join(base_url, item.uri)
pdoc
Generates Python API reference pages from modules, docstrings, and type annotations.
Downloads / mo
1.1M
Stars
2.5K
Last release
16.0.0
License
MIT-0
Strengths
Uses Markdown inside docstrings.Write API descriptions with Markdown formatting.
Links documented identifiers automatically.Build related modules together to link their API references.
Limitations
Imports modules while building.Module-level code runs while API pages are generated.
Generates HTML output only.Choose another generator when a project needs output other than HTML.
def _api_modules():
def _recursive_htmls(mod):
yield mod.name, mod.html()
for submod in mod.submodules():
yield from _recursive_htmls(submod)
modules = ["pyatv"]
context = pdoc.Context()
modules = [
pdoc.Module(mod, context=context, docfilter=_filter_func) for mod in modules
]
pdoc.link_inheritance(context)
for mod in modules:
for module_name, html in _recursive_htmls(mod):
output_file = os.path.join("docs", "api", module_name + ".html")
yield output_file, html
Pydoc-Markdown
Creates Python API documentation in Markdown format.
from pathlib import Path
from pydoc_markdown import PydocMarkdown
from pydoc_markdown.contrib.loaders.python import PythonLoader
from pydoc_markdown.contrib.renderers.markdown import MarkdownRenderer
Path('demo.py').write_text('\"\"\"Example API.\"\"\"\nVALUE = 1\n')
docs = PydocMarkdown(loaders=[PythonLoader(search_path=['.'], modules=['demo'])],
renderer=MarkdownRenderer(filename='api.md'))
modules = docs.load_modules()
docs.process(modules)
docs.render(modules)
FAQ
Sphinx suits large projects that need its extension and cross-reference ecosystem. MkDocs suits project sites written in Markdown, with mkdocstrings for API pages. pdoc suits a quick API reference generated straight from modules.
MkDocs builds static documentation sites from Markdown files and a YAML configuration. Themes and plugins extend each site.
Sphinx is a documentation generator with a native ecosystem of extensions and domains. Its autodoc extension pulls API documentation from docstrings.
MkDocs writes pages in Markdown and adds API pages through mkdocstrings. Sphinx writes pages in reStructuredText or Markdown through extensions and offers a larger extension ecosystem.
Jupyter Book builds reusable, reproducible, and interactive computational narratives from MyST documents and notebooks.
For coding agents
Found your documentation library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.