Skip to main content

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

Project description

https://badge.fury.io/py/whichcraft.png https://travis-ci.org/pydanny/whichcraft.png?branch=master

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

Usage

On Linux, Mac, Windows for Python 2.6, 2.7, or any of the 3s:

>>> from whichcraft import which
>>> which('date')
'/bin/date'
>>> which('calendar')
'/bin/calendar'
>>> which('cookiecutter')
'/Users/pydanny/.envs/fun/bin/cookiecutter'
>>> which('a-made-up-name') is None
True

Notes

This is a shim of the shutil.which function that’s designed to work across multiple versions of Python and inside of windows. The code for Python 2.x is based on Python 3 code that I extracted from source. I originally did this for Cookiecutter but pulled it out in order to reduce line count for that project.

History

0.1.0 (2015-09-09)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whichcraft-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

whichcraft-0.1.0-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file whichcraft-0.1.0.tar.gz.

File metadata

  • Download URL: whichcraft-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for whichcraft-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe23367de9ea556c75838cf4a9a9397bb3db5db509f0fe176e88e47059343c24
MD5 5c551f1f35b3aa9bf8442fa4b9ec1739
BLAKE2b-256 7f3e8f35dfc65363436ce698b95f4142c4b57628e0dc76c0a8f7068a8c741c0c

See more details on using hashes here.

File details

Details for the file whichcraft-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for whichcraft-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e3704ad84c925efa0ad1ca364d19f32787f9d39e6d964aa5220506b33b430eba
MD5 17fd06a3d20561bd1e8697d15cf3320f
BLAKE2b-256 5a8d48c8b8c4f230d6694e316e51c7705aff68b82bd8e4ba9fe11c94e7ef3932

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page