Skip to main content

oodocs

OODocs is an Object-Oriented Documentation Tool: a Python-first toolkit for building structured documents as ordinary Python objects and rendering the same source to DOCX, PDF, and HTML.

It is useful when reports, manuals, API references, manuscripts, or release documents already live near Python data, figures, and scripts. Instead of treating a document as a string template, OODocs keeps the source of record as a typed object tree.

Install

pip install oodocs

Optional extras are available for focused workflows:

pip install "oodocs[examples]"
pip install "oodocs[adapters]"
pip install "oodocs[apidoc]"
  • examples installs dependencies used by the bundled example scripts, such as matplotlib and pandas.
  • adapters installs YAML support for repository and workflow metadata adapters.
  • apidoc installs API collection and docstring parsing dependencies.

Quick Start

from oodocs import Chapter, Document, DocumentMetadata, DocumentSettings, Paragraph, Section, bold

report = Document(
    "Hello oodocs",
    Chapter(
        "Getting Started",
        Section(
            "Overview",
            Paragraph(
                "This document was defined with ",
                bold("Python objects"),
                ".",
            ),
        ),
    ),
    settings=DocumentSettings(metadata=DocumentMetadata(author="OODocs")),
)

report.save("artifacts/hello.docx")
report.save("artifacts/hello.pdf")
report.save("artifacts/hello.html")

Document.save(...) chooses the renderer from the file extension. Use save_all(...) when a workflow normally needs DOCX, PDF, and HTML together:

outputs = report.save_all("artifacts")
print(outputs["docx"], outputs["pdf"], outputs["html"])

Command Line

The package installs an oodocs command for common build and validation tasks:

oodocs build report.py --out artifacts
oodocs build README.md --outputs docx,pdf,html --out artifacts
oodocs build notebook.ipynb --outputs pdf --out artifacts
oodocs validate report.py

Python sources can expose a Document as document, doc, or report, or a zero-argument factory such as build_document(). Markdown and notebook sources are imported through the same parser APIs available from Python.

What You Can Build

  • DOCX, PDF, and HTML documents from one Python object tree
  • document-level page layout for page size, margins, and portrait/landscape orientation
  • authored prose, headings, lists, equations, code blocks, boxes, tables, and figures
  • captioned tables and figures with automatic numbering and cross-references
  • report panels and reusable visual styles that stay editable in Word
  • document comments, footnotes, hyperlinks, citations, and generated references
  • Markdown and Jupyter notebook imports that become editable OODocs blocks
  • API reference material from Python packages, modules, source trees, and docstrings through oodocs.apidoc
  • release and audit documents from repository metadata through oodocs.adapters

API Documentation Workflows

Install the apidoc extra to collect public Python API objects and render them as ordinary OODocs content:

from oodocs import Chapter, Document, Paragraph
from oodocs.apidoc import collect_api

api = collect_api("oodocs", public_policy="__all__")
classes = api.select_objects(kind="class", module_prefix="oodocs.components")

doc = Document(
    "Selected API Notes",
    Chapter(
        "Important Classes",
        Paragraph("This chapter is assembled from parsed API objects."),
        *[obj.to_section(level=2, presentation="manual") for obj in classes[:5]],
    ),
)

doc.save_all("artifacts/api-notes")

Repository-level API reference builds can also be configured in pyproject.toml and rendered with ApiHelpBookConfig.from_pyproject(".").save_all(".").

Links

Download files

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

Source Distribution

oodocs-1.2.0.tar.gz (6.6 MB view details)

Uploaded Source

Built Distribution

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

oodocs-1.2.0-py3-none-any.whl (400.5 kB view details)

Uploaded Python 3

File details

Details for the file oodocs-1.2.0.tar.gz.

File metadata

  • Download URL: oodocs-1.2.0.tar.gz
  • Upload date:
  • Size: 6.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oodocs-1.2.0.tar.gz
Algorithm Hash digest
SHA256 476d6ab5fe55a54dcf357f75edbb171875e9b1cd013411f1e50cb0941a48e735
MD5 917051280ef758a9c5854c2b00713f27
BLAKE2b-256 35e3bcf9a3355d2aa52ad596de4c541829202db0684c1adbb96585065f695a6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for oodocs-1.2.0.tar.gz:

Publisher: release.yml on Gonie-Gonie/oo-docs

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

File details

Details for the file oodocs-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: oodocs-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 400.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oodocs-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 519e01af44a7c917e0192eab0487148da8ad7492db6ca4e616c2e59543dd3cb0
MD5 23044c2d34a235d2498cf7baba40d568
BLAKE2b-256 8dcee4efb736bd856b36968d75533b4674111fb72131159e1260350a1dc7a92e

See more details on using hashes here.

Provenance

The following attestation bundles were made for oodocs-1.2.0-py3-none-any.whl:

Publisher: release.yml on Gonie-Gonie/oo-docs

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

Release history Release notifications | RSS feed

1.3.0

2 files

This release

1.2.0 This release

2 files

1.1.0

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

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