Docutils | Overview | Enhancement Proposals

EP 10 — Public API and Backwards Compatibility Policy

Authors: Günter Milde
Adam Turner
Discussions-To:https://sourceforge.net/p/docutils/feature-requests/89/
Status: Active
Type:Process
Created:2025-04-22
Docutils-Version:0.23
Resolution:2026-04-09

Abstract

This document defines the public API provided by the Docutils project and its backwards compatibility policy.

Contents

Motivation

Docutils has a large user base and is used in production at several places (Python documentation, Linux kernel documentation, CMake documentation, readthedocs, ...). OTOH, Docutils has a version number below 1.0 (widely seen as an indicator of "beta" status of a project).

The current Docutils Project Policies section on version identification concentrates on the formal definition of the version specifier but leaves open what consists a "major change in the design or API".

The current backwards compatibility policy is a stub referencing PEP 387.

Rationale

Clearly defining how we will balance evolution with stability is important to both users and project developers.

People affected by changes in Docutils include:

Authors
writing or maintaining reStructuredText documents.
End-Users
of the Docutils front-end tools (optionally with 3rd-party drop-in extensions) or alternative tools using Docutils either as a library (Sphinx, …) or via the command line interface (build systems, Makefiles, scripts in other languages).
Developers

i.e. authors and maintainers of

A person may belong to more than one of these categories.

Public API

Docutils' public API includes:

Exemptions:

Tip

To find out if an object from the docutils package is safe to use, look up its docstring and the docstring of its parent(s). [*]

If there is no documentation or the documentation says provisional or internal, the name, behaviour, and existence of the object is not guaranteed to be stable.

Code relying on non-public objects should be made robust using public alternatives. If there is a no such alternative or the required change would be a problem, contact the Docutils developers or file a feature request.

[*]Attribute docstrings are not shown by pydoc. To find out whether attributes have a docstring, check the source.
[1]Cf. Backwards Compatibility Rules in PEP 387 and Public and Internal Interfaces in PEP 8.

Backwards Compatibility

Beginning with version 1.0, Docutils will follow the rules of Semantic Versioning. All incompatible changes to the public APIs require increasing the major part of the version specifier. Backwards compatible changes can be done in minor releases.

Security Implications

If required, critical bug fixes may change the public API without advance warning.

Rejected Ideas

Use type annotations as an indication of status in the public API.

Use Calendar Versioning (CalVer).

Allow breaking API changes in minor versions after prior announcement and a deprecation period.

Mark all internal objects with a prefix underscore.

Use the __all__ attribute to declare modules, classes, and functions that form the public API.

Open Issues

References

[doctree]The Docutils Document Tree
[docutils.dtd]Docutils Generic DTD
[publisher]The Docutils Publisher
[tools]Docutils Front-End Tools
[restructuredtext]reStructuredText Markup Specification
[settings]Docutils Runtime Settings
[transforms]Docutils Transforms