It’s surprisingly difficult to document large Python classes in a way that’s easy for users to navigate. Most projects use the autodoc Sphinx plugin, which simply puts the complete documentation for each class member one after another. While this does fully document the class, it doesn’t give the user a quick way to see everything the class can do. This makes classes of even moderate complexity difficult to navigate. It also encourages projects to be stingy about which class members to include in the documentation (e.g. excluding special methods, inherited methods, private methods, and/or undocumented methods), to the further detriment of the user.
What’s needed is for each class to have a succinct table of contents (TOC) that:
Is organized into sections that will be meaningful to the user. Different projects and classes may call for different sections, e.g. public/private methods, methods that share a decorator, methods with a common prefix, etc.
Includes every method of the class (so that the documentation is complete), while still making it easy for the user to get a sense for what the class does and find what they’re looking for.
Collapses inherited methods. Complex classes in particular can inherit a lot of methods from their parent classes, and while these methods should be present in the TOC (since they’re part of the class), collapsing them makes it easier for the user to grok the functionality provided by the class itself.
autoclasstoc provides a new Restructured Text directive that is all of these things. It also works well with autodoc and autogen, and should be easy to incorporate into any existing project.
See the complete documentation for more information (including examples).
Release files for autoclasstoc 1.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autoclasstoc-1.7.0.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autoclasstoc-1.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.4 kB
Release files / autoclasstoc-1.7.0.tar.gz
| Download URL | autoclasstoc-1.7.0.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93a604be070a1f0ab19b0a0dd9d03d3fb16377da8a7a49ed8919692ef882775a
|
|
BLAKE2b-256 checksum How to use checksums |
879fe3ef0f487fb0ced67f5f527cc0b528a8607f1d2eefb77ff4f06316178e87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / autoclasstoc-1.7.0-py3-none-any.whl
| Download URL | autoclasstoc-1.7.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00d7f8450d9fb043a500a0ac5fe9cda3699d51d68211f183178734f14df526ec
|
|
BLAKE2b-256 checksum How to use checksums |
7346a8f6be3b9f410949be16ca33ca5ac533398de705327d156446d298631f64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|