Pdf Dft Extractor logo

Pdf Dft Extractor

Organization
InternScience
pdf-dft-extractor

Extract DFT calculation coordinates from PDF files and generate Gaussian gjf files. 从PDF文件中提取DFT计算坐标并生成Gaussian gjf输入文件。 Supports batch processing with separate output folders for each PDF. 支持批量处理,每个PDF单独生成输出文件夹。

Overview

PublisherInternScience
RepositoryChemClaw
Skill namepdf-dft-extractor
Stars
53
Forks
13
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by InternScience on GitHub. Read the source before you install it.

Installation

Install the Pdf Dft Extractor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/InternScience/ChemClaw/tree/main/skills/pdf-dft-extractor
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/InternScience/ChemClaw.git /tmp/ChemClaw
mkdir -p .claude/skills
cp -r /tmp/ChemClaw/skills/pdf-dft-extractor .claude/skills/pdf-dft-extractor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Pdf Dft Extractor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Pdf Dft Extractor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Pdf Dft Extractor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

PDF DFT Extractor | DFT坐标提取器

Extract DFT calculation coordinates from PDF files (especially supplementary materials) and generate Gaussian input files (.gjf). Supports batch processing with separate output folders for each PDF. 从PDF文件(特别是论文支撑材料)中提取DFT计算坐标,生成Gaussian输入文件(gjf)。支持批量处理,每个PDF文件单独生成一个输出文件夹。

功能特性

  • 📄 PDF转Markdown: 使用MinerU API将PDF转换为结构化Markdown
  • 🧮 自动提取DFT坐标: 从计算化学部分自动识别和提取分子坐标
  • 📁 批量处理: 支持同时处理多个PDF文件
  • 📂 独立输出: 每个PDF文件生成单独的输出文件夹
  • ⚙️ 可配置参数: 支持自定义CPU核数、内存、计算方法等

快速开始

命令行使用

bash
# 单个PDF文件
python extract_dft.py paper.pdf

# 批量处理整个目录
python extract_dft.py ./pdfs/

# 指定输出目录和计算参数
python extract_dft.py ./pdfs/ -o ./output/ --cpu 64 --mem 128GB

Python API使用

python
from extract_dft import process_pdf, batch_process

# 处理单个PDF
result = process_pdf(
    pdf_path="paper.pdf",
    output_dir="./output/paper1",
    cpu=64,
    mem="128GB",
    method="B3PW91/def2TZVP em=d3bj"
)

# 批量处理
results = batch_process(
    pdf_dir="./pdfs/",
    output_base_dir="./output",
    cpu=64,
    mem="128GB"
)

参数说明

参数默认值说明
-o, --output./dft_output输出目录
--cpu64CPU核数
--mem128GB内存
--methodB3PW91/def2TZVP em=d3bj计算方法和色散校正
--solventSMD(toluene)溶剂模型
--charge0电荷
--multiplicity1自旋多重度
--keywordsopt freq计算关键词
--keep-tempFalse保留临时文件

关于Gaussian计算方法的写法

在Gaussian中,色散校正需要单独使用em=关键词指定,不要写成B3PW91-D3(BJ)的形式。

✅ 正确写法:

# B3PW91/def2TZVP em=d3bj opt freq

❌ 错误写法:

# B3PW91-D3(BJ)/def2TZVP opt freq   ← 这种写法Gaussian不识别

常用色散校正关键词:

色散校正关键词
D3 with Becke-Johnson dampingem=d3bj
D3 with zero dampingem=d3 or em=gd3
D3(BJ) for DFT-D3em=d3bj
Grimme's GD3em=gd3
GD3BJem=gd3bj

示例对比:

bash
# B3PW91 with D3BJ
--method "B3PW91/def2TZVP em=d3bj"

# B3LYP with GD3  
--method "B3LYP/6-31G(d) em=gd3"

# PBE0 with D3BJ
--method "PBE1PBE/def2TZVP em=d3bj"

# ωB97X-D (已内置色散,无需额外添加)
--method "wB97XD/def2TZVP"

输出目录结构

output/
├── paper1/                        # 每个PDF一个独立文件夹
│   ├── README.txt                 # 文件说明和统计
│   ├── 01_molecule_b3pw91.gjf    # 生成的gjf文件
│   ├── 02_molecule_b3pw91.gjf
│   └── ...
├── paper2/
│   ├── README.txt
│   └── ...
└── ...

生成的gjf文件格式

%chk=molecule.chk
%mem=128GB
%nprocshared=64
# B3PW91/def2TZVP em=d3bj nosymm int=ultrafine SMD(toluene) opt freq

molecule_name

0 1
C      -1.46713000   0.31261700   0.00075400
H      -1.10131700   0.82908900  -0.88608000
...

注意: 色散校正em=d3bj是单独的关键词,不是方法名的一部分。这是Gaussian的标准写法。

完整示例

示例1: 处理单个PDF

bash
python extract_dft.py 41557_2026_2096_MOESM1_ESM.pdf \
    -o ./output \
    --cpu 64 \
    --mem 128GB \
    --method "B3PW91/def2TZVP em=d3bj" \
    --solvent "SMD(toluene)"

