xy_dict 模块
Project description
xy_dict
说明
字典工具。
源码仓库
安装
pip install xy_dict
使用
from xy_dict.utils import is_empty_dict, dict_get
object_map_0 = {}
is_empty_dict(object_map_0)
# True
object_map_1 = {"key_0":"object_0"}
is_empty_dict(object_map_1)
# False
dict_get(object_map_1, "key_0")
# object_0
dict_get(object_map_0, "key_0")
# None
from xy_dict.Dict import Dict
object_map_2 = {"key_0":"object_0", "key_1":{"key_2":"object_2"}, "key_3":["object_3"]}
object_dict = Dict(object_map_2)
object_dict.search_k("key_0")
object_dict.key_map
# {'key_0': 'object_0'}
object_dict.search_k("key_1")
object_dict.key_map
# {'key_1': {'key_2': 'object_2'}}
object_dict.search_v("object_0")
object_dict.key_map
# {'key_0': 'object_0'}
object_dict.search_v({"key_2":"object_2"})
object_dict.key_map
# {'key_1': {'key_2': 'object_2'}}
object_dict.search_kv('key_0', 'object_0')
object_dict.key_map
# {'key_0': 'object_0'}
object_dict.search_kv('key_0', 'object_0')
object_dict.key_map
# {'key_0': 'object_0'}
object_dict.search_kv('key_0', 'object_01')
object_dict.key_map
# {}
捐赠
如果小伙伴们觉得这些工具还不错的话,能否请咱喝一杯咖啡呢?
联系方式
微信: yuyangiit
邮箱: 845262968@qq.com
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
xy_dict-1.0.4.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file xy_dict-1.0.4.tar.gz
.
File metadata
- Download URL: xy_dict-1.0.4.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecba4592e7a863673e90ecf92113a481d5b448fffea6326bd3bf2c0f287ad854 |
|
MD5 | ec16d145c37303fd605f2c4fa63e57fc |
|
BLAKE2b-256 | 776d6ac9aa3d32f026437535979296d6e2c87af9673feecd232db73cdbe8ba37 |
File details
Details for the file xy_dict-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: xy_dict-1.0.4-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 355c65a821e955be80473d6560987966aff9c6f4fd3848e1b717600f827a73a5 |
|
MD5 | de931bb539fe570c4a8d69d6392dc65b |
|
BLAKE2b-256 | 2da670e6b25f389b854545c311d706402d8d365dc1d6cee06bb5e0f448460e6f |