starfall


Namestarfall JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/parselife/starfall/tree/master/
SummaryAn executor of Cron Job
upload_time2023-07-20 05:12:31
maintainer
docs_urlNone
authorAlex
requires_python>=3.6
licenseMIT License Copyright (c) 2023 Alex Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords cron job executor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
 * @Author: Alex
 * @LastEditors: Alex yxfacw@163.com
 * @Date: 2023-07-18 18:19:20
 * @Description:  
-->
## Starfall

原生 python3 定时调度执行器(适配 xxl-job)

### 环境

- python: 支持 python 3.9 +
- OS:  windows、MacOS、Linux
### 安装

```python

pip install starfall

```

### 使用

安装依赖后,需要在工程目录下提供一个配置文件 `conf.ini`, 并在其中设置以下参数:

```properties
[Executor]
PORT = 9002
NAME = demo-py-executor
ADMIN_URI = http://192.168.0.96:8088/job-admin
ACCESS_TOKEN =
```

> 参数根据实际填写

调用入口方法,启动服务:

```python
from starfall import init, start_serve
import os

PROJ_ROOT = os.path.dirname(os.path.abspath(__file__))
print(f'root: {PROJ_ROOT}')

init(PROJ_ROOT)
start_serve()
```

查看控制台输出,看到 `server started...` 表示服务启动成功


### 任务代码编写

- 在工程目录下新建 `jobs` 文件夹 (文件夹名称必须固定)

- 在`jobs`目录下新建任务代码

- 一个job示例:

```python
from starfall.helper import get_logger

def add(x, y):
    logger = get_logger('demo.add')
    logger.info(x+y)
    return x+y
```






            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/parselife/starfall/tree/master/",
    "name": "starfall",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Cron Job Executor",
    "author": "Alex",
    "author_email": "yxfacw@163.com",
    "download_url": "https://files.pythonhosted.org/packages/fb/36/1a0fa6fddb646201103d14412a104ae7b33877acc571ec012a165292007d/starfall-0.0.7.tar.gz",
    "platform": null,
    "description": "<!--\n * @Author: Alex\n * @LastEditors: Alex yxfacw@163.com\n * @Date: 2023-07-18 18:19:20\n * @Description:  \n-->\n## Starfall\n\n\u539f\u751f python3 \u5b9a\u65f6\u8c03\u5ea6\u6267\u884c\u5668\uff08\u9002\u914d xxl-job\uff09\n\n### \u73af\u5883\n\n- python: \u652f\u6301 python 3.9 +\n- OS:  windows\u3001MacOS\u3001Linux\n### \u5b89\u88c5\n\n```python\n\npip install starfall\n\n```\n\n### \u4f7f\u7528\n\n\u5b89\u88c5\u4f9d\u8d56\u540e\uff0c\u9700\u8981\u5728\u5de5\u7a0b\u76ee\u5f55\u4e0b\u63d0\u4f9b\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6 `conf.ini`, \u5e76\u5728\u5176\u4e2d\u8bbe\u7f6e\u4ee5\u4e0b\u53c2\u6570:\n\n```properties\n[Executor]\nPORT = 9002\nNAME = demo-py-executor\nADMIN_URI = http://192.168.0.96:8088/job-admin\nACCESS_TOKEN =\n```\n\n> \u53c2\u6570\u6839\u636e\u5b9e\u9645\u586b\u5199\n\n\u8c03\u7528\u5165\u53e3\u65b9\u6cd5\uff0c\u542f\u52a8\u670d\u52a1\uff1a\n\n```python\nfrom starfall import init, start_serve\nimport os\n\nPROJ_ROOT = os.path.dirname(os.path.abspath(__file__))\nprint(f'root: {PROJ_ROOT}')\n\ninit(PROJ_ROOT)\nstart_serve()\n```\n\n\u67e5\u770b\u63a7\u5236\u53f0\u8f93\u51fa\uff0c\u770b\u5230 `server started...` \u8868\u793a\u670d\u52a1\u542f\u52a8\u6210\u529f\n\n\n### \u4efb\u52a1\u4ee3\u7801\u7f16\u5199\n\n- \u5728\u5de5\u7a0b\u76ee\u5f55\u4e0b\u65b0\u5efa `jobs` \u6587\u4ef6\u5939 \uff08\u6587\u4ef6\u5939\u540d\u79f0\u5fc5\u987b\u56fa\u5b9a\uff09\n\n- \u5728`jobs`\u76ee\u5f55\u4e0b\u65b0\u5efa\u4efb\u52a1\u4ee3\u7801\n\n- \u4e00\u4e2ajob\u793a\u4f8b\uff1a\n\n```python\nfrom starfall.helper import get_logger\n\ndef add(x, y):\n    logger = get_logger('demo.add')\n    logger.info(x+y)\n    return x+y\n```\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Alex  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "An executor of Cron Job",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/parselife/starfall/tree/master/"
    },
    "split_keywords": [
        "cron",
        "job",
        "executor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "403d7e54ed4df33d5e56a512e30fa77f6e30cebc246ed3b6c9009ce3ae3c5859",
                "md5": "7ece038039039deb7f3a2820fc5a5cd0",
                "sha256": "7cd074a3c4cf3d870ef074ef5186ab686f16243805278f6bdafd6e92f4836398"
            },
            "downloads": -1,
            "filename": "starfall-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ece038039039deb7f3a2820fc5a5cd0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 25271,
            "upload_time": "2023-07-20T05:12:30",
            "upload_time_iso_8601": "2023-07-20T05:12:30.080040Z",
            "url": "https://files.pythonhosted.org/packages/40/3d/7e54ed4df33d5e56a512e30fa77f6e30cebc246ed3b6c9009ce3ae3c5859/starfall-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb361a0fa6fddb646201103d14412a104ae7b33877acc571ec012a165292007d",
                "md5": "03dc8a9255ca3839c53f7ec4a9790fff",
                "sha256": "938108d684d967b946c91520517d452fa86124faa4981c54a3a81b59cad4370e"
            },
            "downloads": -1,
            "filename": "starfall-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "03dc8a9255ca3839c53f7ec4a9790fff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 12621,
            "upload_time": "2023-07-20T05:12:31",
            "upload_time_iso_8601": "2023-07-20T05:12:31.638201Z",
            "url": "https://files.pythonhosted.org/packages/fb/36/1a0fa6fddb646201103d14412a104ae7b33877acc571ec012a165292007d/starfall-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-20 05:12:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "parselife",
    "github_project": "starfall",
    "github_not_found": true,
    "lcname": "starfall"
}
        
Elapsed time: 0.11804s