xlsx
यह क्या करती है
यह AI एजेंट को Excel फ़ाइलों और बड़ी CSV या TSV टेबल्स के साथ काम करने का तरीका सिखाती है। यह उन सबके लिए है जिन्हें स्प्रेडशीट बनवानी, ठीक करवानी या उसका विश्लेषण करवाना है।
कब इस्तेमाल करें
- ✓जब आप Excel या CSV फ़ाइल अपलोड करते हैं और उसके डेटा का विश्लेषण या सफ़ाई चाहते हैं।
- ✓जब आपको formulas, formatting या charts के साथ नई स्प्रेडशीट बनवानी है।
- ✓जब आप चाहते हैं कि कोई गड़बड़ टेबल एक साफ़, काम की स्प्रेडशीट में व्यवस्थित हो।
Skill का लिंक
https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/skills/builtin/xlsx/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस स्प्रेडशीट को साफ़ कीजिए और मेरे लिए एक मासिक कुल कॉलम जोड़िए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट डेटा, formulas, styles और charts को वर्कबुक में लिखने के लिए एक Python लाइब्रेरी इस्तेमाल करता है। सेव करने के बाद वह जाँचने के लिए फ़ाइल फिर से खोलता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Excel (.xlsx) workbooks
Runtime
Use exec with complete Python source (language: python). Prefer creating,
saving, reopening, and validating the workbook in one call; later calls can
revise the same relative filename. Follow the turn's User workspace
instructions for locating inputs, output boundaries, and presenting the
finished file.
Use openpyxl for cells, formulas, styles, charts, merged cells, multi-sheet workbooks, number formats, and streaming large sheets. It is declared by every supported DeepTutor installation. Do not assume pandas is installed: it exists in the Docker runner but is not a direct dependency of every pip/source install.
THE critical gotcha: openpyxl writes formulas but never computes them
ws["B10"] = "=SUM(B2:B9)" stores the formula string. openpyxl has no formula
engine — the cached value stays empty (or stale, on an edited file). So:
- A workbook you create/edit with openpyxl opens fine in Excel/LibreOffice (they recompute on open), but its cached values are wrong until then.
- Anything reading cached values first —
data_only=True, another pandas/openpyxl pass, or a downstream tool — sees blanks/stale data.
Pick by what the deliverable needs:
- Static numbers (most common). If the user just needs correct values and
the sheet need not stay live, compute in Python and write the number, not
a formula string:
ws["B10"] = sum(c.value for c in ws["B2:B9"][0]). Correct immediately, no recalc needed. - Live model (formulas that recompute on the user's later edits). Write real
formulas, and reference cells not literals (
=B5*(1+$B$6), not=B5*1.05). openpyxl can't set the cached value too. Ifshutil.which("soffice")succeeds, recalculate throughexecusingsubprocess.runand a relative_recalc/directory, replaceout.xlsxwith the recalculated copy, then remove_recalc/. Never use/tmpor search for a desktop installation. A later exec call can see the same bare filename. If LibreOffice is absent, warn that formulas populate when the user opens the file in Excel.
Reading
from openpyxl import load_workbook
wb = load_workbook("in.xlsx", read_only=True, data_only=False)
for sheet_name in wb.sheetnames:
ws = wb[sheet_name]
for row in ws.iter_rows(values_only=True):
print(row)
To read computed results of formulas (not the formula text), use openpyxl
with data_only=True — returns the value Excel last cached:
from openpyxl import load_workbook
wb = load_workbook("in.xlsx", data_only=True)
val = wb["Sheet1"]["B10"].value # None if Excel never opened/saved the file
Gotcha: never save() a workbook loaded with data_only=True — that discards
every formula permanently (verified: the cell becomes None). Load twice if you
need both formulas and values.
Large file: load_workbook(path, read_only=True) streams rows cheaply.
Creating
from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font, PatternFill, Alignment
wb = Workbook()
ws = wb.active
ws.title = "Summary"
ws.append(["Region", "Sales"]) # header row
for r in [("West", 120), ("East", 95)]:
ws.append(r)
ws["B4"] = "=SUM(B2:B3)" # see formula gotcha above
ws["A1"].font = Font(bold=True)
ws["A1"].fill = PatternFill("solid", fgColor="DDDDDD")
ws["A1"].alignment = Alignment(horizontal="center")
ws["B2"].number_format = "#,##0" # thousands separator
ws.column_dimensions["A"].width = 18
ws.freeze_panes = "A2" # freeze header
wb.create_sheet("Detail") # second sheet
wb.save("out.xlsx")
# Validate immediately; later exec calls can also reopen this relative path.
check = load_workbook("out.xlsx", data_only=False)
assert check.sheetnames, "generated workbook has no worksheets"
import zipfile
with zipfile.ZipFile("out.xlsx") as package:
assert package.testzip() is None, "generated XLSX has a corrupt ZIP member"
For large exports, use openpyxl's write-only mode and append rows without holding every cell object in memory:
from openpyxl import Workbook
wb = Workbook(write_only=True)
ws = wb.create_sheet("Data")
ws.append(["id", "value"])
for row in rows:
ws.append(row)
wb.save("out.xlsx")
Editing (preserve existing formatting)
load_workbook keeps styles, formulas, merged cells, charts intact — edit only
what you touch. Do NOT round-trip through pandas to preserve formatting (pandas
rewrites the whole sheet, losing styles).
``
अक्सर पूछे जाने वाले सवाल
क्या यह formulas के साथ काम कर सकती है?
हाँ। यह formulas लिख सकती है, हालाँकि कुछ मान तभी अपडेट हो सकते हैं जब फ़ाइल Excel या किसी दूसरे स्प्रेडशीट ऐप में खुले।
क्या यह charts बना सकती है?
हाँ। स्किल merged cells, number formats और मल्टी-शीट वर्कबुक भी कवर करती है।
क्या यह CSV फ़ाइलें संभालती है?
हाँ। स्किल Excel फ़ाइलों के साथ बड़ी CSV और TSV टेबल्स भी कवर करती है।
जानकारी
लेखक का मूल विवरण
Read, create, or edit Excel spreadsheets (.xlsx/.xlsm) — sheet data, formulas, styles, charts, multi-sheet workbooks — and bulk .csv/.tsv tables; use whenever a spreadsheet is the input or the deliverable (extract/analyze data, add columns/formulas/formatting/charts, clean messy tables, build from scratch), but not for Google Sheets API or Word/PDF/script outputs.
repo: HKUDS/DeepTutor
लोकप्रियता
- GitHub स्टार
- 54k
- रैंकिंग में स्थान
- #3372
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
deeptutor-cli
54kयह आपके एजेंट को कमांड लाइन से DeepTutor, एक लर्निंग प्लेटफ़ॉर्म, सेट करने और चलाने में मदद करती है, जिसमें knowledge bases, notebooks और web ऐप शामिल हैं।
docx
54kआपके एजेंट को Word .docx फ़ाइलें पढ़ने, बनाने और संपादित करने में मदद करती है, जिनमें रिपोर्ट, टेबल, find-and-replace और comments के साथ tracked changes शामिल हैं।
आपके एजेंट को PDF फ़ाइलें पढ़ने, मिलाने, बाँटने, भरने और बनाने में मदद करती है, जिनमें उनसे टेक्स्ट और टेबल निकालना भी शामिल है।
pptx
54kआपके एजेंट को PowerPoint deck बनाने, पढ़ने और संपादित करने देती है, जिनमें स्लाइड का टेक्स्ट, speaker notes, charts और images शामिल हैं।
मिलती-जुलती skills
feishu-doc
394kयह आपके एजेंट को document टूल से Feishu क्लाउड दस्तावेज़ पढ़ने, बनाने और बदलने में मदद करती है, जिसमें टेक्स्ट, इमेज और टेबल शामिल हैं।
feishu-drive
394kयह आपके एजेंट को बॉट के साथ साझा किए गए Feishu क्लाउड फ़ोल्डर में फ़ाइलें देखने, व्यवस्थित करने और उन पर टिप्पणी करने देती है।
feishu-perm
394kयह आपके एजेंट को Feishu फ़ाइल तक किसकी पहुंच है, यह जांचने और बदलने देती है, और आपके अनुरोध के लिए सबसे छोटी अनुमति चुनती है।