Skip to main content

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

Project description

https://badge.fury.io/py/whichcraft.svg https://travis-ci.org/pydanny/whichcraft.svg?branch=master https://codecov.io/gh/pydanny/whichcraft/branch/master/graph/badge.svg https://ci.appveyor.com/api/projects/status/v9coijayykhkeu4d?svg=true Code style: black
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.7 or any of the maintained 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.5.2 (2018-10-09)

  • Remove any mention of 3.2 and 3.3

0.5.1 (2018-10-09)

  • Fix setup.py so it works with older Python

0.5.0 (2018-10-09)

  • Add 3.7 support thanks to @rooterkyberian

  • Remove any mention of 2.6

0.4.2 (2018-04-16)

  • Use black for code formatting

  • Move status to production/stable

  • Drop Python 2.6 and 3.3 support

0.4.1 (2017-04-25)

  • Added tests to support Python 3.6

0.3.1 (2016-05-10)

  • Now testing for which directly, so we can support versions of Python 3 before 3.3 (@nickcoghlan)

0.3.1 (2016-04-24)

  • Correcting version in whichcraft.py

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

Uploaded Source

Built Distribution

whichcraft-0.5.2-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: whichcraft-0.5.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for whichcraft-0.5.2.tar.gz
Algorithm Hash digest
SHA256 fecddd531f237ffc5db8b215409afb18fa30300699064cca4817521b4fc81815
MD5 392e4f76c597af547f6e3a365bfce0d9
BLAKE2b-256 4cfd276b0aedbc20ad6689bc671ecf00b32deb3ebf181e1ce6da10726c58a79f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: whichcraft-0.5.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for whichcraft-0.5.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7533870f751901a0ce43c93cc9850186e9eba7fe58c924dfb435968ba9c9fa4e
MD5 adcfdbb8d90ceed9013b92e4affae470
BLAKE2b-256 abc6eb4d1dfbb68168bb01c4394420e5e71d5851e64b910838aa0f14ebd5c7a0

See more details on using hashes here.

Provenance

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