Metadata-Version: 2.4
Name: zerodep
Version: 0.2.2
Summary: Zero-dependency, single-file Python implementations of popular libraries
Author: Peng Ding
License-Expression: MIT
Project-URL: Repository, https://github.com/Oaklight/zerodep
Project-URL: Issues, https://github.com/Oaklight/zerodep/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Requires-Dist: pytest-benchmark>=4.0.0; extra == "test"
Provides-Extra: bench-aes
Requires-Dist: pycryptodome>=3.20.0; extra == "bench-aes"
Provides-Extra: bench-qr
Requires-Dist: qrcode>=7.0; extra == "bench-qr"
Requires-Dist: Pillow>=10.0.0; extra == "bench-qr"
Provides-Extra: bench-http
Requires-Dist: httpx>=0.27.0; extra == "bench-http"
Provides-Extra: bench-dotenv
Requires-Dist: python-dotenv>=1.0.0; extra == "bench-dotenv"
Provides-Extra: bench-yaml
Requires-Dist: PyYAML>=6.0; extra == "bench-yaml"
Provides-Extra: bench-jsonc
Requires-Dist: commentjson>=0.9.0; extra == "bench-jsonc"
Provides-Extra: bench-structlog
Requires-Dist: structlog>=24.0.0; extra == "bench-structlog"
Provides-Extra: bench-retry
Requires-Dist: tenacity>=8.0.0; extra == "bench-retry"
Provides-Extra: bench-toon
Requires-Dist: toon-format>=0.1.0; extra == "bench-toon"
Provides-Extra: bench-tabulate
Requires-Dist: tabulate>=0.9.0; extra == "bench-tabulate"
Provides-Extra: bench-soup
Requires-Dist: beautifulsoup4>=4.12.0; extra == "bench-soup"
Provides-Extra: bench-validate
Requires-Dist: pydantic>=2.0.0; extra == "bench-validate"
Provides-Extra: bench-sse
Requires-Dist: httpx-sse>=0.4.0; extra == "bench-sse"
Requires-Dist: httpx>=0.27.0; extra == "bench-sse"
Provides-Extra: bench-markdown
Requires-Dist: mistune>=3.0.0; extra == "bench-markdown"
Provides-Extra: bench-diff
Requires-Dist: unidiff>=0.7.0; extra == "bench-diff"
Provides-Extra: bench-scheduler
Requires-Dist: APScheduler>=3.10.0; extra == "bench-scheduler"
Requires-Dist: schedule>=1.2.0; extra == "bench-scheduler"
Requires-Dist: croniter>=1.3.0; extra == "bench-scheduler"
Provides-Extra: bench-search
Requires-Dist: rank-bm25>=0.2.2; extra == "bench-search"
Provides-Extra: bench-frontmatter
Requires-Dist: python-frontmatter>=1.1.0; extra == "bench-frontmatter"
Provides-Extra: bench-config
Requires-Dist: python-decouple>=3.8; extra == "bench-config"
Provides-Extra: bench-cache
Requires-Dist: cachetools>=5.0.0; extra == "bench-cache"
Provides-Extra: bench-xml
Requires-Dist: xmltodict>=0.13.0; extra == "bench-xml"
Provides-Extra: dev
Requires-Dist: zerodep[bench-aes,bench-cache,bench-config,bench-diff,bench-dotenv,bench-frontmatter,bench-http,bench-jsonc,bench-markdown,bench-qr,bench-retry,bench-scheduler,bench-search,bench-soup,bench-sse,bench-structlog,bench-tabulate,bench-toon,bench-validate,bench-xml,bench-yaml,test]; extra == "dev"

# zerodep

Zero-dependency, single-file Python implementations of popular libraries — stdlib only, Python 3.10+.

零依赖、单文件的 Python 常用库实现 —— 仅使用标准库，支持 Python 3.10+。

## Modules

**Web & Networking**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `httpclient/` | Sync + async REST client with connection pooling, proxy, and auth | `httpx` |
| `sse/` | Server-Sent Events client with auto-reconnect | `httpx-sse` |

**Data Formats**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `yaml/` | YAML parser and serializer (common subset) | `PyYAML` |
| `jsonc/` | JSONC parser (JSON with comments and trailing commas) | `commentjson` |
| `toon/` | TOON (Token-Oriented Object Notation) encoder/decoder | `toon_format` |
| `frontmatter/` | Frontmatter parser and serializer (YAML/TOML/JSON file-header metadata) | `python-frontmatter` |

**Data Validation**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `validate/` | Runtime TypedDict/dataclass validator with JSON Schema generation | `pydantic` |

**Text & Markup**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `markdown/` | Markdown to HTML renderer (CommonMark subset + GFM tables) | `mistune` |
| `soup/` | HTML parser with BeautifulSoup-like API (find, select, CSS selectors) | `beautifulsoup4` |
| `diff/` | Unified diff parser, patch apply/reverse, three-way merge | `unidiff` |

**Search & Retrieval**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `search/` | BM25/BM25+/BM25L/BM25F + TF-IDF full-text search engine | `rank-bm25` |

**Configuration**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `dotenv/` | .env file parser (load_dotenv, dotenv_values) | `python-dotenv` |

**CLI & Terminal**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `ansi/` | ANSI terminal styling: colors, attributes, detection, strip/visible_len | — |
| `tabulate/` | Table formatting with multiple output styles | `tabulate` |
| `prompt/` | Interactive CLI prompts (confirm, select, text) | `questionary` |

**Security & Encoding**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `aes/` | AES encryption: ECB, CBC, CTR, GCM modes (pure Python + OpenSSL via ctypes) | `pycryptodome` |
| `qr/` | QR Code generation with terminal rendering | `qrcode` |

**Infrastructure & Tools**

| Module | Description | Benchmark Against |
|--------|-------------|-------------------|
| `retry/` | Retry decorator with configurable backoff strategies | `tenacity` |
| `scheduler/` | In-process task scheduler with cron, interval, one-shot triggers | `APScheduler` |
| `structlog/` | Structured logging with pretty console output | `structlog` |
| `vcs/` | Git/Hg/Jujutsu CLI wrapper (diff, status, log, blame) | — |

## Usage

Each module is a **self-contained single file** that you can copy directly into your project. No installation required.

Some modules have optional **sibling dependencies** on other zerodep modules (e.g. `structlog` can use `ansi` for color support). These are loaded via guarded imports — if the sibling module is absent, the module falls back to inline constants and remains fully functional.

## License

MIT
