A simple, dynamic sanity-check library for Python distributions.
Project description
pycheck-tool
pycheck-tool is the safe, zero-dependency way to answer "Is this Python install healthy?" — whether you're a beginner sharing logs or a maintainer shipping CI.
At a Glance
| Current version | 0.1.4 |
| Python support | 3.9 – 3.13 |
| License | MIT |
| Maintainer | Aubrey |
| Status | Battle-tested and production-ready |
Features
- No dependencies – works anywhere Python does.
- Two-tier checks – run
--osfor a quick stdlib sweep or--allwhen you need every package exercised. - Friendly CLI aliases –
pycheck-tool,pycheck, anddo_checkall point to the same entry point. - JSON with the Dutcho filter – usernames and home paths are scrubbed automatically, so you can paste logs without leaking
/Users/you. - Capability probes – built-in filesystem + SSL diagnostics with clear pass/fail status codes.
- Hostile environment resilience – survives corrupted
sys.modules, broken imports, and malformed distributions without crashing. - Debug diagnostics – use
--debugto see which modules failed to import. - Spam protection – use
--limit Nto cap output when checking many packages. - Release automation – published via Trusted Publishing as soon as you cut a GitHub Release.
Quick Start
Option A – use it
pip install pycheck-tool
# Minimal health check (runs --os by default)
pycheck-tool
You can also get it via curl, by typing:
curl -fsSL https://raw.githubusercontent.com/Auberryy/pycheck/main/pycheck_tool.py | python3 -
Option B – hack on it
git clone https://github.com/Auberryy/pycheck.git
cd pycheck
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .[dev]
pytest
Command cheat sheet
| When you need… | Run |
|---|---|
| Fast confidence in stdlib modules | pycheck --os |
| Exhaustive audit of installed packages | pycheck --all |
| Shareable JSON (sanitized) | pycheck --json > report.json |
| Human + JSON in one go | pycheck --os --json |
| Debug failing imports | pycheck --os --debug |
| Limit output spam | pycheck --all --limit 10 |
| Backwards-compatible names | pycheck-tool or do_check |
JSON reports & the Dutcho filter
--json emits machine-friendly output (perfect for Neovim, editors, CI). Before printing, every string is sanitized:
- Home directory prefixes become
~. - Usernames are replaced with
<user>. - Capability entries (filesystem, SSL) share the exact status you can copy/paste online.
pycheck --json > reports\health.json
# Safe to share: no absolute paths or usernames leaked
Python API
import pycheck
# Quick stdlib check
if pycheck.doSanityCheck(pycheck.OS):
print("OS Library is good")
# Full package audit
result = pycheck.doSanityCheck(pycheck.ALL)
if result:
print(f"{result} libraries are fine!")
# Get list of failed imports for diagnostics
failed = pycheck.get_failed_imports(pycheck.OS)
if failed:
print(f"Failed to import: {failed}")
# Check specific capabilities
ssl_result = pycheck.check_ssl_support()
fs_result = pycheck.check_filesystem_access()
Use the API when you want to embed health checks into your own tooling or CI scripts.
Capability probes
Each run appends capability entries to the report:
filesystem_access– verifies we can write/read a temp file.ssl– ensures thesslmodule imports and can create a default context.
Failures cause a non-zero exit code so CI can gate on them.
Robustness
pycheck is designed to survive hostile environments:
- Corrupted sys.modules – handles
None, integers, or broken objects where modules should be. - Broken distributions – gracefully skips packages with corrupted metadata.
- Import side effects – catches exceptions from packages that crash during import.
- Ctrl+C support – properly propagates
KeyboardInterruptandSystemExit.
Development & release flow
- Work on a feature branch, add tests (use
unittest.mockto simulate failures). - Run
pytestandpycheck --jsonbefore pushing. - Open a PR. Once merged, create a GitHub Release — the
publish.ymlworkflow builds and uploads to PyPI with trusted publishing (no tokens to copy).
See CONTRIBUTING.md for full guidelines, including the "Zero Dependencies Forever" rule.
Project layout
src/pycheck/
├── __init__.py # Package exports and version
├── checker.py # Core sanity-check logic
├── cli.py # CLI entry point and argument parsing
└── utils.py # Sanitization helpers
tests/ # pytest suite with mocked failure scenarios
examples/ # Tiny runnable snippets
pycheck_tool.py # Standalone single-file version
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycheck_tool-0.1.4.tar.gz.
File metadata
- Download URL: pycheck_tool-0.1.4.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b6a6dfb95c8d603434b790cb6949a6237d119ce23fb12125f333660d7ac85f
|
|
| MD5 |
add97db2a7c1bfc23c40bbfd6a2ca14d
|
|
| BLAKE2b-256 |
524d2b4f6c48888750d6171d0b7342f54dc3e186fb9b4f1e95467ab7a5e2818f
|
File details
Details for the file pycheck_tool-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pycheck_tool-0.1.4-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fe7ee8b8843b4b7c55fd35f78535bb2d40cf9f5bbe5877c31af07d08855e15c
|
|
| MD5 |
997dcf6e5f56086914ea42f48f490b2c
|
|
| BLAKE2b-256 |
81110d13d94a0f30db4c510605757f07a0387d57d27f0f656d46b03b44b37734
|