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_plugin_cache_dir()
plugin_cache_file: Path = store.get_plugin_cache_file("filename")
plugin_config_dir: Path = store.get_plugin_config_dir()
plugin_config_file: Path = store.get_plugin_config_file("filename")
plugin_data_dir: Path = store.get_plugin_data_dir()
plugin_data_file: Path = store.get_plugin_data_file("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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c2a7b39b50240896d9306adb79d8047308d0e77b88e3272b19be4908bdaabc9 |
|
MD5 | cb3b42b48871ef0544e6b7464c37ac52 |
|
BLAKE2b-256 | 38184656dc5ac000d04ba0f00cf0a54ab0f4f381f0453d6cad6e04736f43991e |
Close
Hashes for nonebot_plugin_localstore-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7908af162d1d0e8c736ae8863723325d057289f6b080ae44ff9ff39294f9ed16 |
|
MD5 | 19f4fe0e48d0c5c6643d375ae4d6e2db |
|
BLAKE2b-256 | fbaaa00d2ddfd96008d2fb6d50031f9cb97a2c55621e6fb36dae6b6cb8a50384 |