Skip to main content

fathom — see what is in a JSON document, for Python

Fathom first. Then parse.

With a data frame you always know how to start: it has already answered what is a row before you arrive. JSON never answers that question, so the code you wrote for one file is useless on the next one — even when the two are nominally the same kind of thing.

fathom is the first thing you reach for. You point it at a document you have never seen and it tells you what you are dealing with.

import fathom

print(fathom.fathom("thread.json"))
  193 KB · valid JSON · read whole file
  no duplicate keys · no NaN or Infinity · no ints past 2^53

  KEYS THAT ARE DATA

  RECORD SHAPES, FOLDED
    $   336 copies · 13 fields · 1 distinct key-set · RECURSIVE, 13 levels
      always     author children created_at created_at_i id options parent_id points story_id text title type
                 url
      SPLIT ON   type — 2 kinds, not one shape. 23% empty folded, 0% after
        comment                          335 x  10 cols   0% empty
        story                              1 x  12 cols   0% empty

  25 levels deep · 181 distinct paths

  ONE ROW COULD BE — give any of these to rows()
    the whole document                      1 rows x   13 cols
    a node at any depth (13 levels)       336 rows x   13 cols   23% empty
      └─ or 2 tables, split on type — 0% empty: comment 335, story 1
    an item of children                    25 rows x   13 cols   23% empty

Three things happened there that are the whole point. It checked the file is sound before describing it. It folded 336 repeats into one shape, so the description is proportional to the structure rather than to the data — a 912 MB file and a 12 KB file produce descriptions of similar size. And it priced every answer to "what is a row", rather than picking one for you.

Then take the table you want

The menu is not decoration: give a label back to rows() and you get that table.

fathom.rows("thread.json", "an item of children")

Deeper, when the thing you want is nested — the pipe reads as a sentence:

(fathom.read_json("package.json")
   >> fathom.into("versions")
   >> fathom.into("dependencies")
   >> fathom.rows("an entry of $[]"))

Seven words, and that is the whole vocabulary

job words
read in read_json JSON, NDJSON or gzip
see fathom the whole shape, sound or not, row candidates priced
move into · back change where you are standing
search find · whichever locate a specific thing
leave rows out with a table

find("url") says which paths hold one and how many values each covers. whichever("Rating", "rating") takes the first spelling that is actually there, which is what a document written by more than one producer needs.

The same seven words, spelled the same way, work in R. One engine answers both, so the two languages cannot drift apart. The pipe is the only difference.

Installing

pip install fathom-json

The distribution is fathom-json and the import is fathom. The short name was taken on PyPI in 2011 by an unrelated project; every example and every chapter says import fathom regardless.

The wheel carries the engine for your platform, so there is no toolchain to set up and no dependencies at all.

It samples, by default

A very large document is read by sampling rather than in full, which is what keeps the description quick. fathom() says so in its own output when it does.

The manual, with every report in it computed by running this engine over real documents, is at https://psychometrician.github.io/fathom-book/.

Release files for fathom-json 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for fathom-json 0.0.1
File
fathom_json-0.0.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
fathom_json-0.0.1-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
fathom_json-0.0.1-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
fathom_json-0.0.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
fathom_json-0.0.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 2.5 MB

Release files / fathom_json-0.0.1-py3-none-win_amd64.whl

Download URL fathom_json-0.0.1-py3-none-win_amd64.whl
Size 408.2 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
edbf4005195ce4afe9d7fcd136b9e571b6a204c80df8f984e8a2b6b65f4f5bf4
BLAKE2b-256 checksum
How to use checksums
50c1206920e812078b730b316e99a225393835aa4def697a776be7eccb9cba3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / fathom_json-0.0.1-py3-none-manylinux_2_28_x86_64.whl

Download URL fathom_json-0.0.1-py3-none-manylinux_2_28_x86_64.whl
Size 558.3 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
708e059868e285ecaaa76df7d6b0270e2aca80ce2c91e8087e614e6b38151658
BLAKE2b-256 checksum
How to use checksums
b4b59217610e8d30f923e30f14e707c186906017494d7687868ab7227ba1b8f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / fathom_json-0.0.1-py3-none-manylinux_2_28_aarch64.whl

Download URL fathom_json-0.0.1-py3-none-manylinux_2_28_aarch64.whl
Size 531.5 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
57c38b247f6047c5b800b92f121f4b26eb60c3c9ee4e9e6c9fe386c67062b82e
BLAKE2b-256 checksum
How to use checksums
5e177233a02ade2f2e2e2d176f9463acba0ebbc41e093c4d6d8d399b6b9aa37d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / fathom_json-0.0.1-py3-none-macosx_11_0_arm64.whl

Download URL fathom_json-0.0.1-py3-none-macosx_11_0_arm64.whl
Size 503.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fae39d230a32297489691a83daa825165bad27aa911687bafd003c71868e78f3
BLAKE2b-256 checksum
How to use checksums
ccfd373160f1cf6a4c36271888c01c38ae26498a0c52c97abf0b277cf097a4eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / fathom_json-0.0.1-py3-none-macosx_10_12_x86_64.whl

Download URL fathom_json-0.0.1-py3-none-macosx_10_12_x86_64.whl
Size 533.3 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0ad57b0c8ad4190debf1114b2d410e14684867ee20681549d75b7c3b8582c00d
BLAKE2b-256 checksum
How to use checksums
1ffe763f177217432153252c9564d07dc4850f7898e2345e847517aa2b7cd5ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page