Local Storage Support for NoneBot2
Project description
NoneBot Plugin LocalStore
✨ NoneBot 本地数据存储插件 ✨
使用方式
加载插件后使用 require
声明插件依赖,直接使用 localstore
插件提供的函数即可。
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
查看具体的存储路径:
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>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nonebot_plugin_localstore-0.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f04d99daba13d8e7cc6cf72c43fab28cbde30e0c2a71b328e815d9c96403e2e3 |
|
MD5 | 8dea857353562b659df2bff5e5a542c3 |
|
BLAKE2b-256 | d4f8a9fac645aad6c95fb1a350140f23e087216f8d3cb004b44541bc289c5be3 |
Close
Hashes for nonebot_plugin_localstore-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb8a18d87c88259ff3ae4d741390e44076d48c8cc9c33aea66f7a6a29fe70af |
|
MD5 | e36eb909a32c35040a73cf1bf8027d57 |
|
BLAKE2b-256 | 87606b0866053566a1be080b56abafff0b82a269f4cf52ef7681d1a02ea2ca4d |