Skip to main content

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.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

widpath-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file widpath-0.1.0.tar.gz.

File metadata

  • Download URL: widpath-0.1.0.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

Hashes for widpath-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c98ba80ea4046c4c9d83fbd1ad6cac7db8009c9a2a11ff7bfdf0875a94215359
MD5 debb314592af9ecb462612e93caae39c
BLAKE2b-256 7c613700377c0362d4cbf460b3b2cc550f02052f1118a846417205d463bcb4f7

See more details on using hashes here.

File details

Details for the file widpath-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: widpath-0.1.0-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

Hashes for widpath-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73641a388aeb2566f9fcdb0491be9cc0e9a52f0d56cc0378abc9ccf907b8c7e2
MD5 56064e6692961d1160b17ba85fe1f14d
BLAKE2b-256 d04e2819abfb420774769b8be142dfe4ac4fbe570513d43ea6f5150013546e66

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page