{"id":24629,"library":"sphinxcontrib-datatemplates","title":"sphinxcontrib-datatemplates","description":"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.","status":"active","version":"0.11.0","language":"python","source_language":"en","source_url":"https://github.com/collective/sphinxcontrib-datatemplates","tags":["sphinx","extension","data-files","templates","documentation"],"install":[{"cmd":"pip install sphinxcontrib-datatemplates","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"The extension runs as a Sphinx plugin; requires Sphinx >=2.0","package":"Sphinx","optional":false},{"reason":"Required for reading YAML data files","package":"PyYAML","optional":true},{"reason":"Used for Sphinx document transformation","package":"docutils","optional":true}],"imports":[{"note":"Common mistake: using underscore instead of dot in the module path","wrong":"from sphinxcontrib_datatemplates import setup","symbol":"setup","correct":"from sphinxcontrib.datatemplates import setup"}],"quickstart":{"code":"# conf.py\nimport os\nextensions = ['sphinxcontrib.datatemplates']\n# In any .rst file:\n# .. datatemplate:: path/to/data.yaml\n#    :template: table.rst.j2","lang":"python","description":"Activate the extension in conf.py, then use the datatemplate directive in reStructuredText to include data files rendered via Jinja2 templates."},"warnings":[{"fix":"Replace '.. data::' with '.. datatemplate::' in all .rst files.","message":"Version 0.6.0 renamed the directive from 'data' to 'datatemplate'. Old syntax using '.. data::' breaks; update to '.. datatemplate::'.","severity":"breaking","affected_versions":"<0.6.0"},{"fix":"Run 'make clean' after modifying data files, or use sphinx-autobuild.","message":"The extension does not automatically reload data files on each build; changes require a clean build. Use 'make clean' before rebuilding.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert CSV data to JSON or YAML format.","message":"Support for CSV files may be removed in a future version; prefer JSON or YAML.","severity":"deprecated","affected_versions":">=0.10.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with 'pip install sphinxcontrib-datatemplates' and check ext_list: ['sphinxcontrib.datatemplates'] (dot, not underscore).","cause":"Missing package or misspelled extension name in conf.py.","error":"Extension error: Could not import extension sphinxcontrib.datatemplates"},{"fix":"Ensure 'sphinxcontrib.datatemplates' is in extensions list in conf.py and that you are using the correct directive name (not 'data').","cause":"Sphinx does not recognize the directive; extension possibly not loaded.","error":"Directive 'datatemplate' is not registered"},{"fix":"Place template in source directory or provide absolute/relative path from conf.py directory.","cause":"The specified Jinja2 template path is incorrect or missing.","error":"Template 'table.rst.j2' not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}