All Projects → sarugaku → pythonfinder

sarugaku / pythonfinder

Licence: MIT license
PythonFinder: Cross Platform Search Tool for Finding Pythons

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pythonfinder

wi
Installer for Python Wheels
Stars: ✭ 17 (-43.33%)
Mutual labels:  pip
EvOLuTIoN
A simple simulation in Unity, which uses genetic algorithm to optimize forces applied to cubes
Stars: ✭ 44 (+46.67%)
Mutual labels:  pathfinding
pystyle
The source of my Python library, pystyle.
Stars: ✭ 158 (+426.67%)
Mutual labels:  pip
no-manylinux
Install this package to disable manylinux wheels when dowloading from pip.
Stars: ✭ 23 (-23.33%)
Mutual labels:  pip
The-Kraken-Pathfinding
A tentacle-based pathfinding library for nonholonomic robotic vehicles
Stars: ✭ 24 (-20%)
Mutual labels:  pathfinding
lookpath
The minimum and most straightforward way to check if command exists and where the executable is, without spawning child_process.
Stars: ✭ 49 (+63.33%)
Mutual labels:  which
pip-audit
Audits Python environments and dependency trees for known vulnerabilities
Stars: ✭ 735 (+2350%)
Mutual labels:  pip
gruid
Cross-platform grid-based UI and game framework.
Stars: ✭ 67 (+123.33%)
Mutual labels:  pathfinding
xxenv-latest
This **env(pyenv, rbenv, nodenv, goenv, phpenv, luaenv) plugin replaces the version specified in the argument with the latest version.
Stars: ✭ 69 (+130%)
Mutual labels:  pyenv
django-simple-forum
full featured forum, easy to integrate and use.
Stars: ✭ 65 (+116.67%)
Mutual labels:  pip
Pathfinding Visualization
A ReactJS project visualizes the path-finding algorithms with additional cool features like speed adjustment, maze generation, mobile support, etc.
Stars: ✭ 14 (-53.33%)
Mutual labels:  pathfinding
pypi-simple
PyPI Simple Repository API client library
Stars: ✭ 21 (-30%)
Mutual labels:  pip
path planning GAN
Path Planning using Generative Adversarial Network (GAN)
Stars: ✭ 36 (+20%)
Mutual labels:  pathfinding
dotfiles
💾 personal configuration files
Stars: ✭ 42 (+40%)
Mutual labels:  pyenv
a star on grids
Best practices for implementing A* with a focus on four- and eight-connected grid worlds.
Stars: ✭ 23 (-23.33%)
Mutual labels:  pathfinding
symmetric
A powerful tool to enable super fast module-to-API transformations. Learn in minutes, implement in seconds. Batteries included.
Stars: ✭ 65 (+116.67%)
Mutual labels:  pip
django-payu
payu payment gateway integration for django projects
Stars: ✭ 37 (+23.33%)
Mutual labels:  pip
pip-download
A wrapper for pip download in offline scenario.
Stars: ✭ 22 (-26.67%)
Mutual labels:  pip
pipx
Install and Run Python Applications in Isolated Environments
Stars: ✭ 5,698 (+18893.33%)
Mutual labels:  pip
ml pathfind
Pathfind module for MTA:SA-Server
Stars: ✭ 25 (-16.67%)
Mutual labels:  pathfinding

PythonFinder: Cross Platform Search Tool for Finding Pythons

Documentation Status

Installation

Install from PyPI:

$ pipenv install pythonfinder

Install from Github:

$ pipenv install -e git+https://github.com/sarugaku/pythonfinder.git#egg=pythonfinder

Usage

Using PythonFinder is easy. Simply import it and ask for a python:

>>> from pythonfinder import Finder
>>> f = Finder()
>>> f.find_python_version(3, minor=6)
PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/3.6.5/bin/python'), _children={}, is_root=False, only_python=False, py_version=PythonVersion(major=3, minor=6, patch=5, is_prerelease=False, is_postrelease=False, is_devrelease=False, version=<Version('3.6.5')>, architecture='64bit', comes_from=PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/3.6.5/bin/python'), _children={}, is_root=True, only_python=False, py_version=None, pythons=None), executable=None), pythons=None)
>>> f.find_python_version(2)
PathEntry(path=PosixPath('/home/hawk/.pyenv/shims/python2'), ...py_version=PythonVersion(major=2, minor=7, patch=15, is_prerelease=False, is_postrelease=False, is_devrelease=False, version=<Version('2.7.15')>, architecture='64bit', comes_from=PathEntry(path=PosixPath('/home/hawk/.pyenv/shims/python2'), _children={}, is_root=True, only_python=False, py_version=None, pythons=None), executable=None), pythons=None)
>>> f.find_python_version("anaconda3-5.3.0")

