Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c1566d9
Merge branch 'release/0.6' into develop
rlskoeser Jan 16, 2026
d8df254
Set develop version to 0.7-dev0
rlskoeser Jan 16, 2026
c37a1fe
Preliminary gregorian grammer, parser, and tests
rlskoeser Feb 12, 2026
3c58c2e
Fully implement script to generate month names for Gregorian parser
rlskoeser Feb 12, 2026
01ebe5e
Grammar with month names in multiple languages
rlskoeser Feb 12, 2026
fb29061
Import and use all month names
rlskoeser Feb 12, 2026
6d6259b
Don't repeat month names / abbreviations
rlskoeser Feb 12, 2026
294e573
Add more test cases in multiple languages
rlskoeser Feb 12, 2026
5b7db24
Correct typo
rlskoeser Feb 12, 2026
f654e83
Test gregorian parser transformer; refine parsing logic
rlskoeser Feb 12, 2026
5b5d89f
Connect parsing to gregorian converter class and test
rlskoeser Feb 12, 2026
6600f58
Add Gregorian to omnibus parser
rlskoeser Feb 12, 2026
2bd8c23
Document Gregorian parser & languages in change log
rlskoeser Feb 12, 2026
9ca8424
Add dev notes for codegen script; drop uvx from hatch run command
rlskoeser Feb 12, 2026
e4c468d
Make Gregorian parser case-insensitive
rlskoeser Feb 12, 2026
a29a5a4
Test error handling in gregorian converter parse method
rlskoeser Feb 12, 2026
b9c2bf6
Catch more generic Lark exception per @coderabbitai
rlskoeser Feb 12, 2026
bb1d724
Ignore commas and periods across all grammars
rlskoeser Feb 12, 2026
e16f4d2
Use markdown formatting instead of rst for hatch run command
rlskoeser Feb 12, 2026
3efce6d
Add new undate_common lark grammar to version control
rlskoeser Feb 12, 2026
c718db7
Last minor cleanup
rlskoeser Mar 27, 2026
78cbbbb
Merge pull request #160 from dh-tech/feature/gregorian-human-lang-par…
rlskoeser Mar 27, 2026
9140b07
Merge branch 'hotfix/0.6.1' into develop
rlskoeser Mar 30, 2026
60328de
Merge branch 'hotfix/0.6.1' into develop
rlskoeser Mar 30, 2026
5fd7505
Add grammar & converter for Christian holidays
rlskoeser Apr 10, 2026
b31a1ed
Remove unneeded code flagged by codecov report
rlskoeser Apr 24, 2026
0d58c94
Mark convertdate import to be ignored for type checking
rlskoeser Apr 24, 2026
5168ba5
Test and clean up edge cases flagged by coderabbit
rlskoeser Apr 24, 2026
5ab3f6b
Merge pull request #162 from dh-tech/feature/christian-holidays
rlskoeser Apr 24, 2026
49abe33
Specify test path in pyproject.toml
rlskoeser Apr 24, 2026
0ed1939
Remove license classifier since set in project metadata
rlskoeser Apr 24, 2026
2d706d5
Switch to optional dependency group for dev/test deps
rlskoeser Apr 24, 2026
b0a2ec6
Fix uv group syntax
rlskoeser Apr 24, 2026
7bafd28
Update install instructions for change to dependency groups
rlskoeser Apr 24, 2026
ee6800e
Use uv for docs install; update to use dependency groups
rlskoeser Apr 24, 2026
2d80ebd
Configure pytest as recommended by repo-review
rlskoeser Apr 24, 2026
6f41e3d
Update pre-commit config to get more help
rlskoeser Apr 24, 2026
677aa5b
Fix typos and misspellings caught by codespell
rlskoeser Apr 24, 2026
02ac0bb
Fix bad indentation in readthedocs config
rlskoeser Apr 24, 2026
401e549
Consolidate pytest configurations
rlskoeser Apr 24, 2026
59a5965
Fix pytest config & correctly set minimum version
rlskoeser Apr 24, 2026
70f5ce3
Set actions to cancel in progress for concurrency
rlskoeser Apr 24, 2026
c14fb37
Pin convertdate version to avoid deprecation warning / syntax change
rlskoeser Apr 24, 2026
737dd5d
Configure dependabot to update github actions & pre-commit hooks
rlskoeser Apr 24, 2026
67985cd
Configure dependabot to group commits
rlskoeser Apr 24, 2026
76ed1da
Configure ruff to sort imports; use to fix existing code
rlskoeser May 7, 2026
535054e
Enable and fix more ruff rules
rlskoeser May 7, 2026
a11a376
Enable and apply ruff check for pathlib use
rlskoeser May 7, 2026
ffb9652
Configure & apply more ruff fixes
rlskoeser May 7, 2026
6a89566
Configure and apply last set of ruff checks & fixes
rlskoeser May 7, 2026
89ded9b
Update github action to use ruff check/format actions
rlskoeser May 7, 2026
ee28651
Limit ruff format to check src & tests (not example notebooks)
rlskoeser May 7, 2026
8b0d650
Also limit ruff check to src & tests
rlskoeser May 7, 2026
82c78fc
Update pre-commit tool versions with autoupdate
rlskoeser May 7, 2026
708478b
Use newer versions of actions
rlskoeser May 7, 2026
3fa7de7
Clean up notebooks for github actions ruff check
rlskoeser May 7, 2026
c35b72a
Merge pull request #163 from dh-tech/feature/repo-review-cleanup
rlskoeser May 7, 2026
7d3bc5f
Update README.md
rlskoeser May 7, 2026
9bb54ec
Merge pull request #164 from dh-tech/rlskoeser-patch-1
rlskoeser May 7, 2026
3b77fb6
Set version to 0.7
rlskoeser May 7, 2026
2eb450f
Document changes in 0.7
rlskoeser May 7, 2026
4ca48b5
Add related projects to the readme
rlskoeser May 7, 2026
ead4945
Fix broken link in readme
rlskoeser May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
groups:
actions:
patterns:
- "*"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"

