Metadata-Version: 2.4
Name: pytilpack
Version: 1.45.1
Summary: Python Utility Pack
Author-email: "aki." <mark@aur.ll.to>
License: MIT
License-File: LICENSE
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: <4.0,>=3.12
Requires-Dist: beautifulsoup4>=4.14.3
Requires-Dist: httpx>=0.28.1
Requires-Dist: mcp>=1.0.0
Requires-Dist: werkzeug>=3.1.7
Provides-Extra: all
Requires-Dist: azure-identity>=1.23.0; extra == 'all'
Requires-Dist: babel>=2.18.0; extra == 'all'
Requires-Dist: bleach>=6.2; extra == 'all'
Requires-Dist: cryptography>=46.0.6; extra == 'all'
Requires-Dist: fastapi>=0.111; extra == 'all'
Requires-Dist: flask-login>=0.6; extra == 'all'
Requires-Dist: flask>=3.0; extra == 'all'
Requires-Dist: html5lib; extra == 'all'
Requires-Dist: hypercorn>=0.18.0; extra == 'all'
Requires-Dist: markdown>=3.6; extra == 'all'
Requires-Dist: msal>=1.32.3; extra == 'all'
Requires-Dist: pillow; extra == 'all'
Requires-Dist: pycryptodome; extra == 'all'
Requires-Dist: pydantic>=2.12.5; extra == 'all'
Requires-Dist: pytest; extra == 'all'
Requires-Dist: pytest-asyncio; extra == 'all'
Requires-Dist: python-dotenv>=1.0.1; extra == 'all'
Requires-Dist: pyyaml>=6.0; extra == 'all'
Requires-Dist: quart-auth>=0.11.0; extra == 'all'
Requires-Dist: quart>=0.20.0; extra == 'all'
Requires-Dist: sqlalchemy>=2.0; extra == 'all'
Requires-Dist: tabulate[widechars]>=0.9; extra == 'all'
Requires-Dist: tiktoken>=0.6; extra == 'all'
Requires-Dist: tinycss2>=1.4; extra == 'all'
Requires-Dist: tqdm>=4.0; extra == 'all'
Requires-Dist: uvicorn>=0.34.3; extra == 'all'
Provides-Extra: babel
Requires-Dist: babel>=2.18.0; extra == 'babel'
Provides-Extra: bleach
Requires-Dist: bleach>=6.2; extra == 'bleach'
Provides-Extra: environ
Requires-Dist: python-dotenv>=1.0.1; extra == 'environ'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.111; extra == 'fastapi'
Requires-Dist: html5lib; extra == 'fastapi'
Provides-Extra: flask
Requires-Dist: flask-login>=0.6; extra == 'flask'
Requires-Dist: flask>=3.0; extra == 'flask'
Requires-Dist: html5lib; extra == 'flask'
Requires-Dist: pytest; extra == 'flask'
Provides-Extra: htmlrag
Provides-Extra: markdown
Requires-Dist: bleach; extra == 'markdown'
Requires-Dist: markdown>=3.6; extra == 'markdown'
Requires-Dist: tinycss2; extra == 'markdown'
Provides-Extra: mcp
Provides-Extra: msal
Requires-Dist: azure-identity>=1.23.0; extra == 'msal'
Requires-Dist: cryptography>=46.0.6; extra == 'msal'
Requires-Dist: msal>=1.32.3; extra == 'msal'
Provides-Extra: pycryptodome
Requires-Dist: pycryptodome; extra == 'pycryptodome'
Provides-Extra: pydantic
Requires-Dist: pydantic>=2.12.5; extra == 'pydantic'
Provides-Extra: pytest
Requires-Dist: pytest; extra == 'pytest'
Requires-Dist: pytest-asyncio; extra == 'pytest'
Provides-Extra: pyyaml
Requires-Dist: pyyaml>=6.0; extra == 'pyyaml'
Provides-Extra: quart
Requires-Dist: html5lib; extra == 'quart'
Requires-Dist: hypercorn>=0.18.0; extra == 'quart'
Requires-Dist: pytest; extra == 'quart'
Requires-Dist: quart-auth>=0.11.0; extra == 'quart'
Requires-Dist: quart>=0.20.0; extra == 'quart'
Requires-Dist: uvicorn>=0.34.3; extra == 'quart'
Provides-Extra: sqlalchemy
Requires-Dist: sqlalchemy>=2.0; extra == 'sqlalchemy'
Requires-Dist: tabulate[widechars]>=0.9; extra == 'sqlalchemy'
Provides-Extra: tiktoken
Requires-Dist: openai>=1.99.6; extra == 'tiktoken'
Requires-Dist: pillow; extra == 'tiktoken'
Requires-Dist: tiktoken>=0.6; extra == 'tiktoken'
Provides-Extra: tqdm
Requires-Dist: tqdm>=4.0; extra == 'tqdm'
Provides-Extra: web
Requires-Dist: html5lib>=1.1; extra == 'web'
Description-Content-Type: text/markdown

