A hierarchical file path resolver for WID-based storage
Project description
widpath
widpath 是一个基于 WID 分层规则 的文件路径解析器,可以把长字符串 WID 映射到分层文件系统路径,用于存储和查找大规模 JSON 文件。
它的目标是方便地将数据切分为层次化的目录结构,避免单目录下文件过多,同时支持二分查找已有文件。
✨ 特性
- 支持将 WID 按固定大小分块,生成分层路径
- 支持查找 最合适的存储文件路径(使用二分查找)
- 默认从最深层开始回溯,效率接近
O(logN) - 可配置分块大小(默认为
2)和分隔符(默认为/) - 简单易用,几行代码即可集成
与现有方案对比
目前在 PyPI 上常见的一些路径操作工具包括:
| 包名 / 类型 | 功能亮点 | 与 widpath 的区别 |
|---|---|---|
| widpath (本包) | 根据 WID 切片 + 分层路径 + 二分查找 | 专为 WID 管理设计,支持快速定位存储路径 |
wildpath |
通配符访问数据结构 | 与文件系统路径分层无关 |
path / path.py |
更友好的路径操作接口 | 注重路径 API,不支持 WID 分层策略 |
标准库 pathlib |
面向对象的路径处理,跨平台兼容 | 基础操作,不支持分层和二分查找 |
结论: widpath 提供了一种专门针对 WID 的分层文件管理与查找机制,是对现有通用路径库的有益补充。
📦 安装
从 PyPI 安装
pip install widpath
支持作者
如果你觉得这个项目对你有帮助,可以考虑捐赠支持开发:
现金支持
- PayPal:
数字货币支持
- Bitcoin (BTC): bc1qa5g4aeg6rp8m46c4lwxfapesmwkns0rhjmm65g
- Ethereum (ETH): 0xA466f5E4D0eaAc20f38154D7D4F0a2b75076e0a0
非常感谢你的支持 🙏
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
widpath-0.1.1.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file widpath-0.1.1.tar.gz.
File metadata
- Download URL: widpath-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1343a17b09bcfec9cdfb42a42a41a5bf08328b808fca13421941e1d0d3fde244
|
|
| MD5 |
e5cd769d681ff270f428a4797bf2da7a
|
|
| BLAKE2b-256 |
4399ab74c544e1ae376b5bf6e7928c158e1d817e9476c93d3f6c5694c461bee7
|
File details
Details for the file widpath-0.1.1-py3-none-any.whl.
File metadata
- Download URL: widpath-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c47870881c9e7ced1442e12125581aa7b0e3c5ecfe50ebf55f58da0c4e6dd356
|
|
| MD5 |
a16a34dfbde1f50f80d796b4425ad049
|
|
| BLAKE2b-256 |
ece58287b4101ae8b43b052b61e9eb585638abd125c0a58b7894a7f25f8a28fc
|