Skip to main content

pyDocusaurus: Convert your Python docstrings to Docusaurus Documentation

Banner

GitHub release (latest SemVer) GitHub all releases GitHub PyPI - Downloads

GitHub Actions (Build) GitHub Actions (Release)

This package is inspired by Sphinx, which is usually thought of as the "official" solution for auto-generated Python documentation. According to Sphinx's documentation, the automatic generation can be described as:

Generate API documentation for Python, C++ and other software domains, manually or automatically from docstrings, ensuring your code documentation stays up-to-date with minimal effort.

——Sphinx

Overall, this package offers similar functionalities to Sphinx. It goes through the docstrings in the whole package and reorganizes them as an automatically generated API document. However, pyDocusaurus is not an extension of Sphinx, because

  1. Sphinx is old. It was designed in an era when typing or type hints were not part of the Python standard library (STL). Therefore, Sphinx needs to infer the types from the docstrings. In modern Python code, this feature is redundant.
  2. Sphinx is essentially proposed for reStructuredText (rst). Certainly, it supports Markdown with specific extensions. However, the Markdown features, especially those related to variable types, are not well integrated with the automatically generated API documents. Users may still suffer a lot of rst code in the generated document.
  3. Limited by the old-school template, Sphinx does not produce a "modern" website.

Essentially, this package will produce a "patch" for a Docusaurus project. Like Sphinx, pyDocusaurus will go through the whole package and convert the docstring into a Docusaurus-compatible API document, while requiring minimal modifications when integrating the auto-generated document with an existing Docusaurus project (e.g., an existing tutorial site).

1. Install

Intall the latest released version of this package by using the PyPI source:

python -m pip install pydocusaurus

2. Usage

A simple usage is to use the CLI directly:

python -m pydocusaurus render-doc <package-name> -o <out-dir> -u <user-name>

It allows customizations by adding CLI options. To find the details, review the documentation of this project or call

python -m pydocusaurus render-doc --help

pyDocusaurus can also be called by Python codes, for example:

from pydocusaurus import render_package_as_mdx
import any_package

pydocusaurus.render_package_as_mdx(
    pydocusaurus, out_dir=out_dir, package_info="username"
)

3. Documentation

Check the documentation to find more details about the examples and APIs.

https://cainmagi.github.io/pydocusaurus/

4. Contributing

See CONTRIBUTING.md :book:

5. Changelog

See Changelog.md :book:

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydocusaurus-1.0.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydocusaurus-1.0.0-py3-none-any.whl (97.6 kB view details)

Uploaded Python 3

File details

Details for the file pydocusaurus-1.0.0.tar.gz.

File metadata

  • Download URL: pydocusaurus-1.0.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pydocusaurus-1.0.0.tar.gz
Algorithm Hash digest
SHA256 074e3f4a71d2c6b29fc6f5ddfb2d00adaa205771018827c03bd1720df76d8e8e
MD5 acd43613c99eaadb8730aaf3a8761f2f
BLAKE2b-256 62ac54f45d636c1d0cb77ff5917bcd6778b97ccdb2b93b4b46e934d7e760f121

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydocusaurus-1.0.0.tar.gz:

Publisher: python-publish.yml on cainmagi/pydocusaurus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydocusaurus-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pydocusaurus-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 97.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pydocusaurus-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43d82b81f3a6fc223322df4b98982dd58bcb77b43b72067ddd6f8acca59c0c36
MD5 d4110af03749b3a1074f44e4c1401c43
BLAKE2b-256 e8373ac1630fe86c0650707ede7a2ea95695eebe0b02eb39e1ad27f5028f941e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydocusaurus-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on cainmagi/pydocusaurus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page