Skip to main content

centralia

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

Requires Python 3.12 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.2.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.2-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: centralia-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ed3c885b4181539f3ee22c77c2f4d5e92d4c587e7f08464577d5e030f6185347
MD5 02c6d6a7bea4ebd69ec85df4ef8a76cf
BLAKE2b-256 075c7a3feee2456fc6923e2a08152ac4b9866be46463c1a09a3257aec37cbfec

See more details on using hashes here.

Provenance

The following attestation bundles were made for centralia-0.0.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: centralia-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cd12fab360db02746ad324cd08b4cae7bdbb3e9de1d12df03b85fabcea64ab2a
MD5 ccd78c6a47bb8bce84d829b8fe622011
BLAKE2b-256 6b81b4a91d945e8776bff145e40d21cecf13aaba52cff280c0820f650c19aebe

See more details on using hashes here.

Provenance

The following attestation bundles were made for centralia-0.0.2-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

This release

0.0.2 This release

2 files

0.0.1

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