📦 nlp-time
Time NLP module
Installation
pip install -i https://mirrors.aliyun.com/pypi/simple/ --extra-index-url https://pypi.org/simple/ nlp-time
Example
import nlp_time
from datetime import datetime
# Partial replacement according to regular expression
res = nlp_time.get_time("我是周六早上6点的飞机")
# output: ('周六早上6点', ('2022-05-28 06:00:00', '2022-05-28 06:59:59'))
res = nlp_time.get_time("我是周六早上6点的飞机", tend_future=False)
# output: ('周六早上6点', ('2022-05-21 06:00:00', '2022-05-21 06:59:59'))
res = nlp_time.get_text(datetime.strptime("2022-05-22 20:06:00", "%Y-%m-%d %H:%M:%S"))
# output: 昨天晚上20点06分
res = nlp_time.get_text("2022-05-22 20:06:00")
# output: 昨天晚上20点06分
res = nlp_time.get_text("2021-05-22 20:06:00")
# output: 去年5月22号晚上20点06分
res = nlp_time.get_text(1653091200)
# output: 前天早上8点
res = nlp_time.get_text("2021-05-18 20:06:00")
# output: 上周三晚上20点06分
To Do
- Be the best version of you.
More Resources
- nlp-time on github.com
- Official Python Packaging User Guide
- The Hitchhiker's Guide to Packaging
- Cookiecutter template for a Python package
License
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
Release files for nlp-time 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nlp-time-0.1.14.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nlp_time-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.3 kB
Release files / nlp-time-0.1.14.tar.gz
| Download URL | nlp-time-0.1.14.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43245719f155d891846c5bc6912a78e0e2dbc9902fda67b3a6b8216a5ee7e9b6
|
|
BLAKE2b-256 checksum How to use checksums |
ad44014c3f8e1b9f509d5807385427b45ffc50229a2ee70a428a98339a15fa9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.10
|
Release files / nlp_time-0.1.14-py3-none-any.whl
| Download URL | nlp_time-0.1.14-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d055772dc5eaadd2e781c8de6051975fc3b72a83e71dabcb6aa618fa10d78e83
|
|
BLAKE2b-256 checksum How to use checksums |
128be93c308cf5aa1afd5aa3e5e74b2f08fb2ebe9ea44433d43f7eff9158332e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.10
|