### 读入(数据提取) 读入 28+ 统计软件及临床试验数据格式(CDISC ODM/EpiData/EpiInfo/Excel/EViews/Feather/FST/GraphPad Prism/Gretl/HDF5/HTML/jamovi/JMP/JSON/MATLAB/Minitab/ODS/ORC/Parquet/R/SAS/SPSS/Stata/Weka ARFF/XML),转换为 Python/pandas DataFrame,并在不同格式之间**双向转换**,100% 保留变量标签、值标签
统计数据-传输/统计数据格式转换器 + 数据/传输器 + / 荣誉数据/传输器 行业标准 / 语言政策 + + + + + + + + + + + + + + 是一项面向实际任务的技能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
致敬 Stat/Transfer — 业界格式转换标杆 / Honoring Stat/Transfer — the industry standard
| Ability / 能力 | Description / 说明 |
|---|---|
| Read / 读入 | SPSS/Stata/SAS/R … full metadata; text/JSON/detect-only keep subset / 统计二进制格式完整保留元数据;文本/JSON 保留子集;12 种专有格式探测降级 |
| Convert / 转存 | Inter-convert most stats formats: SPSS↔Stata↔R↔SAS XPT↔… / 多数统计格式可互转(部分受限于规范) |
| Embed / 元数据嵌入 | Labels embed in Parquet/Feather/HDF5/JSON via schema.metadata / 标签嵌入 Arrow schema.metadata |
| Warn / 丢失警告 | Auto-detect metadata loss per conversion path / 自动检测并报告元数据损失 |
50+ formats, sorted alphabetically. 按字母排序。
| Format 格式 | Extension 扩展名 | Meta Preserve 元数据保留 |
|---|---|---|
| CDISC ODM | .odm |
⚠️ Clinical data only |
| dBASE / FoxPro | .dbf |
⚠️ Read+Write, uppercase names |
| EpiData | .rec |
⚠️ Via R |
| EpiInfo | .prj .xml |
✅ XML structure |
| Excel | .xlsx .xls .xlsm |
⚠️ Extra sheet for labels; merged-cell fill |
| EViews | .wf1 .wf2 |
⚠️ JSON structure |
| Feather | .feather .arrow |
✅ Via schema |
| FST | .fst |
✗ Detect-only (proprietary format) |
| GraphPad Prism | .pzfx .pz |
⚠️ Multi-table |
| Gretl | .gdt .gdtb |
✅ String-tables |
| HDF5 | .h5 .hdf5 |
⚠️ Hierarchy + attribute labels |
| HTML | .html |
⚠️ Tables only |
| jamovi | .omv |
✅ JSON analysis |
| JMP | .jmp |
⚠️ Multi-table |
| JSON | .json |
✅ stat-full-meta |
| MATLAB | .mat |
⚠️ v7.3+ via h5py fallback |
| Mathematica | .wdx |
⚠️ Best-effort XML |
| Minitab | .mtw .mpj |
⚠️ Via R |
| MS Access | .mdb .accdb |
⚠️ Multi-table; needs system driver |
| ODS | .ods |
⚠️ Data only |
| ORC | .orc |
✅ Via schema |
| Origin | .opju .oggu |
⚠️ Best-effort |
| Parquet | .parquet |
✅ Via schema; partitioned datasets |
| R | .rda .rds .rdata |
✅ pyreadr; R-interpreter fallback opt-in (allow_r_exec) |
| SAS | .sas7bdat .xpt .sas7bcat |
✅ |
| SPSS | .sav .zsav .por |
✅ |
| Stata | .dta |
✅ |
| Weka ARFF | .arff |
✅ Nominal mapping |
| XML | .xml |
⚠️ Structure preserved |
✅=Full · ⚠️=Partial/conditional · ✗=Not preserved
12 detect-only formats (SAS CPORT
.cpt, Statistica.sta, OxMetrics.in7, SYSTAT.sys/.syd, Paradox.db/.px, LIMDEP.lpw, NCSS.ncss) give clear export guidance — see README.
{
"dataframe": pd.DataFrame,
"metadata": {
"file_format": "spss_sav",
"row_count": 100, "column_count": 10,
"variable_labels": {"q1": "Question 1"},
"value_labels": {"q1": {1: "Yes", 2: "No"}},
# ... 全部元数据 / all metadata fields
},
"warnings": [],
"column_report": {"q1": {"source_type": "int", "pandas_dtype": "int64"}},
}
# Check environment / 检查环境 python scripts/check_env.py --install # Run via WorkBuddy (bilingual, auto-detects your language) > convert data.sav to .dta > read data.sav and show metadata > 把 data.sav 转成 .dta 并保留变量标签
For complete code examples, see
references/usage_examples.py. 完整代码示例见references/usage_examples.py。
requires:
bins: [python3]
packages:
core: [pyreadstat>=1.3.5,<2, pyreadr>=0.4,<0.5, pandas>=2.0,<3]
extended: [openpyxl, xlrd, scipy, h5py, pyarrow, lxml, odfpy, tableauhyperapi, dbfread, dbf, pyodbc]
Full list:
requirements.txt/ 完整列表见requirements.txt
README.md — format limits, strategies, encoding, extension guideREADME_ZH.md — 格式限制、读入策略、编码注意事项、扩展指南.rda/.rds/.RData (readRDS()/load()), reading Minitab .mtw/.mpj and EpiData .rec (foreign::read.mtb()/read.epiinfo()), and writing R formats (.rda/.rds) are disabled by default. They only run when you explicitly pass allow_r_exec=True on a TRUSTED file. Pure-Python parsers (pyreadr, mtbpy) are tried first and never execute code.allow_r_exec is not set, the skill raises a clear error instead of silently launching R — eliminating the risk of executing embedded code from untrusted files.commandArgs(trailingOnly=TRUE) via jsonlite) — never concatenated into executable R code. Random temp filenames; no fixed paths..hyper first writes to a temp file; only after success is the existing file rotated to .bak (prior .bak demoted to .bak.1, never silently deleted), then atomically swapped in. On write failure the original is untouched.pandas, pyreadstat, pyreadr) — see requirements.txt.python scripts/check_env.py --install only runs on explicit request..hyper outputs are backed up to .bak before overwrite.MIT. See LICENSE. / 详见 LICENSE。
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习
最新文章