skillfed

fan-tools

Various python stuff: testing, aio helpers, etc

fan-tools v4.4.0 179.8K downloads/30d#10,164 on PyPI2
Permissive license DORMANT released

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-tools

uv

uv add fan-tools

poetry

poetry add fan-tools

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: MacOS :: MacOS XOperating System :: POSIXOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: ImplementationProgramming Language :: Python :: Implementation :: CPythonTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Utilities

Tags

testing utilities and helpersasync caching decoratorslazy initialization metaclassunix shell command wrappersstructured json loggingprometheus metrics serverbackup s3 gcloud
testing-utilitiesasync-helpersinternal-tools

More Software Development packages