Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexprengere/fuzzydates
Fuzzy interpretation of dates.
https://github.com/alexprengere/fuzzydates
Last synced: about 1 month ago
JSON representation
Fuzzy interpretation of dates.
- Host: GitHub
- URL: https://github.com/alexprengere/fuzzydates
- Owner: alexprengere
- License: apache-2.0
- Created: 2014-03-28T14:49:27.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-13T08:41:48.000Z (over 8 years ago)
- Last Synced: 2024-10-12T18:57:17.531Z (2 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
==========
FuzzyDates
==========Fuzzy datetime reading.
Examples
--------Import the main function:
.. code-block:: python
>>> from fuzzy_dates import load_date
Examples of fuzzy reading:
.. code-block:: python
>>> load_date('-0600', '[-+]%H%M')
datetime.datetime(1900, 1, 1, 6, 0)
>>> load_date('2010/01:02', '%Y[/:]%M[/:]%d')
datetime.datetime(2010, 1, 2, 0, 1)
>>> load_date('2010/01:02', '%Y[/:]%M/%d')
Traceback (most recent call last):
ValueError: Could not match regexpExamples of fuzzy reading for timedelta:
.. code-block:: python
>>> load_date('-0600', '[-+]%H%M', delta=True)
datetime.timedelta(0, 21600)