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.

Release files for citation-utils 1.0.1

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

Source distribution (sdist)

Source distribution for citation-utils 1.0.1
File Size Uploaded
citation_utils-1.0.1.tar.gz 26.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for citation-utils 1.0.1
File Interpreter ABI Platform
citation_utils-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 66.1 kB

Release files / citation_utils-1.0.1.tar.gz

Download URL citation_utils-1.0.1.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7b71f0e96084b3b3e833b88a9378371d97da81c270aaead438014efc5c963f1b
BLAKE2b-256 checksum
How to use checksums
b7c0bf270718d6da06eef62decaea81365856bb304d7125285c767c3c5ac69f7
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / citation_utils-1.0.1-py3-none-any.whl

Download URL citation_utils-1.0.1-py3-none-any.whl
Size 39.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97a0d30e8357363bf925934bca5f6d5cf4fac14e77cf44c4028fe396337207f5
BLAKE2b-256 checksum
How to use checksums
76195282c5c5a7db76959faff3dd305e97538ebc3779116188e967a28f8d0630
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.6.2

2 release files

0.5.0

2 release files

0.4.14

2 release files

0.4.13

2 release files

0.4.11

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 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