Skip to main content

Github CI

Citation Utilities

citation-utils extracts and normalizes Philippine Supreme Court citations that include a docket, a report citation, or both. It composes citation-date and citation-report for the LawSQL data pipeline.

The package is corpus-driven. It preserves the reported citation components that are present in the source rather than inferring missing case metadata. It helps locate and normalize references; it does not authenticate a document or prove the correctness of an OCR reading. Retain source text and location for legal review.

Quick Example

from citation_utils import Citation

raw = "G.R. No. 147033, April 30, 2003, 374 Phil. 1"
citation = Citation.extract_citation(raw)

assert citation is not None
assert citation.model_dump() == {
    "cat": "gr",
    "num": "147033",
    "date": "2003-04-30",
    "phil": "374 phil. 1",
    "scra": None,
    "offg": None,
}

Documentation

See the documentation for source-review limits, extraction and counting behavior, supported docket types, SQLite-oriented output, and local development checks. The 1.0 release history compares the stable release with the previously pushed 0.5.0 package.

Boundaries

  • citation-date owns date grammar and date normalization.
  • citation-report owns reporter grammar and report normalization.
  • citation-utils owns docket grammar, joins dockets to reports, and provides database-ready citation records.

Administrative Matter and Bar Matter references can name rules rather than decisions. The default extraction flow excludes only known statutory serials using an exact canonical match; pass exclude_docket_rules=False only when the calling workflow needs those rule references as evidence.

Download files

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

Source Distribution

citation_utils-1.0.1.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

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

citation_utils-1.0.1-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file citation_utils-1.0.1.tar.gz.

File metadata

  • Download URL: citation_utils-1.0.1.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for citation_utils-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7b71f0e96084b3b3e833b88a9378371d97da81c270aaead438014efc5c963f1b
MD5 a0123ad4616ee7ac4429f9bd5c8240a4
BLAKE2b-256 b7c0bf270718d6da06eef62decaea81365856bb304d7125285c767c3c5ac69f7

See more details on using hashes here.

File details

Details for the file citation_utils-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: citation_utils-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for citation_utils-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97a0d30e8357363bf925934bca5f6d5cf4fac14e77cf44c4028fe396337207f5
MD5 4d45ba869fe3df5a2dbd1080143f9b0f
BLAKE2b-256 76195282c5c5a7db76959faff3dd305e97538ebc3779116188e967a28f8d0630

See more details on using hashes here.

Supported by

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