Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danieljdufour/date-extractor
Extract dates from text
https://github.com/danieljdufour/date-extractor
arabic chinese date datetime extract-dates extractor french iso kurdish nlp parse parser python sorani taiwan temporal time
Last synced: 9 days ago
JSON representation
Extract dates from text
- Host: GitHub
- URL: https://github.com/danieljdufour/date-extractor
- Owner: DanielJDufour
- License: apache-2.0
- Created: 2015-12-03T22:40:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-27T05:27:02.000Z (almost 4 years ago)
- Last Synced: 2024-09-21T08:51:38.774Z (about 2 months ago)
- Topics: arabic, chinese, date, datetime, extract-dates, extractor, french, iso, kurdish, nlp, parse, parser, python, sorani, taiwan, temporal, time
- Language: Python
- Homepage:
- Size: 88.9 KB
- Stars: 64
- Watchers: 6
- Forks: 13
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/DanielJDufour/date-extractor.svg?branch=master)](https://travis-ci.org/DanielJDufour/date-extractor)
[![Requirements Status](https://requires.io/github/DanielJDufour/date-extractor/requirements.svg?branch=master)](https://requires.io/github/DanielJDufour/date-extractor/requirements/?branch=master)
[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000?style=plastic)]()
# date-extractor
date-extractor helps you extract dates from text# Installation
```
pip3 install date-extractor
```# Use
```python
from date_extractor import extract_datestext = "I arrived in that city on January 4, 1937"
dates = extract_dates(text)
# [datetime.datetime(1937, 1, 4, 0, 0, tzinfo=)]
```Date extractor also works on dates with hours, minutes and seconds:
```python
from date_extractor import extract_datedate = extract_date("2018-06-07 16:31:54")
# datetime.datetime(2018, 6, 7, 16, 31, 54, tzinfo=)
```# Returning Precision
```python
from date_extractor import extract_datetext = "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 [email protected]