pax_global_header 0000666 0000000 0000000 00000000064 14525642136 0014522 g ustar 00root root 0000000 0000000 52 comment=0c7a9d47f88b57494a7bf90714db1514b3af1b03
dateparser-1.2.0/ 0000775 0000000 0000000 00000000000 14525642136 0013654 5 ustar 00root root 0000000 0000000 dateparser-1.2.0/.bumpversion.cfg 0000664 0000000 0000000 00000000152 14525642136 0016762 0 ustar 00root root 0000000 0000000 [bumpversion]
current_version = 1.2.0
commit = True
tag = True
[bumpversion:file:dateparser/__init__.py]
dateparser-1.2.0/.coveragerc 0000664 0000000 0000000 00000000032 14525642136 0015770 0 ustar 00root root 0000000 0000000 [run]
source = dateparser
dateparser-1.2.0/.editorconfig 0000664 0000000 0000000 00000000406 14525642136 0016331 0 ustar 00root root 0000000 0000000 # http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf
[*.bat]
indent_style = tab
end_of_line = crlf
[LICENSE]
insert_final_newline = false
dateparser-1.2.0/.flake8 0000664 0000000 0000000 00000000142 14525642136 0015024 0 ustar 00root root 0000000 0000000 [flake8]
max-line-length = 119
ignore = W503, E203, E501, E722, F401
exclude =
docs/conf.py
dateparser-1.2.0/.git-blame-ignore-revs 0000664 0000000 0000000 00000000112 14525642136 0017746 0 ustar 00root root 0000000 0000000 # Apply the auto-formatter black
24c1637dcc77aac006db8ebcfbf5199fa7abac5d
dateparser-1.2.0/.github/ 0000775 0000000 0000000 00000000000 14525642136 0015214 5 ustar 00root root 0000000 0000000 dateparser-1.2.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14525642136 0017251 5 ustar 00root root 0000000 0000000 dateparser-1.2.0/.github/workflows/main.yml 0000664 0000000 0000000 00000003164 14525642136 0020724 0 ustar 00root root 0000000 0000000 name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.8
env:
TOXENV: flake8
- python-version: 3.7
env:
TOXENV: py
- python-version: 3.8
env:
TOXENV: py
- python-version: 3.9
env:
TOXENV: py
- python-version: "3.10"
env:
TOXENV: py
- python-version: "3.10"
env:
TOXENV: latest
- python-version: "3.11"
env:
TOXENV: py
- python-version: "3.11"
env:
TOXENV: latest
- python-version: "3.11"
env:
TOXENV: twinecheck
steps:
- uses: actions/checkout@v3
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python-version }}'
- name: Install language-pack-fr
run: sudo apt-get update && sudo apt-get install language-pack-fr
- name: Install python dependencies
run: pip install tox
- name: tox
run: tox -e py
- name: Upload coverage.xml to codecov
if: ${{ matrix.python-version == '3.9' && matrix.env.TOXENV == 'latest'}}
uses: codecov/codecov-action@v3
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pre-commit/action@v3.0.0
dateparser-1.2.0/.github/workflows/publish.yml 0000664 0000000 0000000 00000001166 14525642136 0021446 0 ustar 00root root 0000000 0000000 name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
dateparser-1.2.0/.gitignore 0000664 0000000 0000000 00000000723 14525642136 0015646 0 ustar 00root root 0000000 0000000 *.py[cod]
.python-version
# C extensions
*.so
# Packages
*.egg
*.eggs
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
htmlcov
coverage.xml
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Complexity
output/*.html
output/*/index.html
# Sphinx
docs/_build
# Editors
*.swp
.idea
.vscode/
# Other
raw_data
dateparser-1.2.0/.isort.cfg 0000664 0000000 0000000 00000000033 14525642136 0015547 0 ustar 00root root 0000000 0000000 [settings]
profile = black
dateparser-1.2.0/.pre-commit-config.yaml 0000664 0000000 0000000 00000000605 14525642136 0020136 0 ustar 00root root 0000000 0000000 repos:
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0 # 6.0.0 drops Python 3.7 support
hooks:
- id: flake8
args: ['--config=.flake8']
- repo: https://github.com/psf/black.git
rev: 23.3.0
hooks:
- id: black
exclude: ^dateparser/data/date_translation_data/
- repo: https://github.com/pycqa/isort
rev: 5.12.0 # 5.12 drops Python 3.7 support
hooks:
- id: isort
dateparser-1.2.0/AUTHORS.rst 0000664 0000000 0000000 00000001307 14525642136 0015534 0 ustar 00root root 0000000 0000000 =======
Credits
=======
Currently, more than 100 committers have contributed to this project, making this
contributors list really hard to maintain, so we have decided to stop updating
this list.
To see the people behind this code, you can run ``git shortlog -s -n`` or visit the
contributions section in Github: https://github.com/scrapinghub/dateparser/graphs/contributors
We really appreciate **all the people that has contributed to this project with their
time and ideas**. Special mention to **Waqas Shabir** (waqasshabbir), **Eugene Amirov**
(Allactaga) and **Artur Sadurski** (asadurski) for creating and maintaining this awesome
project.
To all of you... thank you for building and improving this!
dateparser-1.2.0/CONTRIBUTING.rst 0000664 0000000 0000000 00000013735 14525642136 0016326 0 ustar 00root root 0000000 0000000 ============
Contributing
============
Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions
----------------------
Report Bugs
~~~~~~~~~~~
Report bugs at https://github.com/scrapinghub/dateparser/issues.
If you are reporting a bug, please include:
* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.
Fix Bugs and Implement Features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Look through the GitHub issues for bugs and feature requests. To avoid
duplicate efforts, try to choose issues without related PRs or with staled PRs.
We also encourage you to add new languages to the existing stack.
Write Documentation
~~~~~~~~~~~~~~~~~~~
Dateparser could always use more documentation, whether as part of the
official Dateparser docs, in docstrings, or even on the web in blog posts,
articles, and such.
After you make local changes to the documentation, you will be able to build the
project running::
tox -e docs
Then open ``.tox/docs/tmp/html/index.html`` in a web browser to see your local
build of the documentation.
.. note::
If you don't have ``tox`` installed, you need to install it first using
``pip install tox``.
Submit Feedback
~~~~~~~~~~~~~~~
The best way to send feedback is to file an issue at https://github.com/scrapinghub/dateparser/issues.
If you are proposing a feature:
* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that contributions are welcome :)
Get Started!
------------
Ready to contribute? Here's how to set up `dateparser` for local development.
1. Fork the `dateparser` repo on GitHub.
2. Clone your fork locally::
$ git clone git@github.com:your_name_here/dateparser.git
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper
installed, this is how you set up your fork for local development::
$ mkvirtualenv dateparser
$ cd dateparser/
$ python setup.py develop
4. Create a branch for local development::
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
5. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::
$ tox
To get ``tox``, just ``pip install`` it into your virtualenv. In addition to tests, ``tox`` checks for code style and maximum line length (119 characters).
6. Commit your changes and push your branch to GitHub::
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
7. Submit a pull request through the GitHub website.
Pull Request Guidelines
-----------------------
Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in *README.rst*.
3. Check the pipelines (Github Actions) in the PR comments (or in
https://github.com/scrapinghub/dateparser/actions) and make sure that the
tests pass for all supported Python versions.
4. Check the new project coverage in the PR comments (or in
https://app.codecov.io/gh/scrapinghub/dateparser/pulls) and make sure that
it remained equal or higher than previously.
5. Follow the core developers' advice which aims to ensure code's consistency
regardless of the variety of approaches used by many contributors.
6. In case you are unable to continue working on a PR, please leave a short
comment to notify us. We will be pleased to make any changes required to get
it done.
Guidelines for Editing Translation Data
---------------------------------------
English is the primary language of Dateparser. Dates in all other languages are
translated into English equivalents before they are parsed.
The language data that Dateparser uses to parse dates is in
``dateparser/data/date_translation_data``. For each supported language, there
is a Python file containing translation data.
Each translation data Python files contains different kinds of translation data
for date parsing: month and week names - and their abbreviations, prepositions,
conjunctions, frequently used descriptive words and phrases (like “today”),
etc.
Translation data Python files are generated from the following sources:
- `Unicode CLDR `_ data in JSON format, located at
``dateparser_data/cldr_language_data/date_translation_data``
- Additional data from the Dateparser community in YAML format, located at
``dateparser_data/supplementary_language_data/date_translation_data``
If you wish to extend the data of an existing language, or add data for a new
language, you must:
#. Edit or create the corresponding file within
``dateparser_data/supplementary_language_data/date_translation_data``
See existing files to learn how they are defined, and see
:ref:`language-data-template` for details.
#. Regenerate the corresponding file within
``dateparser/data/date_translation_data`` running the following script::
dateparser_scripts/write_complete_data.py
#. Write tests that cover your changes
You should be able to find tests that cover the affected data, and use
copy-and-paste to create the corresponding new test.
If in doubt, ask Dateparser maintainers for help.
.. toctree::
:maxdepth: 2
:hidden:
template
Updating the List of Supported Languages and Locales
----------------------------------------------------
Whenever the content of
``dateparser.data.languages_info.language_locale_dict`` is modified, use
``dateparser_scripts/update_supported_languages_and_locales.py`` to update
the corresponding documentation table::
dateparser_scripts/update_supported_languages_and_locales.py
dateparser-1.2.0/HISTORY.rst 0000664 0000000 0000000 00000037024 14525642136 0015555 0 ustar 00root root 0000000 0000000 .. :changelog:
History
=======
1.2.0 (2023-11-17)
------------------
New features:
- New ``PREFER_MONTH_OF_YEAR`` setting (#1146)
Fixes:
- Absolute years in Russian are no longer being treated as a number of years in
the past (#1129)
Cleanups and internal improvements:
- Removed the use of ``datetime.utcnow``, deprecated on Python 3.12 (#1179)
- Applied Black formatting to the code base (#1158)
- Initial integration with OSSFuzz (#1198)
- Extended test cases (#1191)
1.1.8 (2023-03-22)
------------------
Improvements:
- Improved date parsing for Chinese (#1148)
- Improved date parsing for Czech (#1151)
- Reorder language by popularity (#1152)
- Fix leak of memory in cache (#1140)
- Add support for "\d units later" (#1154)
- Move modification in CLDR data to yaml (#1153)
- Add support to use timezone via settings to get PREFER_DATES_FROM result (#1155)
1.1.7 (2023-02-02)
------------------
Improvements:
- Add an “ago” synonym for Arabic (#1128)
- Improved date parsing for Czech (#1131)
- Improved date parsing for Indonesian (#1134)
1.1.6 (2023-01-12)
------------------
Improvements:
- Fix the bug where Monday is parsed as a month (#1121)
- Prevent ReDoS in Spanish sentence splitting regex (#1084)
1.1.5 (2022-12-29)
------------------
Improvements:
- Parse short versions of day, month, and year (#1103)
- Add a test for “in 1d” (#1104)
- Update languages_info (#1107)
- Add a workaround for zipimporter not having exec_module before Python 3.10 (#1069)
- Stabilize tests at midnight (#1111)
- Add a test case for French (#1110)
Cleanups:
- Remove the requirements-build file (#1113)
1.1.4 (2022-11-21)
------------------
Improvements:
- Improved support for languages such as Slovak, Indonesian, Hindi, German and Japanese (#1064, #1094, #986, #1071, #1068)
- Recursively create a model home (#996)
- Replace regex sub with simple string replace (#1095)
- Add Python 3.10, 3.11 support (#1096)
- Drop support for Python 3.5, 3.6 versions (#1097)
1.1.3 (2022-11-03)
------------------
New features:
- Add support for fractional units (#876)
Improvements:
- Fix the returned datetime skipping a day with time+timezone input and PREFER_DATES_FROM = 'future' (#1002)
- Fix input translatation breaking keep_formatting (#720)
- English: support "till date" (#1005)
- English: support “after” and “before” in relative dates (#1008)
Cleanups:
- Reorganize internal data (#1090)
- CI updates (#1088)
1.1.2 (2022-10-20)
------------------
Improvements:
- Added support for negative timestamp (#1060)
- Fixed PytzUsageWarning for Python versions >= 3.6 (#1062)
- Added support for dates with dots and spaces (#1028)
- Improved support for Ukrainian, Croatian and Russian (#1072, #1074, #1079, #1082, #1073, #1083)
- Added support for parsing Unix timestamps consistently regardless of timezones (#954)
- Improved tests (#1086)
1.1.1 (2022-03-17)
------------------
Improvements:
- Fixed issue with regex library by pinning dependencies to an earlier version (< 2022.3.15, #1046).
- Extended support for Russian language dates starting with lowercase (#999).
- Allowed to use_given_order for languages too (#997).
- Fixed link to settings section (#1018).
- Defined UTF-8 encoding for Windows (#998).
- Fixed directories creation error in CLI utils (#1022).
1.1.0 (2021-10-04)
------------------
New features:
* Support language detection based on ``langdetect``, ``fastText``, or a
custom implementation (see #932)
* Add support for 'by