Find a named distribution, such as anaconda3-5.3.0:

PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/anaconda3-5.3.0/bin/python3.7m'), _children={'/home/hawk/.pyenv/versions/anaconda3-5.3.0/bin/python3.7m': ...}, only_python=False, name='anaconda3-5.3.0', _py_version=PythonVersion(major=3, minor=7, patch=0, is_prerelease=False, is_postrelease=False, is_devrelease=False,...))

PythonFinder can even find beta releases:

>>> f.find_python_version(3, minor=7)
PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/3.7.0b1/bin/python'), _children={}, is_root=False, only_python=False, py_version=PythonVersion(major=3, minor=7, patch=0, is_prerelease=True, is_postrelease=False, is_devrelease=False, version=<Version('3.7.0b1')>, architecture='64bit', comes_from=PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/3.7.0b1/bin/python'), _children={}, is_root=True, only_python=False, py_version=None, pythons=None), executable=None), pythons=None)

>>> f.which('python')
PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/3.6.5/bin/python'), _children={}, is_root=False, only_python=False, py_version=PythonVersion(major=3, minor=6, patch=5, is_prerelease=False, is_postrelease=False, is_devrelease=False, version=<Version('3.6.5')>, architecture='64bit', comes_from=PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/3.6.5/bin/python'), _children={}, is_root=True, only_python=False, py_version=None, pythons=None), executable=None), pythons=None)

Windows Support

PythonFinder natively supports windows via both the PATH environment variable and PEP-514 compliant finder which comes by default with python 3. Usage on windows becomes:

>>> from pythonfinder import Finder
>>> f = Finder()
>>> f.find_python_version(3, minor=6)
PythonVersion(major=3, minor=6, patch=4, is_prerelease=False, is_postrelease=False, is_devrelease=False, version=<Version('3.6.4')>, architecture='64bit', comes_from=PathEntry(path=WindowsPath('C:/Program Files/Python36/python.exe'), _children={}, is_root=False, only_python=True, py_version=None, pythons=None), executable=WindowsPath('C:/Program Files/Python36/python.exe'))

>>> f.find_python_version(3, minor=7, pre=True)
PythonVersion(major=3, minor=7, patch=0, is_prerelease=True, is_postrelease=False, is_devrelease=False, version=<Version('3.7.0b5')>, architecture='64bit', comes_from=PathEntry(path=WindowsPath('C:/Program Files/Python37/python.exe'), _children={}, is_root=False, only_python=True, py_version=None, pythons=None), executable=WindowsPath('C:/Program Files/Python37/python.exe'))

>>> f.which('python')
PathEntry(path=WindowsPath('C:/Python27/python.exe'), _children={}, is_root=False, only_python=False, py_version=None, pythons=None)

Finding Executables

PythonFinder also provides which functionality across platforms, and it uses lazy loading and fast-returns to be performant at this task.

>>> f.which('cmd')
PathEntry(path=WindowsPath('C:/windows/system32/cmd.exe'), _children={}, is_root=False, only_python=False, py_version=None, pythons=None)

>>> f.which('code')
PathEntry(path=WindowsPath('C:/Program Files/Microsoft VS Code/bin/code'), _children={}, is_root=False, only_python=False, py_version=None, pythons=None)

 >>> f.which('vim')
PathEntry(path=PosixPath('/usr/bin/vim'), _children={}, is_root=False, only_python=False, py_version=None, pythons=None)

>>> f.which('inv')
PathEntry(path=PosixPath('/home/hawk/.pyenv/versions/3.6.5/bin/inv'), _children={}, is_root=False, only_python=False, py_version=None, pythons=None)

Architecture support

PythonFinder supports architecture specific lookups on all platforms:

>>> f.find_python_version(3, minor=6, arch="64")
PathEntry(path=PosixPath('/usr/bin/python3'), _children={'/usr/bin/python3': ...}, only_python=False, name='python3', _py_version=PythonVersion(major=3, minor=6, patch=7, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.6.7')>, architecture='64bit', comes_from=..., executable='/usr/bin/python3', name='python3'), _pythons=defaultdict(None, {}), is_root=False)

Integrations

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].