Skip to main content

A Python package that provides cross-platform Unicode executable path resolution. Like Unix `which` command but better.

Project description

find-unicode-executable

A Python package that provides cross-platform Unicode executable path resolution. Like Unix which command but better.

Features

  • Compatibility - Python 2+, Windows and Unix-like systems supported
  • Generator-based - finds all matching executables, not just the first one
  • Thread-safe - no global state
  • Supports multi-call binaries - DOES NOT follow symlinks to canonical paths (that would mess up argv[0] passed to multi-call binaries)

Installation

pip install find-unicode-executable

Usage Example

# coding=utf-8
from __future__ import print_function
from find_unicode_executable import find_unicode_executable

# Find all Python executables in resolution order
# Sample output on Linux:
# /home/user/miniconda3/bin/python3.12
# /usr/bin/python3.10
# /usr/bin/python3.10
# Sample output on Windows:
# C:\Python38\python.exe
# C:\Python27\python.exe
for executable_path in find_unicode_executable(u'python'):
    print(executable_path)

Windows-Specific Features

On Windows, the package automatically handles:

  • PATHEXT environment variable (.exe, .bat, etc.)
  • Current directory checking (Windows behavior)
  • Case-insensitive matching

Comparison to Alternatives

Feature find-unicode-executable shutil.which Unix which
Multiple results ✅ Yes ❌ No ❌ No
Windows PATHEXT ✅ Yes ✅ Yes ❌ No
Thread-safe ✅ Yes ✅ Yes ❌ No
Follows symlinks ✅ Yes ❌ No ❌ No
Current dir (Windows) ✅ Yes ❌ No ❌ No

Why Use This Package?

  1. When you need all matches, not just the first one
  2. For consistent behavior across platforms
  3. When you need proper Windows executable resolution
  4. For thread-safe executable finding
  5. When you want to follow symlinks to real paths

Contributing

Contributions welcome! Please open issues or pull requests on GitHub.

License

This project is licensed under the MIT License.

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

find_unicode_executable-0.1.0a2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

find_unicode_executable-0.1.0a2-py2.py3-none-any.whl (4.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file find_unicode_executable-0.1.0a2.tar.gz.

File metadata

File hashes

Hashes for find_unicode_executable-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 b2ead0391cb132820bc5ac60ccdf4dcc048aaf3968a62ba6299b9596255d35ff
MD5 376956cc8f547249efa4abf6569e891a
BLAKE2b-256 0468ccfe916c4294bac5df5f7df3a0c786d076762afc4133d812737932fe473f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for find_unicode_executable-0.1.0a2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 17327898e495cee611c6cc66a523709130222cc1471a1598288657f71591cae5
MD5 d4996160a5bbca9eea14ae7746eed9cf
BLAKE2b-256 1f34d8e937b377136c15281ce9b1cf24d21d83af2f143d4fdfcba4b271db9cea

See more details on using hashes here.

Supported by

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