datetime-extractor-0.5
توضیحات
Extracts timestamp from a given text/string
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | datetime-extractor-0.5 |
| نام | datetime-extractor |
| نسخه کتابخانه | 0.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Yeddu Dinesh Babu |
| ایمیل نویسنده | ydineshy225@gmail.com |
| آدرس صفحه اصلی | https://github.com/ydineshy225/datetime_extractor |
| آدرس اینترنتی | https://pypi.org/project/datetime-extractor/ |
| مجوز | - |
# datetime_extractor
The main intent of this project is to extract mostly all possible timestamps from a given string where date and time written together. It extracts timestaamps in a string format. Later one can convert extracted timestamp to python timestamp using pandas datetime package.
# How to install the package
pip install datetime-extractor
# Example1
``` python
from datetime_extractor import DateTimeExtractor
import pandas as pd
import re
samplestring = 'scala> val xorder= new order(1,"2016-02-22 00:00:00.00",100,"COMPLETED")'
DateTimeExtractor(samplestring)
Out: ['2016-02-22 00:00:00.00']
```
# Example2
Suppose if one has a dataframe with text column where timestamps written, the above function can be used to create a new column with extracted timestamp strings. One can use below command in this case
``` python
data = pd.read_csv('sampledata.csv')
data['textcolumn'] = data['textcolumn'].fillna('')
data['ExtractedTimestamp'] = data['textcolumn'].apply(lambda x: DateTimeExtractor(str(x)))
```
نحوه نصب
نصب پکیج whl datetime-extractor-0.5:
pip install datetime-extractor-0.5.whl
نصب پکیج tar.gz datetime-extractor-0.5:
pip install datetime-extractor-0.5.tar.gz