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
OODocs requires Python 3.11 or later.
Optional extras are available for focused workflows:
pip install "oodocs[examples]"
pip install "oodocs[integrations]"
pip install "oodocs[bibtex]"
pip install "oodocs[pint]"
pip install "oodocs[sympy]"
pip install "oodocs[apidoc]"
examplesinstalls dependencies used by the bundled example scripts, such as matplotlib and pandas.integrationsinstalls PyYAML and Pydantic support for their optional collectors.bibtexinstalls the optionalbibtexparserbackend; the built-in parser remains available without it.pintandsympyinstall only their respective integration bridges.apidocinstalls API collection and docstring parsing dependencies.
Core engineering presentation objects such as NumberFormat and Quantity
need no optional dependency.
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.
Because a Python source is imported during discovery, build only trusted Python
files and keep command execution behind an if __name__ == "__main__" guard.
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
- explicit cover/front/main/back matter plus plain object links for unnumbered targets
- description lists, schema and CLI reference models, per-line equation references, quantities, and multi-document suites
- 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 generic metadata models, explicit
oodocs.integrations, and caller-configuredoodocs.evidencereports
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(".").
Upgrading from 1.x
Version 1.3 removes oodocs.adapters; import external collectors from
oodocs.integrations.*. Replace Equation.from_sympy(...) with
oodocs.integrations.sympy.equation_from_sympy(...), and import schema, CLI,
engineering, evidence, and suite models from their focused namespaces. See the
v1.3 migration guide.
Links
- Repository: https://github.com/Gonie-Gonie/oo-docs
- Issues: https://github.com/Gonie-Gonie/oo-docs/issues
- License: MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oodocs-1.3.0.tar.gz.
File metadata
- Download URL: oodocs-1.3.0.tar.gz
- Upload date:
- Size: 6.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82ed366c382ec86426b19449883f29043e73789819c29627307cb6729a1f5b54
|
|
| MD5 |
4564b4ae4c1416856b456047e1a715c4
|
|
| BLAKE2b-256 |
3271f2bbfe778405dfa767787ce431bb805c81c6c14ec318185f10cb2334ccbd
|
Provenance
The following attestation bundles were made for oodocs-1.3.0.tar.gz:
Publisher:
release.yml on Gonie-Gonie/oo-docs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oodocs-1.3.0.tar.gz -
Subject digest:
82ed366c382ec86426b19449883f29043e73789819c29627307cb6729a1f5b54 - Sigstore transparency entry: 2167506827
- Sigstore integration time:
-
Permalink:
Gonie-Gonie/oo-docs@576fc6e9506761dfbbc2231931efc7b7982be55a -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/Gonie-Gonie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@576fc6e9506761dfbbc2231931efc7b7982be55a -
Trigger Event:
push
-
Statement type:
File details
Details for the file oodocs-1.3.0-py3-none-any.whl.
File metadata
- Download URL: oodocs-1.3.0-py3-none-any.whl
- Upload date:
- Size: 467.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
841ea2a6ff3a0305ef32974e72e2220bfd1b59d4d3689cf5bd7b50fd95554c11
|
|
| MD5 |
d4ce241341c1a21ffe290bc3a6813d50
|
|
| BLAKE2b-256 |
003d50152adf5be5486157abade5161b418daa8a04e0c803daae9adb28bc5f2d
|
Provenance
The following attestation bundles were made for oodocs-1.3.0-py3-none-any.whl:
Publisher:
release.yml on Gonie-Gonie/oo-docs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oodocs-1.3.0-py3-none-any.whl -
Subject digest:
841ea2a6ff3a0305ef32974e72e2220bfd1b59d4d3689cf5bd7b50fd95554c11 - Sigstore transparency entry: 2167506892
- Sigstore integration time:
-
Permalink:
Gonie-Gonie/oo-docs@576fc6e9506761dfbbc2231931efc7b7982be55a -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/Gonie-Gonie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@576fc6e9506761dfbbc2231931efc7b7982be55a -
Trigger Event:
push
-
Statement type: