-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v5' into natural-language
- Loading branch information
Showing
28 changed files
with
1,280 additions
and
777 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
exclude: "business-facing/layer" | ||
- id: trailing-whitespace | ||
exclude: "business-facing/layer" | ||
- id: check-yaml | ||
exclude: "business-facing/layer" | ||
- id: check-json | ||
exclude: "business-facing/layer" | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.4.4 | ||
hooks: | ||
# Run the linter, and enable lint fixes | ||
- id: ruff | ||
args: [ --fix ] | ||
# Run the formatter. | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-r requirements.txt # Include all main requirements | ||
django>=4.2,<5.0 | ||
pytest | ||
ruff | ||
pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,73 @@ | ||
from edtf.parser.grammar import parse_edtf | ||
from edtf.natlang import text_to_edtf | ||
from edtf.parser.parser_classes import * | ||
from edtf.convert import dt_to_struct_time, struct_time_to_date, \ | ||
struct_time_to_datetime, trim_struct_time, struct_time_to_jd, \ | ||
jd_to_struct_time, old_specs_to_new_specs_expression | ||
from edtf.parser import ( | ||
UA, | ||
Consecutives, | ||
Date, | ||
DateAndTime, | ||
EarlierConsecutives, | ||
EDTFObject, | ||
EDTFParseException, | ||
ExponentialYear, | ||
Interval, | ||
LaterConsecutives, | ||
Level1Interval, | ||
Level2Interval, | ||
Level2Season, | ||
LongYear, | ||
MultipleDates, | ||
OneOfASet, | ||
PartialUncertainOrApproximate, | ||
PartialUnspecified, | ||
Season, | ||
UncertainOrApproximate, | ||
Unspecified, | ||
UnspecifiedIntervalSection, | ||
parse_edtf, | ||
) | ||
|
||
from .convert import ( | ||
dt_to_struct_time, | ||
jd_to_struct_time, | ||
old_specs_to_new_specs_expression, | ||
struct_time_to_date, | ||
struct_time_to_datetime, | ||
struct_time_to_jd, | ||
trim_struct_time, | ||
) | ||
|
||
# public | ||
__all__ = [ | ||
"dt_to_struct_time", | ||
"jd_to_struct_time", | ||
"old_specs_to_new_specs_expression", | ||
"struct_time_to_date", | ||
"struct_time_to_datetime", | ||
"struct_time_to_jd", | ||
"trim_struct_time", | ||
"text_to_edtf", | ||
"parse_edtf", | ||
# parser_exceptions | ||
"EDTFParseException", | ||
# parser_classes | ||
"EDTFObject", | ||
"Date", | ||
"DateAndTime", | ||
"Interval", | ||
"UA", | ||
"UncertainOrApproximate", | ||
"UnspecifiedIntervalSection", | ||
"Unspecified", | ||
"Level1Interval", | ||
"LongYear", | ||
"Season", | ||
"PartialUncertainOrApproximate", | ||
"PartialUnspecified", | ||
"Consecutives", | ||
"EarlierConsecutives", | ||
"LaterConsecutives", | ||
"OneOfASet", | ||
"MultipleDates", | ||
"Level2Interval", | ||
"Level2Season", | ||
"ExponentialYear", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.