nonebot-plugin-localstore


Namenonebot-plugin-localstore JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/nonebot/plugin-localstore
SummaryLocal Storage Support for NoneBot2
upload_time2024-02-11 10:14:08
maintainer
docs_urlNone
authoryanyongyu
requires_python>=3.8,<4.0
licenseMIT
keywords nonebot2 qq plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable MD041 -->
<p align="center">
  <a href="https://nonebot.dev/"><img src="https://nonebot.dev/logo.png" width="200" height="200" alt="nonebot"></a>
</p>

<div align="center">

# NoneBot Plugin LocalStore

<!-- prettier-ignore-start -->
<!-- markdownlint-disable-next-line MD036 -->
_✨ NoneBot 本地数据存储插件 ✨_
<!-- prettier-ignore-end -->

</div>

<p align="center">
  <a href="https://raw.githubusercontent.com/nonebot/plugin-localstore/master/LICENSE">
    <img src="https://img.shields.io/github/license/nonebot/plugin-localstore.svg" alt="license">
  </a>
  <a href="https://pypi.python.org/pypi/nonebot-plugin-localstore">
    <img src="https://img.shields.io/pypi/v/nonebot-plugin-localstore.svg" alt="pypi">
  </a>
  <img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</p>

## 使用方式

加载插件后使用 `require` 声明插件依赖,直接使用 `localstore` 插件提供的函数即可。

```python
from pathlib import Path
from nonebot import require

require("nonebot_plugin_localstore")

import nonebot_plugin_localstore as store

plugin_cache_dir: Path = store.get_cache_dir("plugin_name")
plugin_cache_file: Path = store.get_cache_file("plugin_name", "filename")
plugin_config_dir: Path = store.get_config_dir("plugin_name")
plugin_config_file: Path = store.get_config_file("plugin_name", "filename")
plugin_data_dir: Path = store.get_data_dir("plugin_name")
plugin_data_file: Path = store.get_data_file("plugin_name", "filename")
```

## 存储路径

在项目安装插件后,可以使用 `nb-cli` 查看具体的存储路径:

```bash
nb localstore
```

参考路径如下:

### cache path

- macOS: `~/Library/Caches/<AppName>`
- Unix: `~/.cache/<AppName>` (XDG default)
- Windows: `C:\Users\<username>\AppData\Local\<AppName>\Cache`

### data path

- macOS: `~/Library/Application Support/<AppName>`
- Unix: `~/.local/share/<AppName>` or in $XDG_DATA_HOME, if defined
- Win XP (not roaming): `C:\Documents and Settings\<username>\Application Data\<AppName>`
- Win 7 (not roaming): `C:\Users\<username>\AppData\Local\<AppName>`

### config path

