Skip to main content

centralia

Court PDF opinion extractor: a PDF plus a court id in, a typed document out.

Requires Python 3.13 or newer.

python -m pip install centralia
from centralia import read

r = read("opinion.pdf", court_id="nmariana")   # path, bytes, or file object

r["status"]       # valid | review | scanned | failed
r["cluster"]      # the case: citation, docket, dates (as printed + ISO), panel, parties
r["opinions"]     # one entry per writing, each with its author, pages, html and text
r["diagnostics"]  # page facts and anything unplaced — reported, never judged
r["html"]         # the document's text, without review furniture
r["review_html"]  # the reviewer's page: criteria box, Removed panel, role tints
r["casebody"]     # Harvard casebody XML

Lower level, for callers that want the objects:

from centralia import extract, render_opinion

result = extract("opinion.pdf", court_id="mont")
result.document          # typed Document
result.trace             # per-decision evidence chains
render_opinion(result.document.opinions[0])

Dates are returned twice: as the court printed them (date_filed) and as YYYY-MM-DD where that can be read without guessing (date_filed_iso, or None). diagnostics["dates_unparsed"] names the ones that did not parse.

status is a report, not a gate. diagnostics carries the page-level facts a caller needs to decide for itself: which pages are a raster (scan_pages), which pages have no text layer at all so their words are absent (text_missing_pages), which carry unmapped glyphs (cid_pages), and what the extractor could not place (residual).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

centralia-0.0.1.tar.gz (26.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

centralia-0.0.1-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file centralia-0.0.1.tar.gz.

File metadata

  • Download URL: centralia-0.0.1.tar.gz
  • Upload date:
  • Size: 26.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for centralia-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ba6f44c01302a58f3c2c1fb73efab0661fca9b8bfc66d9e2e4f1930003a02fbe
MD5 f0f3a253124e002817cea73f0cbcf14a
BLAKE2b-256 678fb9d2f233dc98752ead364899da056c13017d2643ce8403585363a5f8bd31

See more details on using hashes here.

Provenance

The following attestation bundles were made for centralia-0.0.1.tar.gz:

Publisher: pypi.yml on freelawproject/centralia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file centralia-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: centralia-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for centralia-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69ec7db94d7a305d8545220270686e78f9a96f768b5b1fb211062f94a24fe14a
MD5 a6b6c6c4c9168d69ee510d02abef413d
BLAKE2b-256 b91f20e5e9a0efe0325cdb18beb5a6db09836d303b87ae472852c4ea58f6dbd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for centralia-0.0.1-py3-none-any.whl:

Publisher: pypi.yml on freelawproject/centralia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.0.2

2 files

This release

0.0.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page