python-humanize / python-humanize/humanize
Suggestion: Add an entrypoint and/or scripts for command-line use
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 756
- 派生
- 148
- 平均合并
- 6 天 1 小时
- 30 天内合并 PR
- 12
描述
Thank you for your great project!
Google always guides me to https://stackoverflow.com/a/15485265, which suggests humanize.naturalsize(). I'm ok to type in ipython, and copy & paste import humanize and humanize.naturalsize().
But it'd be more than great if this small task could be simplified in something like these ways.
$ naturalsize 8589934592
8.6 GB
$ naturalsize --binary 8589934592
8.0 GiB
$ echo 8589934592 | python -m humanize naturalsize --format "%.3f"
8.590 GB
There are tools such as numfmt, but pip install is easier for me as a Windows user. :)
I'd open a PR if I found some time for this. But I can't promise my contribution. So, I'm filing just an idea here.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查现有的 naturalsize API,以及该包目前如何提供模块或入口点。比较所请求的 naturalsize 命令和 python -m humanize 示例,包括 binary、format 和 piped-input 的行为;完成的标准是有一个文档化的命令行路径支持已商定的范围。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100