Absolutely! Here’s a breakdown of your requirements and some free tools that can help you create an operations dashboard for statistical process control (SPC), given your folder structure and XML data.
Requirements Recap
- Input: Folder with subfolders per device, each with subfolders per testrun, each containing XML files.
- Data: Each XML file has multiple tests (metrics), each with upper/lower spec and actual value.
- Needs: Tool must traverse folders, parse XML, aggregate data, and visualize SPC metrics (e.g., control charts, spec violations).
- Cost: Free.
Recommended Solution: Python + Dash (Plotly) or Streamlit
Why?
- Python is excellent for file traversal, XML parsing, and data manipulation.
- Dash and Streamlit are free, open-source frameworks for building interactive dashboards.
- Both support real-time data updates and interactive charts (including SPC charts).
- You have full control over data processing and visualization.
Step-by-Step Solution
1. Data Collection & Parsing
- Use Python’s
os and glob modules to traverse folders.
- Use
xml.etree.ElementTree or lxml to parse XML files and extract metrics.
2. Data Aggregation
- Use
pandas to aggregate and process the data for SPC analysis.
3. Dashboard Creation
- Use Dash or Streamlit to create interactive dashboards.
- Use Plotly for control charts, histograms, and other SPC visualizations.
Sample Workflow
A. Folder Traversal & XML Parsing
import os
import xml.etree.ElementTree as ET
import pandas as pd
data = []
for root, dirs, files in os.walk('path_to_data_folder'):
for file in files:
if file.endswith('.xml'):
filepath = os.path.join(root, file)
tree = ET.parse(filepath)
root_elem = tree.getroot()
for test in root_elem.findall('.//Test'):
metric = test.find('Metric').text
value = float(test.find('Value').text)
usl = float(test.find('USL').text)
lsl = float(test.find('LSL').text)
data.append({'Device': os.path.basename(os.path.dirname(root)),
'TestRun': os.path.basename(root),
'Metric': metric,
'Value': value,
'USL': usl,
'LSL': lsl})
df = pd.DataFrame(data)
B. Dashboard with Streamlit
import streamlit as st
import plotly.express as px
st.title("SPC Dashboard")
metric = st.selectbox("Select Metric", df['Metric'].unique())
filtered = df[df['Metric'] == metric]
fig = px.line(filtered, x='TestRun', y='Value', color='Device',
title=f"Control Chart for {metric}")
fig.add_hline(y=filtered['USL'].iloc[0], line_dash="dash", line_color="red")
fig.add_hline(y=filtered['LSL'].iloc[0], line_dash="dash", line_color="red")
st.plotly_chart(fig)
Alternative Free Tools
1. Power BI Desktop (Free)
- Can import data via Python scripts.
- Good for dashboards, but less flexible for custom folder traversal and XML parsing.
2. Grafana + Simple Python Exporter
- Use Python to parse XML and push data to a time-series database (like InfluxDB or SQLite).
- Grafana (free) for dashboarding.
3. Jupyter Notebook
- Great for prototyping and analysis, but less interactive for end-users.
Summary Table
| Tool | Folder Traversal | XML Parsing | SPC Charts | Free | Ease of Use |
|---|
| Python + Dash/Streamlit | Yes | Yes | Yes | Yes | Moderate |
| Power BI Desktop | Limited (via Python) | Yes | Yes | Yes | Easy |
| Grafana + Exporter | Yes | Yes | Yes | Yes | Moderate |
| Jupyter Notebook | Yes | Yes | Yes | Yes | Easy (for devs) |
Recommendation
Python + Streamlit is likely the fastest and most flexible way to get a free, interactive SPC dashboard with your folder structure and XML data.
If you want a starter template or more detailed code, let me know!