# Enable version updates for pre-commit hooks
- package-ecosystem: "pre-commit"
directory: "/"
schedule:
interval: "weekly"
groups:
pre-commit:
patterns:
- "*"
26 changes: 17 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
Expand All @@ -16,23 +20,27 @@ jobs:

steps:
- uses: actions/checkout@v5
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml"

- name: Install package with check dependencies
run: uv sync --extra check
run: uv sync --group check

- name: Run Ruff linter
uses: astral-sh/ruff-action@v3
with:
args: "check --output-format=github"

# check with ruff
- name: Run ruff
run: uv run ruff check
- name: Run Ruff formatter
# NOTE: ruff format does not currently support github output format
run: ruff format --check --diff src tests
# Check formatting even if the previous step failed
if: always()

# check docs build
- name: Check that documentation builds with no errors or warnings
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ name: Upload Python Package
on:
release:
types: [published]
# allow manually running on main
workflow_dispatch:

permissions:
contents: read
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ permissions:
contents: read
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand Down Expand Up @@ -34,23 +38,23 @@ jobs:

# use github python action instead of uv to take advantage of caching
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'

- name: Install package with dependencies
run: pip install -e ".[test]"
- name: Install package with check dependencies
run: uv sync --group test

# for all versions but the one we use for code coverage, run normally
- name: Run unit tests without code coverage
run: pytest
run: uv run pytest
if: ${{ matrix.python != env.COV_PYTHON_VERSION }}

# run code coverage in one version only
- name: Run unit tests with code coverage reporting
run: pytest --cov=.
run: uv run pytest --cov=.
if: ${{ matrix.python == env.COV_PYTHON_VERSION }}

