Registry / web-framework / sphinx-data-viewer

sphinx-data-viewer

JSON →
library0.1.5pypypiunverified

Sphinx Data Viewer is a Sphinx extension that provides an interactive list view for presenting JSON and Python data within your documentation. It allows users to display structured data directly from inline content, JSON files, or Python objects. The library is currently at version 0.1.5, released on August 28, 2024, and maintains an active development cadence tied to Sphinx compatibility.

pip install sphinx-data-viewer
INSTALL
IMPORT
SIG · SPHINX-DATA-VIEWER
S
sphinx-data-viewer
web-frameworkpythonv0.1.5
Install
5.4s avg
Import
Disk
94MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.5 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 92.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.4s · import 0.000s · 93MB
94MB installed
● package 94MB
Code
Verified usage

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

sphinx_data_viewer
# In conf.py extensions = [ "sphinx_data_viewer" ]
Sphinx Data Viewer is a Sphinx extension, not a Python library with direct runtime imports. It is enabled by adding its module name to the 'extensions' list in Sphinx's conf.py configuration file.

To get started with Sphinx Data Viewer, first install the package. Then, enable the extension by adding 'sphinx_data_viewer' to the `extensions` list in your Sphinx project's `conf.py` file. Finally, use the `.. data-viewer::` reStructuredText directive in your documentation files to display inline JSON, content from a JSON file, or data from a Python variable defined in `conf.py`. The `:expand:` option can be used to show the complete data by default.

# 1. Install the library: # pip install sphinx-data-viewer # 2. Add 'sphinx_data_viewer' to your conf.py extensions list: # In docs/conf.py # extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.napoleon', # 'sphinx_data_viewer' # Add this line # ] # 3. Use the data-viewer directive in a reStructuredText file (e.g., index.rst): # .. data-viewer:: # :title: Example Data # :expand: # # { # "name": "Alice", # "age": 30, # "is_student": false, # "courses": ["Math", "Science"] # } # You can also load data from a file: # .. data-viewer:: # :file: my_data.json # Or from a Python variable defined in conf.py: # # In conf.py: # # my_python_data = {'city': 'New York', 'population': 8000000} # # In .rst file: # # .. data-viewer:: # # :var: my_python_data
Debug
Known issues
breakingVersion 0.1.5 fixed deprecations related to Sphinx's handling of CSS/JS assets. Older versions of sphinx-data-viewer (pre-0.1.5) may cause build failures or display issues with newer Sphinx versions due to these changes.
fix
Upgrade to sphinx-data-viewer version 0.1.5 or newer: `pip install --upgrade sphinx-data-viewer`.
affects: <0.1.5
gotchaThe `:expand:` option for the `data-viewer` directive is a flag and does not require a value. Providing a value or incorrect syntax (e.g., `:expand: True`) can lead to the option not being recognized or unexpected behavior.
fix
Simply include `:expand:` without any value to enable it, like this: `.. data-viewer:: :expand: { ... }`.
affects: All
Upgrade
Version history
0.1.5latest on PyPI · released Aug 28, 2024
Audit
Dependencies
SphinxrequiredCore dependency as this is a Sphinx extension.
PythonrequiredRequires Python 3.8 or newer.
Agent activity
11 hits · last 30 days
node
8
Amazon
1
Resources
sphinx-data-viewer — pip install sphinx-data-viewer · libregistry