Skip to main content

Regex date formula and decoder - Philippine Supreme Court Decisions

Project description

Github CI

Citation Date Parser

citation-date is a Python library for parsing and normalizing dates from Philippine legal citations, including dockets, reports, and other references. It handles common typos and multiple date formats with US and UK variants. It is eventually used by the dataset employed in LawSQL.

Purpose

The library is designed to:

  • Extract dates from text commonly found in legal documents such as Philippine Supreme Court reports (SCRA) and dockets (G.R. No. ...).
  • Handle both US (Month Day, Year) and UK (Day Month Year) date formats.
  • Normalize dates to standard formats (%B %d, %Y or datetime.date).
  • Support dates enclosed in parentheses () or brackets [], and in raw strings.
  • Provide regex patterns and utility functions for downstream processing in other citation libraries.

Key Components

Regex Patterns

US/UK Date Patterns

us = rf"({month}{separator}{day}{separator}{year})"
uk = rf"({day}{separator}{month}{separator}{year})"

These patterns detect date-like strings and account for common separators.

Report Dates

  • REPORT_DATE_REGEX matches dates in citations like 1 SCRA 200 (1Dec. 2000).
  • Supports naked dates, bracketed [Dec. 1, 2000], or parenthesis (Dec. 1, 2000).

Docket Dates

  • DOCKET_DATE_REGEX matches docket-specific dates such as G.R. No. 12345, Dec,1, 2000.
  • DOCKET_DATE_FORMAT standardizes formatting to %b. %d, %Y.

Documentation

See documentation.

Project details


Download files

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

Source Distribution

citation_date-0.2.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

citation_date-0.2.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file citation_date-0.2.1.tar.gz.

File metadata

  • Download URL: citation_date-0.2.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for citation_date-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b0f5c007072a896ec44b1eb390065c1008e1f5a8cd206453e94f60d8f4ef2b9e
MD5 66cfe1a8201d434e601026810b9e80ae
BLAKE2b-256 7ca506b19c5b9684cecbadc0c4e66db6d043f1c276845b9710c3aec5c77c39f0

See more details on using hashes here.

File details

Details for the file citation_date-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for citation_date-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30b1b56aff7bccb89d69f1cac171b6d17ee25d13f6dbe233a813c6b66456c0b6
MD5 2880e3ee12b5549b603589aaccd0a1f5
BLAKE2b-256 3be9deb9d024eb12a1519751050b6ae30b69f92f0ecd46dc5ce55096ca10ec22

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