生成的关键词行:

# B3PW91/def2TZVP em=d3bj nosymm int=ultrafine SMD(toluene) opt freq

注意: em=d3bj是独立的Gaussian关键词,用于启用Grimme的D3色散校正(Becke-Johnson阻尼),不是方法名的一部分。

输出:

./output/
├── README.txt
├── 01_trifluoroethane_b3pw91.gjf
├── 02_khmds_dimer_b3pw91.gjf
├── 03_khmds_monomer_b3pw91.gjf
└── ... (174个gjf文件)

示例2: 批量处理多个PDF

bash
# 将多个PDF放入一个目录
mkdir -p ./papers
cp paper1.pdf paper2.pdf paper3.pdf ./papers/

# 批量处理
python extract_dft.py ./papers/ -o ./all_outputs

输出:

./all_outputs/
├── paper1/
│   ├── README.txt
│   └── *.gjf
├── paper2/
│   ├── README.txt
│   └── *.gjf
└── paper3/
    ├── README.txt
    └── *.gjf

示例3: 不同DFT方法的写法

bash
# B3PW91 with D3BJ (最常用的色散校正DFT)
python extract_dft.py paper.pdf --method "B3PW91/def2TZVP em=d3bj"

# B3LYP with GD3
python extract_dft.py paper.pdf --method "B3LYP/6-31G(d) em=gd3"

# PBE0 with D3BJ
python extract_dft.py paper.pdf --method "PBE1PBE/def2TZVP em=d3bj"

# ωB97X-D (长程校正泛函,已内置色散)
python extract_dft.py paper.pdf --method "wB97XD/def2TZVP"

# M06-2X (Minnesota泛函,已内置色散)
python extract_dft.py paper.pdf --method "M062X/def2TZVP"

# TPSSh with D3BJ (meta-GGA)
python extract_dft.py paper.pdf --method "TPSSh/def2TZVP em=d3bj"

示例4: Python API调用

python
from extract_dft import process_pdf

# 自定义所有参数
result = process_pdf(
    pdf_path="supplementary_material.pdf",
    output_dir="./my_output",
    cpu=32,
    mem="64GB",
    method="B3LYP/6-31G(d) em=gd3",
    solvent="SMD(water)",
    charge=0,
    multiplicity=1,
    keywords="opt freq scrf"
)

if result["success"]:
    print(f"提取了 {result['molecule_count']} 个分子")
    print(f"输出目录: {result['output_dir']}")
else:
    print(f"错误: {result['error']}")

支持的计算方法

脚本会自动识别PDF中使用的计算方法,包括但不限于:

  • B3PW91, B3LYP, PBE0, ωB97X-D, M06-2X, M06-L, BP86
  • 支持各种色散校正 (D3, D3BJ, GD3, etc.)

重要: 在Gaussian输入文件中,色散校正必须通过独立的em=关键词指定,而不是作为方法名的一部分。

原文中的写法Gaussian正确写法
B3PW91-D3(BJ)B3PW91/def2TZVP em=d3bj
B3LYP-D3B3LYP/6-31G(d) em=gd3
PBE0-D3BJPBE1PBE/def2TZVP em=d3bj
ωB97X-DwB97XD/def2TZVP (已内置色散)
M06-2XM062X/def2TZVP (已内置色散)

依赖要求

  • Python 3.8+
  • MinerU PDF Converter (会自动调用)

注意事项

  1. 大文件处理: 超过600页的PDF会自动分批处理
  2. 每日限制: MinerU API每日免费额度2000页
  3. 网络要求: 需要联网调用MinerU API
  4. 文件名过滤: 会自动过滤掉包含HTML标签或非法字符的分子名称
  5. 坐标验证: 会自动过滤原子数超过10000的异常结构

故障排除

问题: 未找到分子坐标

  • 确保PDF中包含"Computed coordinates"或类似的坐标部分
  • 检查PDF是否为扫描版(需要可搜索的文本)

问题: MinerU API调用失败

  • 检查网络连接
  • 可能是API限额已满,请等待或联系管理员

问题: 生成的gjf文件不完整

  • 使用 --keep-temp 参数保留临时文件进行调试
  • 检查PDF中的坐标表格格式是否标准

相关SKILL

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Pdf Dft Extractor AI skill do?

Extract DFT calculation coordinates from PDF files and generate Gaussian gjf files. 从PDF文件中提取DFT计算坐标并生成Gaussian gjf输入文件。 Supports batch processing with separate output folders for each PDF. 支持批量处理,每个PDF单独生成输出文件夹。

Why use Pdf Dft Extractor on TypingMind?

Because you install it once and use it with any model. Pdf Dft Extractor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Pdf Dft Extractor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/InternScience/ChemClaw/tree/main/skills/pdf-dft-extractor. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Pdf Dft Extractor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Pdf Dft Extractor?

As many as you like. As long as a model supports skills, you can use Pdf Dft Extractor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Pdf Dft Extractor AI skill free?

Yes. It is published on GitHub by InternScience under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