A Python Library that converts human readable text to Cron Expression.
Project description
A Python Library that converts human readable text to Cron Expression
可以将人类语言转换为cron表达式的Python库
Installation
pip install t2c
usage
import t2c
# normal
cron_reg_zh = t2c.Text2Cron().cron('今天下午两点钟')
cron_reg_en = t2c.Text2Cron(language='en').cron('two minutes later')
# use openai api key
cron_gpt_zh = t2c.Text2Cron().gpt()
cron_gpt_en = t2c.Text2Cron(usegpt=True, api_key='openai_api_key', language='en').gpt('two minutes later')
# print the cron expressions
# current time: 2023/5/15 00:25
print(cron_reg_zh, cron_reg_en) # output: 0 14 15 5 ? , 27 0 15 5 ?
print(cron_gpt_zh, cron_gpt_en) # output: 0 1 1 */3 * , 0 1 1 */3 * 😭
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
t2c-0.0.6.tar.gz
(8.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
t2c-0.0.6-py3-none-any.whl
(8.7 kB
view details)
File details
Details for the file t2c-0.0.6.tar.gz.
File metadata
- Download URL: t2c-0.0.6.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
745163bbe281996d14898bc756360d8b87a1112d1ced0865aa75140187e9bbdd
|
|
| MD5 |
fa209b64777feb212bcd0ebfb2fd9890
|
|
| BLAKE2b-256 |
e6f37abea0f6e816251687204c817ce91af022437226ea529b705c24670de8fa
|
File details
Details for the file t2c-0.0.6-py3-none-any.whl.
File metadata
- Download URL: t2c-0.0.6-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e9c7472c6104ff231bf79413d36ad3b0178bc38cb9a1522e10916af41c6406c
|
|
| MD5 |
2cc14ae816b06b1a29a630f6814d9993
|
|
| BLAKE2b-256 |
14a3b7a3c88dd42ad713df189d958482e60b578acb86d825ad5e782df5050dc4
|