[![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_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:
```python
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
```python
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
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:date-extractor-5.1.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
date-extractor-5.1.1.tar.gz (25个子文件)
date-extractor-5.1.1
MANIFEST.in 54B
PKG-INFO 3KB
date_extractor.egg-info
PKG-INFO 3KB
requires.txt 11B
SOURCES.txt 804B
top_level.txt 15B
dependency_links.txt 1B
date_extractor
data
months_verbose
chinese.txt 502B
turkish.txt 197B
arabic.txt 2KB
french.txt 174B
sorani.txt 191B
english.txt 186B
days_of_the_week
short
english.txt 84B
full
english.txt 151B
tests
test.py 7KB
__init__.py 0B
enumerations
__init__.py 3KB
arabic.py 527B
__init__.py 12KB
LICENSE 11KB
version.txt 6B
setup.cfg 79B
setup.py 2KB
README.md 1KB
共 25 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功