panel-xml
provides the XML
pane to display and explore XML in notebooks and Panel data apps.
It is based on react-xml-viewer.
- Configurable Depth: Set an initial collapsible depth for better navigation.
- Collapse/Expand Tags: Intuitively collapse or expand tags to streamline XML exploration.
- Customizable Theme: Configure the colors and appearance with a customizable theme.
You can install panel-xml
using pip
:
pip install panel-xml
Here’s how to create a simple XML pane using the XML
widget:
import panel as pn
from panel_xml import XML
pn.extension()
xml = '''
<ul>
<li>Hello</li>
<li>World</li>
</ul>
'''
XML(xml, depth=2).servable()
object
(str): The XML string to display in a prettified format.indent_size
(int): The size of the indentation.collapsible
(bool): Enable collapsing/expanding tags. When collapsed, content and attributes are hidden.depth
(int): Whencollapsible
is set toTrue
, this defines the initial collapsed depth. Set it to0
for fully collapsed, or-1
for fully expanded.theme
(dict): A dictionary to customize the theme. See the react-xml-viewer theme documentation for details.
Open the XML Editor to explore the features and documentation of the XML
pane interactively.
Contributions and co-maintainers are very welcome! Please submit issues or pull requests to the GitHub repository. Check out the DEVELOPER_GUIDE for more information.
- Panel CodeEditor: Displays XML nicely if
language="xml"
.
Start using panel-xml
to integrate rich, interactive XML displays directly into your Python applications!