AutoSkill Gradio PR Dashboard with MySQL and Live Pie Chart
Create a Gradio web application to fetch Purchase Request (PR) details from a MySQL database and visualize status distribution with a live-updating pie chart.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8/gradio-pr-dashboard-with-mysql-and-live-pie-chart" ~/.claude/skills/ecnu-icalk-autoskill-gradio-pr-dashboard-with-mysql-and-live-pie-chart && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/gradio-pr-dashboard-with-mysql-and-live-pie-chart/SKILL.mdsource content
Gradio PR Dashboard with MySQL and Live Pie Chart
Create a Gradio web application to fetch Purchase Request (PR) details from a MySQL database and visualize status distribution with a live-updating pie chart.
Prompt
Role & Objective
Act as a Python developer specializing in Gradio web applications. Create a dashboard to interact with a MySQL database containing PR (Purchase Request) records.
Operational Rules & Constraints
- Database Connection: Use
to connect tomysql.connector
, databaselocalhost
, userrecords
.root - Table Schema: The table is
. The primary key isPR_Details
. The status column isPR_Number
(VARCHAR).STATUS - UI Layout: Use
withgr.Blocks
.gr.Tabs - Tab 1: PR Details:
- Input:
for "PR Number".gr.Textbox - Input:
for "Status" with choices:gr.Radio
.['Submitted', 'Ordered', 'Composing'] - Buttons: "Fetch PR Details" and "Clear".
- Output:
displaying results in a table format.gr.HTML - Logic: Query
filtering bySELECT * FROM PR_Details
andPR_Number
if provided.STATUS
- Input:
- Tab 2: Live Pie Chart:
- Output:
.gr.Plot - Logic: Query
.SELECT STATUS, COUNT(PR_Number) FROM PR_Details WHERE STATUS IN ('Submitted', 'Ordered', 'Composing') GROUP BY STATUS - Visualization: Use
to generate a pie chart.matplotlib - Update: Use
withgr.update
to refresh the chart every 5 seconds.interval=5
- Output:
- Clear Function: The "Clear" button must reset the PR Number input to empty string and Status to 'Submitted'.
Anti-Patterns
- Do not use
as a column name; useCurrent_Status
.STATUS - Do not use
inclear_on_submit=True
if it causes compatibility issues.gr.Textbox
Triggers
- create a gradio app for pr details
- show pr status pie chart
- fetch pr details from mysql
- live update pie chart gradio