Metadata-Version: 2.4
Name: jackpyhelpers
Version: 0.1.0
Summary: A small collection of everyday Python helper utilities.
Keywords: helpers,utilities,text,files,hashing
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# pyhelpers

一组日常使用的 Python 小工具函数集合。

## 安装

    pip install pyhelpers

## 使用

```python
from pyhelpers import slugify, chunked, flatten, truncate, sha256_file

slugify("Hello, World!")          # 'hello-world'
list(chunked(range(10), 3))       # [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
flatten([[1, 2], [3, 4]])         # [1, 2, 3, 4]
truncate("a long sentence", 8)    # 'a long...'
sha256_file("some-file.bin")      # 'e3b0c442...'
```

## 命令行

    pyhelpers slug "Hello, World!"   # hello-world
    pyhelpers hash <file>            # 打印文件的 SHA-256 摘要

## 提供的函数

| 函数 | 说明 |
|------|------|
| `slugify(text)` | 把文本转换成 URL 安全的 slug |
| `chunked(iterable, size)` | 把可迭代对象按固定大小分块 |
| `flatten(nested)` | 展平一层嵌套的可迭代对象 |
| `truncate(text, length)` | 截断文本并追加后缀 |
| `sha256_file(path)` | 计算文件的 SHA-256 摘要 |

## 开发

    uv build
