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 http://codecov.io/github/pydanny/whichcraft/coverage.svg?branch=master
That code in my care
That sly command-line stare
That strips my operating system bare
It's whichcraft

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.3.0 (2016-04-24)

  • Include tests in release source tarball (@Edwardbetts)

0.2.0 (2016-04-23)

  • Python 3.5 compatability

0.1.1 (2015-09-09)

  • Added lyrics

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.3.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

whichcraft-0.3.0-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for whichcraft-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a17fb328f8e0f86f18229617ab731eafc0fc151f702c132184554a8ad5e0f483
MD5 638844efce33adcca2a8ebead9eb2166
BLAKE2b-256 ba890d752c5a8b0e9d727931edf10a242b4aabbb9c895a5236afbe1dd43b50c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for whichcraft-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 128a2b7bdf9582e708287fe7b6e1eeabae8e2fdcc87c101290f85a2c9f78f787
MD5 19cdc0d4cdfef80f509bb32a0b5ad1dc
BLAKE2b-256 dcee3aca77196aa493cf8260a6e9b2e6f25f40ec73f99513596cf2ebea8a105f

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