agentleFS
LouLouLibsLouLouLibs/claude-skills/skills/hathifiles/SKILL.md

hathifiles

Skill1 starsChanged 59 days agoMITView on GitHub

List, download, and query the HathiTrust HathiFiles — tab-separated dumps describing every item in the HathiTrust Digital Library (~18M rows: htid, access/rights, OCLC/ISBN/ISSN/LCCN, title, language, format, provider codes, author). Use when the user wants bulk HathiTrust metadata, to build a local lookup table, or to find all volumes matching attributes (e.g. public-domain English serials). For looking up a single known identifier, use the hathitrust-lookup skill instead.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check command -v hathifiles first.

    line 32
  2. Very specific:

    Run hathifiles list to see the current full and update files with sizes.

    line 51
  3. Very specific:

    Use column *positions* (see hathifiles header for the order):

    line 80
  4. Distinctive:

    No API key or authentication is needed.

    line 106
  5. Very specific:

    Update files are deltas, not cumulative — for a complete snapshot start from a monthly full file and apply later hathi_upd_* files if you …

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

hathifiles — HathiTrust bulk metadata

The HathiFiles are HathiTrust's bulk metadata distribution: a monthly full file with one row per item in the collection (~18M rows) plus daily update deltas, all gzipped tab-separated values. The hathifiles CLI discovers and downloads them and supplies the column schema (the data files have no header row); querying is then done with the dt tools or awk.

hathifiles list                       # what's available (newest first)
hathifiles fetch                      # download the latest monthly full file
hathifiles fetch --date 20260601      # a specific monthly full file
hathifiles fetch --update --date 20260618
hathifiles header                     # the 26 column names (tab-separated)
hathifiles header --describe          # column names + descriptions

This is bulk metadata, not full text. For one known identifier → metadata/links, use the hathitrust-lookup skill (the ht_bib_key and oclc_num columns here feed straight into it). HathiTrust full text is not openly available (see that skill's notes).

Install

Check command -v hathifiles first. If missing, download the release binary (the repo is public — no token needed):

mkdir -p ~/.local/bin
curl -fsSL -o ~/.local/bin/hathifiles \
  "https://github.com/LouLouLibs/claude-skills/releases/latest/download/hathifiles-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)"
chmod +x ~/.local/bin/hathifiles

Assets: hathifiles-linux-x86_64 (static musl) and hathifiles-darwin-arm64. Runtime requirement: curl on PATH (HTTPS/download is delegated to it). Querying additionally uses zcat/gunzip and, optionally, the dt-cli-tools (dtcat/dtfilter).

Workflow

1. Pick and download a file

Run hathifiles list to see the current full and update files with sizes. The monthly full file is large (~1.2 GB gzipped); downloads resume if interrupted (re-run the same fetch). Update files (hathi_upd_*) are small and hold only the last 24h of changes.

hathifiles fetch                      # -> prints the downloaded path

2. Query

The .gz is tab-separated with no header and no quoting, and titles contain raw " characters — which breaks readers that infer column types or honour quotes (including dtcat/dtfilter). Two reliable paths:

A. dt tools — convert to NDJSON first (every field becomes a string, so no type-inference or quoting surprises). Best for repeated/structured queries:

zcat hathi_full_20260601.txt.gz | hathifiles to-ndjson > hf.ndjson
dtfilter hf.ndjson --filter 'rights=pd' --filter 'lang=eng' --filter 'bib_fmt=BK' \
  --columns htid,title,oclc_num --limit 20

# For many queries over the full file, convert once to parquet (fast, typed):
dtcat hf.ndjson --convert parquet -o hf.parquet
dtfilter hf.parquet --filter 'access=allow' --columns htid,title

B. awk on the raw TSV — lightest, streams the gzip, no intermediate file. Use column positions (see hathifiles header for the order):

# public-domain English books -> htid (col 1), title (col 12)
zcat hathi_full_20260601.txt.gz \
  | awk -F'\t' '$3=="pd" && $19=="eng" && $20=="BK" {print $1"\t"$12}'

Column reference

hathifiles header --describe prints all 26 columns. The most useful:

#ColumnNotes
1htidvolume id — opens at babel.hathitrust.org/cgi/pt?id=<htid>
2accessallow / deny (full text viewable in the US)
3rightspd public domain, ic in-copyright, und undetermined, …
4ht_bib_keycatalog record number → ht-lookup recordnumber <key>
8oclc_numOCLC number(s) → ht-lookup oclc <num>
12title
16us_gov_doc_flag1 = US federal government document
19langMARC language code (eng, ger, …)
20bib_fmtBK book, SE serial, …

Notes

  • No API key or authentication is needed; the files are public.
  • Update files are deltas, not cumulative — for a complete snapshot start from a monthly full file and apply later hathi_upd_* files if you need currency.
  • HATHIFILES_BASE overrides the download host (used by the test harness).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.