用途
- 已内置 JSON 数据源(JsonDataSource) 实现
- 可自行实现其他来源的推送配置数据源
快速开始
安装
pip install starbot-bilibili-datasource
开发
通过继承抽象类 DataSource 并实现其中的 load 抽象方法,即可实现其他来源的推送配置数据源
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: 一个基于订阅发布模式的异步执行器
Metadata
Release files for starbot-bilibili-datasource 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| starbot_bilibili_datasource-1.2.2.tar.gz | 28.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| starbot_bilibili_datasource-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.5 kB
Release files / starbot_bilibili_datasource-1.2.2.tar.gz
| Download URL | starbot_bilibili_datasource-1.2.2.tar.gz |
|---|---|
| Size | 28.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a96e06b28a0b372e5155b5fdb729f96ca65d865ec8691d9ed3a32ec14b98917
|
|
BLAKE2b-256 checksum How to use checksums |
cba0ae016b2918b82e6b4f24c0f3de36bfe83543cad4e97c11ca371da5ed1679
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.6 Windows/10
|
Release files / starbot_bilibili_datasource-1.2.2-py3-none-any.whl
| Download URL | starbot_bilibili_datasource-1.2.2-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
533c3ba1a8e5699a1fb202a2e9bf37b8efe5b93d1e2c2e8471ba14d36ff50c53
|
|
BLAKE2b-256 checksum How to use checksums |
da4c7f8ae819527907a5ee2032246ceba829c1cb4629f88ce34c916af35d1433
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.6 Windows/10
|