# pytilpack

[![CI][ci-badge]][ci-link]

[ci-badge]: https://github.com/ak110/pytilpack/actions/workflows/ci.yaml/badge.svg
[ci-link]: https://github.com/ak110/pytilpack/actions/workflows/ci.yaml
[![PyPI version](https://badge.fury.io/py/pytilpack.svg)](https://badge.fury.io/py/pytilpack)

Pythonのユーティリティ集。

## 特徴

- モジュール単位の個別import: 必要なモジュールだけ取り込む
- extrasによる依存の最小化: 対象ライブラリごとに追加インストール
- CLI同梱: `pytilpack`コマンドで各種サブコマンドを提供
- 主要Pythonライブラリ向けユーティリティ（FastAPI / Flask / Quart / SQLAlchemy / Pydanticなど）

## インストール

ベースパッケージ（stdlib系ユーティリティ + beautifulsoup4/httpx/mcp/werkzeug）:

```bash
pip install pytilpack
```

各モジュールが必要とするライブラリはextrasで追加インストールする:

```bash
pip install pytilpack[all]       # 全モジュール
pip install pytilpack[fastapi]   # pytilpack.fastapi 用
pip install pytilpack[flask]     # pytilpack.flask 用
# ...
```

`uvx` でCLIを使う場合、サブコマンドが要求するextrasを `--from` で明示する:

```bash
uvx pytilpack mcp
uvx --from 'pytilpack[sqlalchemy]' pytilpack wait-for-db-connection "$SQLALCHEMY_DATABASE_URI"
```

### extras 一覧

| Extra | 対象モジュール | 主な依存パッケージ |
| ----- | -------------- | ------------------ |
| `all` | 全モジュール | (全依存) |
| `babel` | `.babel`, `.i18n` | babel |
| `bleach` | (markdown extraに含まれる) | bleach |
| `environ` | `.environ` | python-dotenv |
| `fastapi` | `.fastapi` | fastapi, html5lib |
| `flask` | `.flask`, `.flask_login` | flask, flask-login, html5lib |
| `markdown` | `.markdown` | bleach, markdown, tinycss2 |
| `msal` | `.msal` | azure-identity, cryptography, msal |
| `pycryptodome` | `.pycrypto` | pycryptodome |
| `pydantic` | `.pydantic` | pydantic |
| `pytest` | `.pytest` | pytest, pytest-asyncio |
| `pyyaml` | `.yaml` | pyyaml |
| `quart` | `.quart`, `.quart_auth` | quart, quart-auth, hypercorn, uvicorn |
| `sqlalchemy` | `.sqlalchemy` | sqlalchemy, tabulate |
| `tiktoken` | `.tiktoken` | tiktoken, openai, pillow |
| `tqdm` | `.tqdm` | tqdm |
| `web` | `.web` (check_html) | html5lib |

extras不要のモジュール（ベースパッケージに含まれる）の代表例は以下のとおり。
全モジュール一覧は[ドキュメント](https://ak110.github.io/pytilpack/)を参照。

- `.cache` / `.crypto` / `.data_url` / `.functools`
- `.healthcheck` / `.htmlrag` / `.http` / `.httpx` / `.io`
- `.json` / `.jsonc` / `.paginator` / `.random`
- `.ratelimit` / `.secrets` / `.sse` / `.validator`

## 主な使い方

各モジュールを個別にimportして利用する。

```python
import pytilpack.xxx
```

`xxx` には対象ライブラリ名（`httpx` や `pathlib` など）が入る。

モジュール一覧やAPIリファレンスは[ドキュメント](https://ak110.github.io/pytilpack/)を参照。
一部はCLIもある。詳細は[CLIコマンド](https://ak110.github.io/pytilpack/guide/cli/)を参照。

## ドキュメント

- <https://ak110.github.io/pytilpack/> — 概要・モジュール一覧・APIリファレンス
- <https://ak110.github.io/pytilpack/llms.txt> — LLM向け構造化インデックス
- [docs/development/development.md](docs/development/development.md) — 開発者向け情報
