agentsclimarketplace

Gradio pr dashboard with mysql and live pie chart

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/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.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill gradio-pr-dashboard-with-mysql-and-live-pie-chart

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.3 KB, 464 tokens by cl100k_base, as published. Nobody here has run it

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

  1. Database Connection: Use mysql.connector to connect to localhost, database records, user root.
  2. Table Schema: The table is PR_Details. The primary key is PR_Number. The status column is STATUS (VARCHAR).
  3. UI Layout: Use gr.Blocks with gr.Tabs.
  4. Tab 1: PR Details:
    • Input: gr.Textbox for "PR Number".
    • Input: gr.Radio for "Status" with choices: ['Submitted', 'Ordered', 'Composing'].
    • Buttons: "Fetch PR Details" and "Clear".
    • Output: gr.HTML displaying results in a table format.
    • Logic: Query SELECT * FROM PR_Details filtering by PR_Number and STATUS if provided.
  5. 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 matplotlib to generate a pie chart.
    • Update: Use gr.update with interval=5 to refresh the chart every 5 seconds.
  6. Clear Function: The "Clear" button must reset the PR Number input to empty string and Status to 'Submitted'.

Anti-Patterns

  • Do not use Current_Status as a column name; use STATUS.
  • Do not use clear_on_submit=True in gr.Textbox if it causes compatibility issues.

Triggers

  • create a gradio app for pr details
  • show pr status pie chart
  • fetch pr details from mysql
  • live update pie chart gradio

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.