用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill openpyxl-pandas-integration命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Write outbound email and external messages in Vamsee Achanta's voice — a subtle offer to help, never bold or rash claims. Load before drafting ANY email, LinkedIn/Collide reply, proposal note, or outreach sent under his name.
Save/publish analysis or computation results from ANY ecosystem repo to Hugging Face as a queryable, viewer-renderable dataset. Use when the user wants to "save results to hugging face", "publish dataset to HF", "hugging face data saving", "save analysis results", "hf dataset", "make results queryable", or "render via datasets-server API". Reshapes nested results into flat parquet tables, writes a dataset card with a viewer `configs:` block and provenance, applies license/public-vs-private routing, enforces a domain data-quality gate (faithful-to-source != correct), publishes to `aceengineer/<repo>-<projection>`, and verifies via the datasets-server API.
Clone, create, fork, configure, and manage GitHub repositories. Manage remotes, secrets, releases, and workflows. Works with gh CLI or falls back to git + GitHub REST API via curl.
正在显示 SKILL.md
基于 SOC 职业分类
| name | openpyxl-pandas-integration |
| description | Sub-skill of openpyxl: Pandas Integration (+1). |
| version | 1.0.0 |
| category | data |
| type | reference |
| scripts_exempt | true |
"""
Integration with pandas for data analysis workflows.
"""
import pandas as pd
from openpyxl import Workbook, load_workbook
from openpyxl.utils.dataframe import dataframe_to_rows
from openpyxl.styles import Font, PatternFill, Alignment
def dataframe_to_styled_excel(
df: pd.DataFrame,
output_path: str,
sheet_name: str = "Data",
header_color: str = "4472C4"
) -> None:
"""Export pandas DataFrame to styled Excel file."""
wb = Workbook()
ws = wb.active
ws.title = sheet_name
# Write DataFrame to worksheet
for r_idx, row in enumerate(dataframe_to_rows(df, index=False, header=True)):
for c_idx, value in enumerate(row, start=1):
cell = ws.cell(row=r_idx + 1, column=c_idx, value=value)
# Style header row
if r_idx == 0:
cell.fill = PatternFill(start_color=header_color, fill_type="solid")
cell.font = Font(bold=True, color="FFFFFF")
cell.alignment = Alignment(horizontal="center")
# Auto-adjust column widths
for column in ws.columns:
max_length = 0
column_letter = column[0].column_letter
for cell in column:
try:
if len(str(cell.value)) > max_length:
max_length = len(str(cell.value))
except:
pass
ws.column_dimensions[column_letter].width = min(max_length + 2, 50)
wb.save(output_path)
print(f"DataFrame exported to {output_path}")
def excel_to_dataframe_with_types(
file_path: str,
sheet_name: str = None,
dtype_mapping: dict = None
) -> pd.DataFrame:
"""Read Excel file to pandas DataFrame with proper type handling."""
# Read with openpyxl engine
df = pd.read_excel(
file_path,
sheet_name=sheet_name,
engine='openpyxl'
)
# Apply type mappings if provided
if dtype_mapping:
for col, dtype in dtype_mapping.items():
if col in df.columns:
df[col] = df[col].astype(dtype)
return df
def create_multi_sheet_report(
dataframes: dict,
output_path: str
) -> None:
"""Create Excel workbook with multiple DataFrames on separate sheets."""
with pd.ExcelWriter(output_path, engine='openpyxl') as writer:
for sheet_name, df in dataframes.items():
df.to_excel(writer, sheet_name=sheet_name, index=False)
# Access worksheet for formatting
ws = writer.sheets[sheet_name]
# Style header row
for cell in ws[1]:
cell.fill = PatternFill(start_color="4472C4", fill_type="solid")
cell.font = Font(bold=True, color="FFFFFF")
print(f"Multi-sheet report saved to {output_path}")
# Example usage
# df = pd.DataFrame({'A': [1, 2, 3], 'B': ['x', 'y', 'z']})
# dataframe_to_styled_excel(df, 'output.xlsx')
"""
Generate Excel reports from database queries.
"""
from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment, Border, Side
from openpyxl.utils import get_column_letter
from datetime import datetime
import sqlite3
from typing import List, Tuple, Any
def generate_database_report(
db_path: str,
queries: dict,
output_path: str
) -> None:
"""Generate Excel report from multiple database queries."""
conn = sqlite3.connect(db_path)
wb = Workbook()
# Remove default sheet
wb.remove(wb.active)
# Styles
header_fill = PatternFill(start_color="2F5496", fill_type="solid")
header_font = Font(bold=True, color="FFFFFF")
border = Border(
left=Side(style='thin'),
right=Side(style='thin'),
top=Side(style='thin'),
bottom=Side(style='thin')
)
for sheet_name, query in queries.items():
# Execute query
cursor = conn.execute(query)
columns = [description[0] for description in cursor.description]
rows = cursor.fetchall()
# Create sheet
ws = wb.create_sheet(sheet_name)
# Add metadata
ws['A1'] =
ws[].font = Font(bold=, size=)
ws[] =
ws[].font = Font(italic=, size=)
col_idx, header (columns, start=):
cell = ws.cell(row=, column=col_idx, value=header)
cell.fill = header_fill
cell.font = header_font
cell.alignment = Alignment(horizontal=)
cell.border = border
row_idx, row (rows, start=):
col_idx, value (row, start=):
cell = ws.cell(row=row_idx, column=col_idx, value=value)
cell.border = border
(value, (, )):
cell.number_format =
col_idx (, (columns) + ):
ws.column_dimensions[get_column_letter(col_idx)].width =
ws.cell(row=(rows) + , column=, value=)
conn.close()
wb.save(output_path)
()