# autoboot data starter
基于 [autoboot](https://github.com/yizzuide/autoboot) 框架的扩展,用于支持数据层接入。
<p>
<a href="https://pypi.org/project/autoboot-data">
<img src="https://img.shields.io/pypi/v/autoboot-data?color=%2334D058&label=pypi%20package" alt="Version">
</a>
<a href="https://pypi.org/project/autoboot-data">
<img src="https://img.shields.io/pypi/pyversions/autoboot-data.svg?color=%2334D058" alt="Python">
</a>
<a href="https://pepy.tech/project/autoboot-data">
<img src="https://static.pepy.tech/personalized-badge/autoboot-data?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads" alt="Downloads">
</a>
<a href="https://github.com/yizzuide/autoboot-data/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/yizzuide/autoboot-data" alt="License">
</a>
</p>
## Quick Start
### Install
```sh
pip install autoboot-web
```
### Usage
#### 配置
* 启动配置文件`.env`
```ini
# 环境名称(默认值:dev,框架根据这个配置项来加载当前的环境配置)
ENV_NAME=dev
APPLICATION_NAME=data-runner
```
* 环境配置文件`.env.dev`
```ini
APPLICATION_NAME=data-runner-dev
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
```
* 主配置文件`autoboot.yaml`
```yaml
autoboot:
application:
name: !env APPLICATION_NAME
module: api
data:
redis:
host: !env REDIS_HOST
port: !env REDIS_PORT
```
#### 创建并启动容器
```py
from autoboot import AutoBoot, AutoBootConfig
from autoboot_data import redis
context = AutoBoot(AutoBootConfig(config_dir="."))
context.run()
r = redis.connection()
AutoBoot.logger.info(r.ping())
```
## Contributors
有问题可以在issues开话题讨论,如果你有新的想法,创建新的`feat`或`pref`分支并提交PR。
## License
[MIT License](https://github.com/yizzuide/autoboot/blob/main/LICENSE.txt)
Raw data
{
"_id": null,
"home_page": "https://github.com/yizzuide/autoboot_data",
"name": "autoboot-data",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "autoboot, data, redis",
"author": "yizzuide",
"author_email": "fu837014586@163.com",
"download_url": "https://files.pythonhosted.org/packages/66/34/3427bc001c7b74b706dee6a0c19dc1f263a52c599bd574992a5356d57ed4/autoboot_data-0.4.0.tar.gz",
"platform": null,
"description": "# autoboot data starter\n\u57fa\u4e8e [autoboot](https://github.com/yizzuide/autoboot) \u6846\u67b6\u7684\u6269\u5c55\uff0c\u7528\u4e8e\u652f\u6301\u6570\u636e\u5c42\u63a5\u5165\u3002\n<p>\n <a href=\"https://pypi.org/project/autoboot-data\">\n <img src=\"https://img.shields.io/pypi/v/autoboot-data?color=%2334D058&label=pypi%20package\" alt=\"Version\">\n </a>\n <a href=\"https://pypi.org/project/autoboot-data\">\n <img src=\"https://img.shields.io/pypi/pyversions/autoboot-data.svg?color=%2334D058\" alt=\"Python\">\n </a>\n <a href=\"https://pepy.tech/project/autoboot-data\">\n <img src=\"https://static.pepy.tech/personalized-badge/autoboot-data?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads\" alt=\"Downloads\">\n </a>\n <a href=\"https://github.com/yizzuide/autoboot-data/blob/main/LICENSE\">\n <img src=\"https://img.shields.io/github/license/yizzuide/autoboot-data\" alt=\"License\">\n </a>\n</p>\n\n## Quick Start\n\n### Install\n```sh\npip install autoboot-web\n```\n\n### Usage\n\n#### \u914d\u7f6e\n\n* \u542f\u52a8\u914d\u7f6e\u6587\u4ef6`.env`\n```ini\n# \u73af\u5883\u540d\u79f0\uff08\u9ed8\u8ba4\u503c\uff1adev\uff0c\u6846\u67b6\u6839\u636e\u8fd9\u4e2a\u914d\u7f6e\u9879\u6765\u52a0\u8f7d\u5f53\u524d\u7684\u73af\u5883\u914d\u7f6e\uff09\nENV_NAME=dev\n\nAPPLICATION_NAME=data-runner\n```\n\n* \u73af\u5883\u914d\u7f6e\u6587\u4ef6`.env.dev`\n```ini\nAPPLICATION_NAME=data-runner-dev\n\nREDIS_HOST=127.0.0.1\nREDIS_PORT=6379\n```\n\n* \u4e3b\u914d\u7f6e\u6587\u4ef6`autoboot.yaml`\n```yaml\nautoboot:\n application:\n name: !env APPLICATION_NAME\n module: api\n\n data:\n redis:\n host: !env REDIS_HOST\n port: !env REDIS_PORT\n```\n\n#### \u521b\u5efa\u5e76\u542f\u52a8\u5bb9\u5668\n```py\nfrom autoboot import AutoBoot, AutoBootConfig\nfrom autoboot_data import redis\n\ncontext = AutoBoot(AutoBootConfig(config_dir=\".\"))\ncontext.run()\n\nr = redis.connection()\nAutoBoot.logger.info(r.ping())\n```\n\n## Contributors\n\u6709\u95ee\u9898\u53ef\u4ee5\u5728issues\u5f00\u8bdd\u9898\u8ba8\u8bba\uff0c\u5982\u679c\u4f60\u6709\u65b0\u7684\u60f3\u6cd5\uff0c\u521b\u5efa\u65b0\u7684`feat`\u6216`pref`\u5206\u652f\u5e76\u63d0\u4ea4PR\u3002\n\n## License\n[MIT License](https://github.com/yizzuide/autoboot/blob/main/LICENSE.txt)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Data access build with autoboot",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/yizzuide/autoboot_data"
},
"split_keywords": [
"autoboot",
" data",
" redis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b58db59c5ed29ad5193280c10de0ab7af0e0c69a436ce82b5d1d98bdda0cb32b",
"md5": "a24cf187cc0fbc0a1dd1d5a9a2ba75b6",
"sha256": "40da4164abd47e4234d5967159b654504b94657fc1ab0a434a001a5c7ceb73a1"
},
"downloads": -1,
"filename": "autoboot_data-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a24cf187cc0fbc0a1dd1d5a9a2ba75b6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6156,
"upload_time": "2024-05-12T08:11:50",
"upload_time_iso_8601": "2024-05-12T08:11:50.165093Z",
"url": "https://files.pythonhosted.org/packages/b5/8d/b59c5ed29ad5193280c10de0ab7af0e0c69a436ce82b5d1d98bdda0cb32b/autoboot_data-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "66343427bc001c7b74b706dee6a0c19dc1f263a52c599bd574992a5356d57ed4",
"md5": "5787e15ff8d430736266d95f8ecc7113",
"sha256": "2c61887cf75e33397ae98637ba00bc0402e6858b5db59e0cf0ccdd5fae152d82"
},
"downloads": -1,
"filename": "autoboot_data-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "5787e15ff8d430736266d95f8ecc7113",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6245,
"upload_time": "2024-05-12T08:11:51",
"upload_time_iso_8601": "2024-05-12T08:11:51.993248Z",
"url": "https://files.pythonhosted.org/packages/66/34/3427bc001c7b74b706dee6a0c19dc1f263a52c599bd574992a5356d57ed4/autoboot_data-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-12 08:11:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yizzuide",
"github_project": "autoboot_data",
"github_not_found": true,
"lcname": "autoboot-data"
}