t2c


Namet2c JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/iguangyu/text2cron
SummaryA Python Library that converts human readable text to Cron Expression.
upload_time2023-05-15 17:12:22
maintainer
docs_urlNone
authoriguangyu
requires_python
licenseMIT
keywords text cron text langchain gpt npl
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## A Python Library that converts human readable text to Cron Expression
## 可以将人类语言转换为cron表达式的Python库

### Installation
``` bash
pip install t2c
```

### usage
``` python
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 * 😭
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/iguangyu/text2cron",
    "name": "t2c",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "text cron text langchain gpt npl",
    "author": "iguangyu",
    "author_email": "oofheaven7@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e6/f3/7abea0f6e816251687204c817ce91af022437226ea529b705c24670de8fa/t2c-0.0.6.tar.gz",
    "platform": null,
    "description": "## A Python Library that converts human readable text to Cron Expression\n## \u53ef\u4ee5\u5c06\u4eba\u7c7b\u8bed\u8a00\u8f6c\u6362\u4e3acron\u8868\u8fbe\u5f0f\u7684Python\u5e93\n\n### Installation\n``` bash\npip install t2c\n```\n\n### usage\n``` python\nimport t2c\n# normal\ncron_reg_zh = t2c.Text2Cron().cron('\u4eca\u5929\u4e0b\u5348\u4e24\u70b9\u949f')\ncron_reg_en = t2c.Text2Cron(language='en').cron('two minutes later')\n# use openai api key\ncron_gpt_zh = t2c.Text2Cron().gpt()\ncron_gpt_en = t2c.Text2Cron(usegpt=True, api_key='openai_api_key', language='en').gpt('two minutes later')\n# print the cron expressions\n# current time: 2023/5/15 00:25\nprint(cron_reg_zh, cron_reg_en) # output: 0 14 15 5 ? , 27 0 15 5 ?\nprint(cron_gpt_zh, cron_gpt_en) # output: 0 1 1 */3 * , 0 1 1 */3 * \ud83d\ude2d\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python Library that converts human readable text to Cron Expression.",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/iguangyu/text2cron"
    },
    "split_keywords": [
        "text",
        "cron",
        "text",
        "langchain",
        "gpt",
        "npl"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14a3b7a3c88dd42ad713df189d958482e60b578acb86d825ad5e782df5050dc4",
                "md5": "2cc14ae816b06b1a29a630f6814d9993",
                "sha256": "8e9c7472c6104ff231bf79413d36ad3b0178bc38cb9a1522e10916af41c6406c"
            },
            "downloads": -1,
            "filename": "t2c-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2cc14ae816b06b1a29a630f6814d9993",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8656,
            "upload_time": "2023-05-15T17:12:20",
            "upload_time_iso_8601": "2023-05-15T17:12:20.157367Z",
            "url": "https://files.pythonhosted.org/packages/14/a3/b7a3c88dd42ad713df189d958482e60b578acb86d825ad5e782df5050dc4/t2c-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e6f37abea0f6e816251687204c817ce91af022437226ea529b705c24670de8fa",
                "md5": "fa209b64777feb212bcd0ebfb2fd9890",
                "sha256": "745163bbe281996d14898bc756360d8b87a1112d1ced0865aa75140187e9bbdd"
            },
            "downloads": -1,
            "filename": "t2c-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "fa209b64777feb212bcd0ebfb2fd9890",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8415,
            "upload_time": "2023-05-15T17:12:22",
            "upload_time_iso_8601": "2023-05-15T17:12:22.797001Z",
            "url": "https://files.pythonhosted.org/packages/e6/f3/7abea0f6e816251687204c817ce91af022437226ea529b705c24670de8fa/t2c-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-15 17:12:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "iguangyu",
    "github_project": "text2cron",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "t2c"
}
        
Elapsed time: 0.07632s