fan-tools
Various python stuff: testing, aio helpers, etc
What it is and what it does
fan-tools is a collection of internal utilities originally built for testing but expanded to cover async helpers, Unix operations, logging, monitoring, and backup tasks. It provides decorators for caching async and sync functions, a metaclass for lazy-initialized properties in test classes, wrappers around shell commands with async support, structured JSON logging for ELK-style systems, a Prometheus metrics server, and backup helpers for S3 and Google Cloud. The package depends on pyyaml and typing-extensions and is designed for Python 3.8+.
The toolkit is most useful for teams running internal testing infrastructure or operational scripts that need consistent patterns across projects. Its testing helpers (PropsMeta, ApiUrls, caching decorators) reduce boilerplate in test suites, while its Unix and logging modules simplify shell integration and observability. However, the package is dormant—last updated 680 days ago—so it may not receive updates for compatibility with newer Python or dependency versions.
Use it for:
- Build test fixtures with lazy-initialized connections and cached properties using PropsMeta to avoid complex setUp methods.
- Define nested API endpoint URLs in test fixtures with ApiUrls for parameterized test requests.
- Cache expensive async function results during test runs with cache_async decorator.
- Run shell commands from Python with real-time logging and error checking via asucc and succ wrappers.
- Output structured JSON logs with environment variables for ingestion into ELK or similar observability platforms.
- Expose application metrics in Prometheus format using MetricsServer with FastAPI.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A collection of internal testing utilities, async helpers, and operational tools including caching decorators, API URL builders, lazy-initialization metaclasses, Unix shell wrappers, JSON logging, metrics servers, and backup integrations.
Yes, if you are maintaining internal testing infrastructure or operational scripts that benefit from its specific patterns (lazy initialization, shell wrappers, structured logging). No, if you need active maintenance or expect compatibility updates—the package is dormant and may not adapt to future Python or dependency changes. The low install friction and permissive license make it low-risk to try, but plan for potential maintenance burden if the project evolves.
Install
fan-tools on PyPI
pip
pip install fan-toolsuv
uv add fan-toolspoetry
poetry add fan-toolsInstalling fan-tools
Before you install
Low install friction with only two runtime dependencies (pyyaml, typing-extensions). Maintenance is dormant—last release was 680 days ago with no recent commits, though the repository remains active and the package is marked Production/Stable.
License in practice
Licensed under MIT (permissive), so you can use this package freely in commercial and open-source projects without significant legal constraints.
Quickstart
pip install fan-tools
from fan_tools.python import memoize
@memoize
def expensive_function(x):
return x * 2
result = expensive_function(5)
Requires Python 3.8 or later; the package explicitly supports only 3.8+ and does not backport async/await or similar features to earlier versions.
Verify before relying
- Whether the package is actively maintained or if dormancy signals future incompatibility with newer Python or dependency versions.
- Real-world stability and test coverage of the backup integrations (S3, GCloud) in production environments.
- Whether all listed modules (Django middleware, DRF serializers, FastAPI metrics) are fully functional or partially deprecated.
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pyyaml, typing-extensions |
| Maintenance | dormant — 680 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 179,778/month — #10,164 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fan_tools-4.4.0-py2.py3-none-any.whl
Keywords: asyncio, testing
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
prometheus-fastapi-instrumentatorAdds Prometheus metrics collection and exposure…
permissive · top 5,000 on PyPI
wraptwrapt provides a Python module for building…
permissive · top 100 on PyPI
botoinatorBotoinator lets you attach decorators to boto3…
permissive · top 15,000 on PyPI
asyncacheProvides decorator-based caching for async…
permissive · top 5,000 on PyPI
fastapi-decoratorsConverts functions into FastAPI-compatible…
permissive · top 15,000 on PyPI
methodtoolsProvides LRU caching for methods, classmethods,…
permissive · top 5,000 on PyPI
cache-to-diskA decorator that caches function results to…
permissive · top 15,000 on PyPI
proxy_toolsProvides a lazy-evaluation proxy object that…
permissive · top 5,000 on PyPI
prometheus-flask-exporterExports HTTP request metrics from Flask…
permissive · top 5,000 on PyPI
undecoratedStrips decorators from Python functions,…
permissive · top 15,000 on PyPI