Registry / web-framework / sphinxcontrib-datatemplates

sphinxcontrib-datatemplates

JSON →
library0.11.0pypypi✓ verified 83d ago

A Sphinx extension that renders data files (YAML, JSON, CSV, etc.) as nicely formatted HTML tables or custom templates. Current version 0.11.0, requires Python >=3.8, released periodically.

pip install sphinxcontrib-datatemplates
INSTALL
IMPORT
SIG · SPHINXCONTRIB-DATA
S
sphinxcontrib-datatemplates
web-frameworkpythonv0.11.0
Install
5.6s avg
Import
766ms
Disk
97MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.11.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.770s · 94.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.6s · import 0.762s · 96MB
97MB installed
● package 97MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

setup
from sphinxcontrib.datatemplates import setup
from sphinxcontrib_datatemplates import setup
Common mistake: using underscore instead of dot in the module path

Activate the extension in conf.py, then use the datatemplate directive in reStructuredText to include data files rendered via Jinja2 templates.

# conf.py import os extensions = ['sphinxcontrib.datatemplates'] # In any .rst file: # .. datatemplate:: path/to/data.yaml # :template: table.rst.j2
Debug
Known issues
breakingVersion 0.6.0 renamed the directive from 'data' to 'datatemplate'. Old syntax using '.. data::' breaks; update to '.. datatemplate::'.
fix
Replace '.. data::' with '.. datatemplate::' in all .rst files.
affects: <0.6.0
gotchaThe extension does not automatically reload data files on each build; changes require a clean build. Use 'make clean' before rebuilding.
fix
Run 'make clean' after modifying data files, or use sphinx-autobuild.
affects: all
deprecatedSupport for CSV files may be removed in a future version; prefer JSON or YAML.
fix
Convert CSV data to JSON or YAML format.
affects: >=0.10.0
Errors
Common errors & fixes
Extension error: Could not import extension sphinxcontrib.datatemplates
Missing package or misspelled extension name in conf.py.
fix
Install with 'pip install sphinxcontrib-datatemplates' and check ext_list: ['sphinxcontrib.datatemplates'] (dot, not underscore).
Directive 'datatemplate' is not registered
Sphinx does not recognize the directive; extension possibly not loaded.
fix
Ensure 'sphinxcontrib.datatemplates' is in extensions list in conf.py and that you are using the correct directive name (not 'data').
Template 'table.rst.j2' not found
The specified Jinja2 template path is incorrect or missing.
fix
Place template in source directory or provide absolute/relative path from conf.py directory.
Upgrade
Version history
0.11.0latest on PyPI · released Dec 21, 2023
Audit
Dependencies
SphinxrequiredThe extension runs as a Sphinx plugin; requires Sphinx >=2.0
PyYAMLoptionalRequired for reading YAML data files
docutilsoptionalUsed for Sphinx document transformation
Agent activity
13 hits · last 30 days
node
12
Resources
sphinxcontrib-datatemplates — pip install sphinxcontrib-datatemplates · libregistry