- name: Upload coverage to Codecov
Expand Down
34 changes: 29 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
files: \.py
repos:
# ruff for linting and formatting python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
rev: v0.15.12
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-check
args: [ --fix, --show-fixes, --exit-non-zero-on-fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v6.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-yaml
- id: name-tests-test
args: [--pytest-test-first]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v2.0.0
hooks:
- id: mypy
additional_dependencies: [numpy]
# yamlfmt for formatting YAML files
- repo: https://github.com/google/yamlfmt
rev: v0.21.0
hooks:
- id: yamlfmt
# Codespell for spell checking
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude_types: ["css", "html", "javascript", "json"]
# Validate GitHub Actions workflow files
- repo: https://github.com/mpalmer/action-validator
rev: v0.9.0
hooks:
- id: action-validator
10 changes: 5 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
install:
- method: uv
command: sync
groups:
- docs
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log


## 0.7

- Add parsing to Gregorian date converter; supports month names (full or abbreviated)
in English, French, German, Spanish, Kinyarwanda, Ganda, and Tigrinya
- Add support for parsing Christian liturgical dates (fixed holidays and movable feasts)
- Include Gregorian dates and holidays in omnibus parser
- Updates to pyproject.toml, pre-commit hooks, ruff rules, dependabot configuration

## 0.6.1
- Updated Read the Docs build to use Ubuntu 24.04

Expand Down
25 changes: 23 additions & 2 deletions DEVELOPER_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ source .venv/bin/activate
Install an editable version of the local package along with python dependencies needed for testing and development.

```sh
pip install -e ".[dev]"
pip install -e . --group=dev
```

If using `uv`, use

```sh
uv sync --group test
```

### Install pre-commit hooks

We use [pre-commit](https://pre-commit.com/) for automated checks and consistent formatting. If you're planning to contribute, please install these when you set up your local development.
Expand Down Expand Up @@ -88,4 +94,19 @@ pip install -e ".[docs]"
sphinx-build docs docs/_build
```

HTML documentation will be generated in `docs/_build/html`
HTML documentation will be generated in `docs/_build/html`


### Regenerating multilingual Gregorian month name parse file

The Gregorian Lark parser includes a script-generated file, which
populates month names based on a list of language codes using the Babel
library. To regenerate, run the script with hatch (which should
be installed globally):

```sh
hatch run codegen:generate
```

When the `.lark` file is modified by the script, it must be committed to git.

44 changes: 37 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@

**undate** is a python library for working with uncertain or partially known dates.

> [!WARNING]
> This is beta software and is not yet feature complete! Use with caution and give us feedback.
> Currently `undate` supports parsing and formatting dates in ISO8601, some
> portions of EDTF (Extended Date Time Format), and parsing and conversion for dates in Hebrew Anno Mundi and Islamic Hijri calendars.
> [!NOTE]
> This is beta software; it is still in development and not fully feature complete. If you use it, please let us know and share your feedback.


Currently `undate` supports parsing, formatting, and reasoning with dates in varying precision and calendars; dates with different precision and from different original calendars can be used together. Supported formats include:
- portions of EDTF (Extended Date Time Format)
- ISO8601
- parsing and calendar conversion for dates in Hebrew Anno Mundi and Islamic Hijri calendars
- Gregorian dates with full or abbreviated month names in any order for multiple languages (English, Spanish, French, German, Kinyarwanda, Ganda, Tigrinya)
- Christian liturgical dates (fixed holidays and movable feasts)

For unambiguous dates, there is an experimental omnibus parser which combines all available dates (bare years are currently assumed to be Gregorian calendar).

For more about the origin and goals of `undate`, read our 2025 software paper:

> Rebecca Sutton Koeser, Julia Damerow, Robert Casties, and Cole Crawford. “[Undate: Humanistic Dates for Computation](https://doi.org/10.1017/chr.2025.10006).” _Computational Humanities Research_, August 5, 2025.

_Undate was initially created as part of a [DH-Tech](https://dh-tech.github.io/) hackathon in November 2022._

---

Expand All @@ -20,14 +31,14 @@ _Undate was initially created as part of a [DH-Tech](https://dh-tech.github.io/)
[![codecov](https://codecov.io/gh/dh-tech/undate-python/branch/main/graph/badge.svg?token=GE7HZE8C9D)](https://codecov.io/gh/dh-tech/undate-python)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Project documentation is [available on ReadTheDocs](https://undate-python.readthedocs.io/en/latest/).

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](CONTRIBUTORS.md)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

Read [Contributors](CONTRIBUTORS.md) for detailed contribution information.

## Installation

_Recommended_: use pip to install the latest published version from PyPI:
Expand Down Expand Up @@ -242,6 +253,25 @@ Project documentation is [available on ReadTheDocs](https://undate-python.readth

For instructions on setting up for local development, see [Developer Notes](DEVELOPER_NOTES.md).

See [Contributors](CONTRIBUTORS.md) for more detailed information about contributors.


## Publications & Presentations

* Rebecca Sutton Koeser, Julia Damerow, Robert Casties, and Cole Crawford. “[Undate: Humanistic Dates for Computation](https://doi.org/10.1017/chr.2025.10006).” Software paper published in _Computational Humanities Research_, August 5, 2025.
* Rebecca Sutton Koeser. “[Undate: Computing with Uncertain and Partially-Unknown Dates](https://doi.org/10.5281/zenodo.17253974).” Computational notebook presented at USRSE’25. October 6, 2025.
* Rebecca Sutton Koeser. “[Undate in Action](https://rlskoeser.github.io/undate-in-action/).” Presentation at [Digital Humanities Tech Symposium](https://dh-tech.github.io/2025/06/04/digital-humanities-tech-symposium-agenda/), DH2025. July 14, 2025.
* Rebecca Sutton Koeser. 2025. “[Undate in Action](https://doi.org/10.63744/SFtXXpIE4ERh).” In Digital Humanities Tech Symposium 2025—Anthology of Computers and the Humanities, edited by Julia Damerow and Rebecca Sutton Koeser, vol. 2.
* Rebecca Sutton Koeser. [Join me for a DHTech hackathon? It’s an un-date!](https://dh-tech.github.io/blog/2023/02/09/hackathon-undate/) DHTech, February 9, 2023.

## Related Projects

- ISO8601 date support and dates with unknown years, including duration, adapted from [Shakespeare and Company Project](https://shakespeareandco.princeton.edu/) ([codebase](https://github.com/Princeton-CDH/mep-django))
- Parsing and calendar conversion for Hebrew Anno Mundi and Islamic Hijri calendars adapted from [Princeton Geniza Project (PGP)](https://geniza.princeton.edu/) ([codebase](https://github.com/Princeton-CDH/geniza/)); improved and verified with data and logic from the [Islamic Scientific Manuscripts Initiative (ISMI)](https://ismi.mpiwg-berlin.mpg.de/)
- Parsing for dates in African languages inspired by work on and partially checked against data from [MasakhaNER](https://github.com/masakhane-io/masakhane-ner)
- Parsing and calendar conversion for Christian liturgical holidays adapted from work on [Hale/Eliot Letters project](https://cdh.princeton.edu/projects/haleeliot-letters/)


## License

This software is licensed under the [Apache 2.0 License](LICENSE.md).
Loading
Loading