Skip to main content

Zero-dependency, single-file Python implementations of popular libraries

Project description

zerodep

PyPI GitHub Release License: MIT Python CI Docs

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

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

English Docs | 中文文档

Quick Start

pip install zerodep          # install the CLI
zerodep add yaml retry       # copy modules into your project
from yaml import load, dump

data = load("name: Alice\nage: 30")
print(data)  # {'name': 'Alice', 'age': 30}

Each module is a self-contained single .py file — copy it into your project and import. No pip install needed at runtime.

Modules

Agent Protocols

Module Description Benchmark Against
jsonrpc/ JSON-RPC 2.0 protocol: data types, dispatcher, async transport jsonrpcserver
a2a/ Google A2A protocol: JSON-RPC 2.0, SSE streaming, task management a2a-python
acp/ Anthropic ACP protocol: JSON-RPC 2.0 over stdio, async client/agent acp-python
skills/ Agent Skills runtime: parse, discover, manage, select skills

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
xml/ XML ↔ dict converter with fault-tolerant parsing and LLM tag extraction xmltodict
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) python-frontmatter

Data Validation

Module Description Benchmark Against
validate/ Runtime TypedDict/dataclass validator with JSON Schema generation pydantic
semver/ PEP 440 version parser and comparator packaging

Text & Markup

Module Description Benchmark Against
markdown/ Markdown → 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
sparse_search/ BM25/BM25+/BM25L/BM25F + TF-IDF full-text search with Bayesian calibration rank-bm25

Configuration

Module Description Benchmark Against
dotenv/ .env file parser (load_dotenv, dotenv_values) python-dotenv
config/ Unified config loader (env vars, .env, JSON/YAML/TOML/INI) python-decouple

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

Module Description Benchmark Against
aes/ AES encryption: ECB, CBC, CTR, GCM modes (pure Python + OpenSSL via ctypes) pycryptodome

Infrastructure & Tools

Module Description Benchmark Against
cache/ In-memory cache with TTL, LRU/LFU eviction, sync + async decorators
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
runner/ Structured subprocess execution with timeout escalation
vcs/ Git/Hg/Jujutsu CLI wrapper (diff, status, log, blame)
filelock/ Cross-platform advisory file lock (fcntl/msvcrt)
qr/ QR Code generation with terminal rendering qrcode
persistdict/ Persistent dict with JSON file and SQLite backends
depdetect/ Dependency detection and verification utility

Versioning

  • Project: CalVer YYYY.M.D (e.g., 2026.4.15)
  • Modules: independent SemVer per module (e.g., 0.4.1)

Releases are automated via the Release workflow — lint, test, bump module versions, tag, and create a GitHub Release in one step.

Documentation

License

MIT

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

zerodep-2026.4.15.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

zerodep-2026.4.15.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file zerodep-2026.4.15.1.tar.gz.

File metadata

  • Download URL: zerodep-2026.4.15.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for zerodep-2026.4.15.1.tar.gz
Algorithm Hash digest
SHA256 8c1a415d1634c5e99105e6fbe1f170c64a0e2ebb1a48926006289b06227dbef8
MD5 ecb76fc75a840a7b578dfb4e2598552f
BLAKE2b-256 793c8c1a042bbf5681da25b08892cd0e71069d3dc0db342e51dbe0e70851e7df

See more details on using hashes here.

File details

Details for the file zerodep-2026.4.15.1-py3-none-any.whl.

File metadata

  • Download URL: zerodep-2026.4.15.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for zerodep-2026.4.15.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37394bba2e90a58bf523bf51ae0f5cc63da8a12a70582ad06f17517fb42dabf2
MD5 66de85c124f84c75d40836b93331601c
BLAKE2b-256 381894701c90004fee3f15859c7c07af5ee21359c947c05b267235d8d39660eb

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