convez.ai
SkillDados & AnalyticsIntermediário
SU-OSPO

Tariff Doc Extractor Skill

SU-OSPO/tariff-claude-skill

Converte PDFs de tarifas históricas em dados estruturados

Ver no GitHub
InicialPluginScore · de 0 a 100

Skill para Claude que digitaliza PDFs históricos de tarifas Schedule A dos EUA em planilhas estruturadas em Excel e CSV. Extrai conteúdo tabular de documentos escaneados e converte em dados estruturados e legíveis por máquina, com suporte a descrições hierárquicas, metadados e notas de rodapé.

Instalação

$npx convez-ai SU-OSPO/tariff-claude-skill

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
50%
Último commit
há 4 meses
Versão
v1.2.0
Issues abertas
0
Contribuidores
2

Casos de uso

  • Digitalizar documentos tarifários históricos em massa
  • Extrair dados comerciais e classificações de commodities de PDFs escaneados
  • Converter tabelas complexas de documentos legados em planilhas estruturadas

Veredito

Ferramenta especializada e bem-documentada para um caso de uso específico (tarifas históricas). Implementação sólida com exemplos reais, mas nicho limitado — ideal para pesquisadores e analistas trabalhando com documentos tarifários legados dos EUA.

README

A tradução para o português deste README ainda está na fila.

Tariff Doc Extractor Skill

DOI

A Claude skill for digitizing historical U.S. Schedule A tariff PDFs into structured Excel and CSV spreadsheets.

This repository packages an instruction file plus training data that teaches Claude how to read scanned Schedule A tariff documents and extract their tabular contents into a machine-readable output.

Example

The examples/ folder contains a sample input PDF and the spreadsheet Claude produces from it.

Input: examples/1937_Schedule_A_Example.pdf — 8 pages from Group 00 (Animals and Animal Products, Edible) of the 1937 Schedule A.

Output: examples/1937_Schedule_A_Example.xlsx — a Tariff Data sheet, one row per commodity. First rows:

Economic ClassSchedule A Commodity NumberCommodity DescriptionUnit of QuantityRate of DutyTariff Paragraph
20010 000Cattle: Weighing less than 175 pounds eachNo......20; Lb.......12½¢ lb.; 1¼¢ lb. Canada701
20010 100Cattle: Weighing 175 pounds and less than 700 pounds eachNo......20; Lb.......12½¢ lb.701
20012 000Sheep and lambsNo......20$3 each702

Hierarchical descriptions in the source PDF are flattened with : so each row is self-contained, and multiple values within a cell (rates, paragraphs) are joined with ;.

Requirements

  • A Claude account with skills enabled. See the Claude help center for plan-specific setup.
  • A Schedule A tariff PDF to digitize. The skill has been calibrated on the 1939 and 1950 editions and works on similar yearly schedules.

Installation

  1. Download the latest tariff-doc-skill.skill.
  2. In claude.ai, go to Customize → Skills in the left sidebar and click Add skill (+ button) → Create skill → Upload a skill.
  3. Select the tariff-doc-skill.skill file. It will appear in your skills list and become available in all conversations.

Usage

  1. Start a new conversation at claude.ai.
  2. Upload your tariff PDF via the attachment icon.
  3. Ask Claude to extract it by using the /tariff-doc-skill command or with natural language.
  4. Wait for processing — a few minutes, depending on page count.
  5. Download the output files Claude presents.

Tips: Process one document per conversation for best results. For PDFs over 30 pages, split into smaller chunks. If you know the edition, tell Claude (e.g., "This is a 1939 Schedule A"). Always spot-check the output against the source PDF, which is included in the output for that purpose.

Output Format

Each run produces:

  • An Excel (.xlsx) workbook with three sheets: Tariff Data, Metadata, and Footnotes
  • A matching CSV of the Tariff Data sheet
  • A matching CSV of the Metadata sheet
  • A copy of the original PDF for verification

Tariff Data sheet

One row per commodity.

ColumnDescription
Economic ClassNumeric code from the PDF's leftmost column
Schedule A Commodity NumberNormalized commodity number (e.g., 0010 000)
Commodity DescriptionFull hierarchical description, flattened with :
Unit of QuantityReporting unit and code
Rate of DutyOne or more duty rates, joined with ;; footnote markers preserved as superscript Unicode (¹, ², etc.)
Tariff ParagraphOne or more paragraph numbers, joined with ;

Metadata sheet

A two-column key-value table (Field, Value) intended as a provenance record so downstream users can audit how the data was produced. Fields include:

  • Source document identifiers (filename, title, edition, groups and sections covered)
  • Processing statistics (pages processed, total rows extracted, extraction date, extraction method)
  • Per-column transformation rules (e.g., how period notation was converted to the spaced XXXX XXX format)
  • Notes on edge cases (bilateral bound rates, compound paragraph references, footnote-handling caveats, ALL CAPS section headers excluded as hierarchy resets)

Footnotes sheet

Captures footnotes from the source PDF separately so they can be joined back to Tariff Data rows by marker.

ColumnDescription
Page NumberPage in the source PDF where the footnote appears
Footnote MarkerMarker as printed in the source (e.g., 1, 2)
Footnote TextFull text of the footnote

The same marker may appear on multiple pages with different meanings, so joins typically need both Page Number and Footnote Marker.

Troubleshooting

  • Claude doesn't recognize the skill — Make sure you uploaded the tariff-doc-skill.skill file (not just SKILL.md) through Settings → Skills. Refresh the page and start a new conversation.
  • Training data not found — The training data must be inside the tariff-doc-skill.skill file. If you edited and re-uploaded only SKILL.md, the training data was lost. Repackage the full tariff-doc-skill.skill file with the references/ folder.
  • Processing stops on a large document — Split the PDF into 10–20 page chunks and process each in a separate conversation.

Repository Structure

tariff-doc-skill/
├── LICENSE
├── README.md
├── SKILL.md
├── examples/
│   ├── 1937_Schedule_A_Example.pdf
│   └── 1937_Schedule_A_Example.xlsx
└── references/
    ├── training_data.csv
    └── training_data.pdf

The references/ folder contains the training data Claude uses at runtime to calibrate extraction — description formats, commodity-number conventions, and tariff-paragraph styles. It must remain bundled inside the tariff-doc-skill.skill file.

The examples/ folder contains the sample input and output referenced in the Example section.

Each release contains a tariff-doc-skill.skill file, which is a zip archive that bundles SKILL.md together with the references/ folder — this is what users upload to Claude.

Modifying the Skill

To edit the skill manually:

  1. Rename tariff-doc-skill.skill to tariff-doc-skill.zip and unzip it.
  2. Edit SKILL.md in any text editor.
  3. Re-zip the folder, keeping references/ inside.
  4. Rename the result back to tariff-doc-skill.skill.
  5. Upload the updated tariff-doc-skill.skill file in Settings → Skills to apply the changes.

Alternatively, ask Claude to revise the skill in a conversation; it will produce an updated SKILL.md for download. You will still need to repackage the tariff-doc-skill.skill file to include the references/ folder.

License

This project is licensed under the MIT License. See LICENSE for the full text.

Support

Developed and maintained by the Open Source Program Office at Syracuse University. Reach out for feedback and suggested improvements:

Credits

The historical Schedule A PDFs used as examples and training data are U.S. federal government works in the public domain (17 U.S.C. § 105). The example PDF was digitized by Google and made available via HathiTrust from a Penn State library copy.

This project was supported as part of a grant (#G2023-20946) from the Alfred P. Sloan Foundation.

Ver o original no GitHub

Bom para

Relacionados