Natural language parsing of recurring events
Project description
# Tsresolve (Timestamp resolve)
Timestamp generator for either "Point of time" or "Duration of time" from Text (string). This uses recurrent, parsedatetime libraries to detect dates from strings. However, there are lot of major updations in this library which will allow user to generate either point of time or duration between two point of times.
## Usage:
##### `pip install tsresolve`
`from tsresolve import point_of_time, period_of_time`
`point_of_time("tomorrow")`
`period_of_time("tomorrow")`
#### Points to know:
1. It generates time stamps in ISO format.
2. When no ammod (last/previous/next..) is used before month/year, it detects the passed one.
Ex: Show calls from December 5th. (If you are asking this before December 5th 2018, it detects December 5th 2017 else, December 5th 2018). Test it with and without ammods for better understanding.
##### Examples:
Point of time: Expected result will be (Timestamp, Bool). Bool is "True" if time detected in phrase. Else, "False"
1. November 3rd at 3 p.m. | Result: (2019-11-03T15:00:00, True)
2. next monday evening at 5 o'clock | Result: (2018-12-24T17:00:00, True)
3. last saturday | Result: (2018-12-24T17:00:00, False)
Period of time: Expected result will be (Start timestamp, End timestamp)
1. from last tuesday till date | Result: ('2018-12-11T00:00:00', '2018-12-18T23:59:59')
2. from last november 5th to december 15th | Result: ('2018-11-01T00:00:00', '2018-12-18T23:59:59')
3. show something from november 5th 2017 | Result: ('2017-11-05T00:00:00', '2017-11-05T23:59:59')
#### Not handled:
1. Duration between two years. Ex: 2018-2019
2. Currently not handling "5th of January" format.
3. Time level is currently handled only in point of time, yet to be handled in period of time.
#### Credits
Tsresolve is inspired by Recurrent. It also uses the parsedatetime library for creating timestamps.
#### Author
Akhil kumar D (akhilkumar.doppalapudi@gmail.com)
Timestamp generator for either "Point of time" or "Duration of time" from Text (string). This uses recurrent, parsedatetime libraries to detect dates from strings. However, there are lot of major updations in this library which will allow user to generate either point of time or duration between two point of times.
## Usage:
##### `pip install tsresolve`
`from tsresolve import point_of_time, period_of_time`
`point_of_time("tomorrow")`
`period_of_time("tomorrow")`
#### Points to know:
1. It generates time stamps in ISO format.
2. When no ammod (last/previous/next..) is used before month/year, it detects the passed one.
Ex: Show calls from December 5th. (If you are asking this before December 5th 2018, it detects December 5th 2017 else, December 5th 2018). Test it with and without ammods for better understanding.
##### Examples:
Point of time: Expected result will be (Timestamp, Bool). Bool is "True" if time detected in phrase. Else, "False"
1. November 3rd at 3 p.m. | Result: (2019-11-03T15:00:00, True)
2. next monday evening at 5 o'clock | Result: (2018-12-24T17:00:00, True)
3. last saturday | Result: (2018-12-24T17:00:00, False)
Period of time: Expected result will be (Start timestamp, End timestamp)
1. from last tuesday till date | Result: ('2018-12-11T00:00:00', '2018-12-18T23:59:59')
2. from last november 5th to december 15th | Result: ('2018-11-01T00:00:00', '2018-12-18T23:59:59')
3. show something from november 5th 2017 | Result: ('2017-11-05T00:00:00', '2017-11-05T23:59:59')
#### Not handled:
1. Duration between two years. Ex: 2018-2019
2. Currently not handling "5th of January" format.
3. Time level is currently handled only in point of time, yet to be handled in period of time.
#### Credits
Tsresolve is inspired by Recurrent. It also uses the parsedatetime library for creating timestamps.
#### Author
Akhil kumar D (akhilkumar.doppalapudi@gmail.com)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tsresolve-0.6.tar.gz
(14.2 kB
view details)
Built Distribution
tsresolve-0.6-py3-none-any.whl
(15.3 kB
view details)
File details
Details for the file tsresolve-0.6.tar.gz
.
File metadata
- Download URL: tsresolve-0.6.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36792f7931e349b858af76688b2259fd45726193ba2ca17732168fecfebdf61d |
|
MD5 | 8ac9742d7627ac334e5a61704501ee17 |
|
BLAKE2b-256 | 84b9940e249cc82e0d7aff8c9bdc06296ec7828391b6f9dd9f731d6cf24a6038 |
File details
Details for the file tsresolve-0.6-py3-none-any.whl
.
File metadata
- Download URL: tsresolve-0.6-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35c29098576d490b3245247c46a52a4bd8319ce98e2a6d94e9636d06fb8cd58 |
|
MD5 | ce28e97782bb8b6e9a1865bc65a17fd9 |
|
BLAKE2b-256 | 412989d270e00f6f7756330dba033599d42e1835c51678f504339d39f9e4e2ee |