date-extractor
date-extractor helps you extract dates from text
Installation
pip3 install date-extractor
Use
from date_extractor import extract_dates
text = "I arrived in that city on January 4, 1937"
dates = extract_dates(text)
# [datetime.datetime(1937, 1, 4, 0, 0, tzinfo=<UTC>)]
Date extractor also works on dates with hours, minutes and seconds:
from date_extractor import extract_date
date = extract_date("2018-06-07 16:31:54")
# datetime.datetime(2018, 6, 7, 16, 31, 54, tzinfo=<UTC>)
Returning Precision
from date_extractor import extract_date
text = "I arrived in that city in 1937"
date, precision = extract_date(text, return_precision=True)
# precision = 'year'
Features
| Languages Supported |
|---|
| Arabic |
| Chinese (incl. Taiwan) |
| English |
| French |
| Sorani (Kurdish) |
| Turkish |
Testing
To test the package run
python3 -m unittest date_extractor.tests.test
Support
Contact Daniel Dufour at daniel.j.dufour@gmail.com
Metadata
Release files for date-extractor 5.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| date-extractor-5.1.5.tar.gz | 16.7 kB | Details |
Release files / date-extractor-5.1.5.tar.gz
| Download URL | date-extractor-5.1.5.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6e0744c913fe72e5bd7494902dc0939d39aba5019327efa6c88532952d974a7
|
|
BLAKE2b-256 checksum How to use checksums |
d84c1075398fdb6033186d3c673f49b50fee41637b87d219de62e804bc2e5b4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|