Skip to main content

📦 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

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)

Source distribution for nlp-time 0.1.14
File Size Uploaded
nlp-time-0.1.14.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nlp-time 0.1.14
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page