- macOS: same as user_data_dir
- Unix: `~/.config/<AppName>`
- Win XP (roaming): `C:\Documents and Settings\<username>\Local Settings\Application Data\<AppName>`
- Win 7 (roaming): `C:\Users\<username>\AppData\Roaming\<AppName>`


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nonebot/plugin-localstore",
    "name": "nonebot-plugin-localstore",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "nonebot2,qq,plugin",
    "author": "yanyongyu",
    "author_email": "yyy@nonebot.dev",
    "download_url": "https://files.pythonhosted.org/packages/33/dd/53f85ad48f9211f77a2472a80a92ae7207a5dc384576ce1d8d59cd223e86/nonebot_plugin_localstore-0.6.0.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable MD041 -->\n<p align=\"center\">\n  <a href=\"https://nonebot.dev/\"><img src=\"https://nonebot.dev/logo.png\" width=\"200\" height=\"200\" alt=\"nonebot\"></a>\n</p>\n\n<div align=\"center\">\n\n# NoneBot Plugin LocalStore\n\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable-next-line MD036 -->\n_\u2728 NoneBot \u672c\u5730\u6570\u636e\u5b58\u50a8\u63d2\u4ef6 \u2728_\n<!-- prettier-ignore-end -->\n\n</div>\n\n<p align=\"center\">\n  <a href=\"https://raw.githubusercontent.com/nonebot/plugin-localstore/master/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/nonebot/plugin-localstore.svg\" alt=\"license\">\n  </a>\n  <a href=\"https://pypi.python.org/pypi/nonebot-plugin-localstore\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-localstore.svg\" alt=\"pypi\">\n  </a>\n  <img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n</p>\n\n## \u4f7f\u7528\u65b9\u5f0f\n\n\u52a0\u8f7d\u63d2\u4ef6\u540e\u4f7f\u7528 `require` \u58f0\u660e\u63d2\u4ef6\u4f9d\u8d56\uff0c\u76f4\u63a5\u4f7f\u7528 `localstore` \u63d2\u4ef6\u63d0\u4f9b\u7684\u51fd\u6570\u5373\u53ef\u3002\n\n```python\nfrom pathlib import Path\nfrom nonebot import require\n\nrequire(\"nonebot_plugin_localstore\")\n\nimport nonebot_plugin_localstore as store\n\nplugin_cache_dir: Path = store.get_cache_dir(\"plugin_name\")\nplugin_cache_file: Path = store.get_cache_file(\"plugin_name\", \"filename\")\nplugin_config_dir: Path = store.get_config_dir(\"plugin_name\")\nplugin_config_file: Path = store.get_config_file(\"plugin_name\", \"filename\")\nplugin_data_dir: Path = store.get_data_dir(\"plugin_name\")\nplugin_data_file: Path = store.get_data_file(\"plugin_name\", \"filename\")\n```\n\n## \u5b58\u50a8\u8def\u5f84\n\n\u5728\u9879\u76ee\u5b89\u88c5\u63d2\u4ef6\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528 `nb-cli` \u67e5\u770b\u5177\u4f53\u7684\u5b58\u50a8\u8def\u5f84\uff1a\n\n```bash\nnb localstore\n```\n\n\u53c2\u8003\u8def\u5f84\u5982\u4e0b\uff1a\n\n### cache path\n\n- macOS: `~/Library/Caches/<AppName>`\n- Unix: `~/.cache/<AppName>` (XDG default)\n- Windows: `C:\\Users\\<username>\\AppData\\Local\\<AppName>\\Cache`\n\n### data path\n\n- macOS: `~/Library/Application Support/<AppName>`\n- Unix: `~/.local/share/<AppName>` or in $XDG_DATA_HOME, if defined\n- Win XP (not roaming): `C:\\Documents and Settings\\<username>\\Application Data\\<AppName>`\n- Win 7 (not roaming): `C:\\Users\\<username>\\AppData\\Local\\<AppName>`\n\n### config path\n\n- macOS: same as user_data_dir\n- Unix: `~/.config/<AppName>`\n- Win XP (roaming): `C:\\Documents and Settings\\<username>\\Local Settings\\Application Data\\<AppName>`\n- Win 7 (roaming): `C:\\Users\\<username>\\AppData\\Roaming\\<AppName>`\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Local Storage Support for NoneBot2",
    "version": "0.6.0",
    "project_urls": {
        "Documentation": "https://github.com/nonebot/plugin-localstore#readme",
        "Homepage": "https://github.com/nonebot/plugin-localstore",
        "Repository": "https://github.com/nonebot/plugin-localstore"
    },
    "split_keywords": [
        "nonebot2",
        "qq",
        "plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aab6ee3a91b8bcc2ea59fac833604ba7195211e6e7db5ff9fe2b87d16d799470",
                "md5": "b4c99a0d43112176d6548cd21e5c150d",
                "sha256": "59f0126d85680601166a9a62cca886a33e1b0a8fef7cd67fff52747bd47f42d3"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_localstore-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b4c99a0d43112176d6548cd21e5c150d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 8022,
            "upload_time": "2024-02-11T10:14:07",
            "upload_time_iso_8601": "2024-02-11T10:14:07.410250Z",
            "url": "https://files.pythonhosted.org/packages/aa/b6/ee3a91b8bcc2ea59fac833604ba7195211e6e7db5ff9fe2b87d16d799470/nonebot_plugin_localstore-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33dd53f85ad48f9211f77a2472a80a92ae7207a5dc384576ce1d8d59cd223e86",
                "md5": "5820fe50dcd43d8eeb913d0c4cd869b1",
                "sha256": "7eb4039cb2e76c54b860b2b98f2b90cd25284919603e81dedec367f215662fcd"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_localstore-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5820fe50dcd43d8eeb913d0c4cd869b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 6274,
            "upload_time": "2024-02-11T10:14:08",
            "upload_time_iso_8601": "2024-02-11T10:14:08.956462Z",
            "url": "https://files.pythonhosted.org/packages/33/dd/53f85ad48f9211f77a2472a80a92ae7207a5dc384576ce1d8d59cd223e86/nonebot_plugin_localstore-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-11 10:14:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nonebot",
    "github_project": "plugin-localstore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nonebot-plugin-localstore"
}
        
Elapsed time: 0.21034s