whichcraft
This package provides cross-platform cross-python shutil.which functionality.
What it is and what it does
whichcraft is a lightweight shim around Python's shutil.which function designed to work consistently across Windows, macOS, and Linux, and across Python 2.7 and Python 3.x versions. It locates executables in the system PATH and returns their full path as a string, or None if the command is not found.
The package was originally extracted from the Cookiecutter project to reduce code duplication. It handles cross-platform differences in how the which functionality behaves—for example, some built-in commands like 'date' exist natively on Unix systems but are built-in functions on Windows, which affects the return value. With no runtime dependencies and a simple API, it is useful for scripts and tools that need to find system commands portably.
Use it for:
- Locate system executables in build scripts or deployment tools that run on multiple operating systems.
- Check whether a required command-line tool is installed before attempting to invoke it.
- Write Python 2.7 compatible code that needs shutil.which functionality without conditional imports.
- Verify the full path to a command in cross-platform CLI applications or wrappers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a cross-platform, cross-Python implementation of shutil.which to locate executable commands in the system PATH.
Yes, if you need cross-platform which functionality for Python 2.7 or older Python 3 versions. However, modern Python 3.3+ includes shutil.which natively, so this package is most useful for legacy codebases or environments where Python 2.7 support is still required. The package is abandoned since 2019-09-06, so consider whether you can rely on unmaintained code for your use case.
Install
whichcraft on PyPI
pip
pip install whichcraftuv
uv add whichcraftpoetry
poetry add whichcraftInstalling whichcraft
Before you install
Installation is straightforward with no runtime dependencies. The package is abandoned, with the latest release on 2019-09-06 and no updates since then.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
pip install whichcraft
from whichcraft import which
result = which('date')
print(result) # '/bin/date' or None if not found
Verify before relying
- Whether the package functions correctly on Python versions beyond 3.7, given its abandoned status.
- Current compatibility with Windows built-in functions like 'date' that behave differently than on Unix systems.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,534 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 363,070/month — #7,227 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: whichcraft-0.6.1-py2.py3-none-any.whl
Keywords: whichcraft
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pyProvides cross-platform path objects, INI file…
permissive · top 1,000 on PyPI
clipboardProvides a simple interface to copy text to and…
permissive · top 15,000 on PyPI
ifcfgIfcfg parses network interface configuration…
permissive · top 15,000 on PyPI
selectors2Provides a backported, cross-platform…
permissive · top 15,000 on PyPI
findlibsLocates shared libraries on the system by…
permissive · top 5,000 on PyPI
UnipathUnipath provides an object-oriented interface…
permissive · top 15,000 on PyPI
locateProvides utilities to locate the current Python…
unclear · top 5,000 on PyPI
puccinialinInstalls Rust and Cargo into a temporary cache…
permissive · top 5,000 on PyPI
lockfileProvides a platform-independent file locking…
permissive · top 1,000 on PyPI
Send2TrashSends files and directories to the platform's…
permissive · top 1,000 on PyPI