skillfed

whichcraft

This package provides cross-platform cross-python shutil.which functionality.

whichcraft v0.6.1 363.1K downloads/30d#7,227 on PyPI71
Permissive license BSD Abandoned released

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 whichcraft

uv

uv add whichcraft

poetry

poetry add whichcraft

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7

Tags

find executable in pathcross-platform which commandlocate system command pythonshutil.which alternativecommand line tool finderwindows mac linux whichpython 2 and 3 which
cross-platformlegacy-python

More Utilities packages