starbot-bilibili-datasource


Namestarbot-bilibili-datasource JSON
Version 1.2.2 PyPI version JSON
download
home_pagehttps://github.com/Starlwr/StarBotDataSource
SummaryStarBot 推送配置数据源
upload_time2024-10-19 09:44:30
maintainerNone
docs_urlNone
authorStarlwr
requires_python<4.0,>=3.10
licenseAGPL-3.0-only
keywords starbot bilibili bot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# StarBotDataSource

[![PyPI](https://img.shields.io/pypi/v/starbot-bilibili-datasource)](https://pypi.org/project/starbot-bilibili-datasource)
[![Python](https://img.shields.io/badge/python-3.10%20|%203.11-blue)](https://www.python.org)
[![License](https://img.shields.io/github/license/Starlwr/StarBotDataSource)](https://github.com/Starlwr/StarBotDataSource/blob/master/LICENSE)
[![STARS](https://img.shields.io/github/stars/Starlwr/StarBotDataSource?color=yellow&label=Stars)](https://github.com/Starlwr/StarBotDataSource/stargazers)

**StarBot 推送配置数据源**
</div>

## 用途

* 已内置 JSON 数据源(JsonDataSource) 实现
* 可自行实现其他来源的推送配置数据源

## 快速开始
### 安装

```shell
pip install starbot-bilibili-datasource
```

### 开发

通过继承抽象类 DataSource 并实现其中的 load 抽象方法,即可实现其他来源的推送配置数据源

```python
from typing import NoReturn

from loguru import logger
from starbot_datasource import DataSource


class CustomDataSource(DataSource):
    """
    自定义推送配置数据源实现
    """
    async def load(self) -> NoReturn:
        """
        初始化配置
        """
        if self.ups:
            return

        logger.info("已选用 自定义来源 作为 Bot 数据源")
        logger.info("开始从 自定义来源 中初始化 Bot 配置")
        
        # 在此实现初始化逻辑
        pass

        logger.success(f"成功从 自定义来源 中导入了 {len(self.ups)} 个 UP 主")
```

## 相关项目

* [StarBotExecutor](https://github.com/Starlwr/StarBotExecutor): 一个基于订阅发布模式的异步执行器

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Starlwr/StarBotDataSource",
    "name": "starbot-bilibili-datasource",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "starbot, bilibili, bot",
    "author": "Starlwr",
    "author_email": "lwr1104@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/cb/a0/ae016b2918b82e6b4f24c0f3de36bfe83543cad4e97c11ca371da5ed1679/starbot_bilibili_datasource-1.2.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# StarBotDataSource\n\n[![PyPI](https://img.shields.io/pypi/v/starbot-bilibili-datasource)](https://pypi.org/project/starbot-bilibili-datasource)\n[![Python](https://img.shields.io/badge/python-3.10%20|%203.11-blue)](https://www.python.org)\n[![License](https://img.shields.io/github/license/Starlwr/StarBotDataSource)](https://github.com/Starlwr/StarBotDataSource/blob/master/LICENSE)\n[![STARS](https://img.shields.io/github/stars/Starlwr/StarBotDataSource?color=yellow&label=Stars)](https://github.com/Starlwr/StarBotDataSource/stargazers)\n\n**StarBot \u63a8\u9001\u914d\u7f6e\u6570\u636e\u6e90**\n</div>\n\n## \u7528\u9014\n\n* \u5df2\u5185\u7f6e JSON \u6570\u636e\u6e90(JsonDataSource) \u5b9e\u73b0\n* \u53ef\u81ea\u884c\u5b9e\u73b0\u5176\u4ed6\u6765\u6e90\u7684\u63a8\u9001\u914d\u7f6e\u6570\u636e\u6e90\n\n## \u5feb\u901f\u5f00\u59cb\n### \u5b89\u88c5\n\n```shell\npip install starbot-bilibili-datasource\n```\n\n### \u5f00\u53d1\n\n\u901a\u8fc7\u7ee7\u627f\u62bd\u8c61\u7c7b DataSource \u5e76\u5b9e\u73b0\u5176\u4e2d\u7684 load \u62bd\u8c61\u65b9\u6cd5\uff0c\u5373\u53ef\u5b9e\u73b0\u5176\u4ed6\u6765\u6e90\u7684\u63a8\u9001\u914d\u7f6e\u6570\u636e\u6e90\n\n```python\nfrom typing import NoReturn\n\nfrom loguru import logger\nfrom starbot_datasource import DataSource\n\n\nclass CustomDataSource(DataSource):\n    \"\"\"\n    \u81ea\u5b9a\u4e49\u63a8\u9001\u914d\u7f6e\u6570\u636e\u6e90\u5b9e\u73b0\n    \"\"\"\n    async def load(self) -> NoReturn:\n        \"\"\"\n        \u521d\u59cb\u5316\u914d\u7f6e\n        \"\"\"\n        if self.ups:\n            return\n\n        logger.info(\"\u5df2\u9009\u7528 \u81ea\u5b9a\u4e49\u6765\u6e90 \u4f5c\u4e3a Bot \u6570\u636e\u6e90\")\n        logger.info(\"\u5f00\u59cb\u4ece \u81ea\u5b9a\u4e49\u6765\u6e90 \u4e2d\u521d\u59cb\u5316 Bot \u914d\u7f6e\")\n        \n        # \u5728\u6b64\u5b9e\u73b0\u521d\u59cb\u5316\u903b\u8f91\n        pass\n\n        logger.success(f\"\u6210\u529f\u4ece \u81ea\u5b9a\u4e49\u6765\u6e90 \u4e2d\u5bfc\u5165\u4e86 {len(self.ups)} \u4e2a UP \u4e3b\")\n```\n\n## \u76f8\u5173\u9879\u76ee\n\n* [StarBotExecutor](https://github.com/Starlwr/StarBotExecutor): \u4e00\u4e2a\u57fa\u4e8e\u8ba2\u9605\u53d1\u5e03\u6a21\u5f0f\u7684\u5f02\u6b65\u6267\u884c\u5668\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0-only",
    "summary": "StarBot \u63a8\u9001\u914d\u7f6e\u6570\u636e\u6e90",
    "version": "1.2.2",
    "project_urls": {
        "Homepage": "https://github.com/Starlwr/StarBotDataSource",
        "Repository": "https://github.com/Starlwr/StarBotDataSource"
    },
    "split_keywords": [
        "starbot",
        " bilibili",
        " bot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da4c7f8ae819527907a5ee2032246ceba829c1cb4629f88ce34c916af35d1433",
                "md5": "d419c7a29fdfb0ee161fd73767da336f",
                "sha256": "533c3ba1a8e5699a1fb202a2e9bf37b8efe5b93d1e2c2e8471ba14d36ff50c53"
            },
            "downloads": -1,
            "filename": "starbot_bilibili_datasource-1.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d419c7a29fdfb0ee161fd73767da336f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 22406,
            "upload_time": "2024-10-19T09:44:28",
            "upload_time_iso_8601": "2024-10-19T09:44:28.633656Z",
            "url": "https://files.pythonhosted.org/packages/da/4c/7f8ae819527907a5ee2032246ceba829c1cb4629f88ce34c916af35d1433/starbot_bilibili_datasource-1.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cba0ae016b2918b82e6b4f24c0f3de36bfe83543cad4e97c11ca371da5ed1679",
                "md5": "a616e8cd53556d6d330f097f210979bc",
                "sha256": "1a96e06b28a0b372e5155b5fdb729f96ca65d865ec8691d9ed3a32ec14b98917"
            },
            "downloads": -1,
            "filename": "starbot_bilibili_datasource-1.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a616e8cd53556d6d330f097f210979bc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 28121,
            "upload_time": "2024-10-19T09:44:30",
            "upload_time_iso_8601": "2024-10-19T09:44:30.525979Z",
            "url": "https://files.pythonhosted.org/packages/cb/a0/ae016b2918b82e6b4f24c0f3de36bfe83543cad4e97c11ca371da5ed1679/starbot_bilibili_datasource-1.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-19 09:44:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Starlwr",
    "github_project": "StarBotDataSource",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "starbot-bilibili-datasource"
}
        
Elapsed time: 0.40334s