Skip to main content

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 * 😭

Metadata

Release files for t2c 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for t2c 0.0.6
File Size Uploaded
t2c-0.0.6.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for t2c 0.0.6
File Interpreter ABI Platform
t2c-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / t2c-0.0.6.tar.gz

Download URL t2c-0.0.6.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
745163bbe281996d14898bc756360d8b87a1112d1ced0865aa75140187e9bbdd
BLAKE2b-256 checksum
How to use checksums
e6f37abea0f6e816251687204c817ce91af022437226ea529b705c24670de8fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.1

Release files / t2c-0.0.6-py3-none-any.whl

Download URL t2c-0.0.6-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e9c7472c6104ff231bf79413d36ad3b0178bc38cb9a1522e10916af41c6406c
BLAKE2b-256 checksum
How to use checksums
14a3b7a3c88dd42ad713df189d958482e60b578acb86d825ad5e782df5050dc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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