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.

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-0.6.2.tar.gz (25.5 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-0.6.2-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: citation_utils-0.6.2.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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-0.6.2.tar.gz
Algorithm Hash digest
SHA256 eea023462a2224dcc756f9ca0269f5ab921a9317992f5d493a77d893fa90c723
MD5 6d32513ff64af2e57ce215123554de39
BLAKE2b-256 d05cee574d738c61083fe63237143349bbc324200574e2bab8d67cef03c9d692

See more details on using hashes here.

File details

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

File metadata

  • Download URL: citation_utils-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aa844aa4a1b8d7fa4380c68a258c93e2ae9238c305e18a0be08bb5af3cd452d6
MD5 ed5325a5f325396803822c2392e6e22c
BLAKE2b-256 6fb9f5787f0cd3842c00cea1a648f147ff8af3b99a2c330076d07b9852c879a7

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