adbar / htmldate

Fast and robust date extraction from web pages, with Python or on the command-line
https://htmldate.readthedocs.io
Apache License 2.0
117 stars 26 forks source link

Support min_date/max_date as datetimes or datetime strings #74

Closed kernc closed 1 year ago

kernc commented 1 year ago
adbar commented 1 year ago

Thanks!

You have to add this for compatibility with Python 3.6 (just in case):

try:
    datetime.fromisoformat  # type: ignore[attr-defined]
except AttributeError:  # Python 3.6
    from backports.datetime_fromisoformat import MonkeyPatch  # type: ignore

The rest looks good, I'll have a look later.

codecov-commenter commented 1 year ago

Codecov Report

Merging #74 (fc1f135) into master (5a2448b) will decrease coverage by 0.01%. The diff coverage is 82.35%.

:exclamation: Current head fc1f135 differs from pull request most recent head b5e1eff. Consider uploading reports for the commit b5e1eff to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
- Coverage   98.81%   98.81%   -0.01%     
==========================================
  Files           8        8              
  Lines         927      925       -2     
==========================================
- Hits          916      914       -2     
  Misses         11       11              
Impacted Files Coverage Δ
htmldate/cli.py 100.00% <ø> (ø)
htmldate/extractors.py 98.73% <ø> (+1.21%) :arrow_up:
htmldate/__init__.py 78.57% <50.00%> (-21.43%) :arrow_down:
htmldate/core.py 99.22% <100.00%> (ø)
htmldate/validators.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

kernc commented 1 year ago

Done. Note, Python 3.6 had been EOL'd for a while, and 3.7 EOL is scheduled in a few months ... It doesn't make too much sense to support it with new features/code.

adbar commented 1 year ago

I understand but as this package is also used in an educational context people may be using older software. So I'd like to support 3.6 as long as it isn't too much of a hassle.

adbar commented 1 year ago

I made a few changes, I'd say the PR is now ready to merge.

adbar commented 1 year ago

Not quite actually, it would be better to add tests.

kernc commented 1 year ago

Kind of like this? Wasn't too sure where to put it.

adbar commented 1 year ago

The test you added was not bad but more tests were necessary, I also added changes to the docs, now the PR should look good.