Work with python versions
Project description
Work with python versions.
Installation
Install from PyPI:
python3 -m pip install --user dephell_pythons
Usage
from dephell_pythons import Pythons
pythons = Pythons()
# get current:
python = pythons.get_best()
# properties:
python.name # 'python3.7'
python.path # Path('/usr/local/bin/python3.7')
python.version # <Version('3.7.0')>
python.lib_paths
# [Path('/usr/local/lib/python37.zip'), Path('/usr/local/lib/python3.7'), ...]
python.lib_path
# Path('/home/gram/.local/lib/python3.7/site-packages')
# get by version
pythons.get_best('3.5').version
# <Version('3.5.2')>
# get by name
pythons.get_best('python3').version
# <Version('3.6.7')>
# get by specifier
pythons.get_best('<3.7').version
# <Version('3.6.7')>
# get by path
pythons.get_best('/usr/bin/python3.6').version
# <Version('3.6.7')>
# get all
list(pythons)
# [Python(...), Python(...), ...]
# work not only with installed pythons:
Pythons(abstract=True).get_best('>=2.8,<3.5').version
# <Version('3.4')>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dephell_pythons-0.1.8.tar.gz
(9.7 kB
view hashes)
Built Distribution
Close
Hashes for dephell_pythons-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5364e6db1f0d65cc4f80c17c5fc33774aa4f1d3af077f632e974d3f0a06bb49 |
|
MD5 | b79410953d6bf804cd1f0fe48d950cc8 |
|
BLAKE2b-256 | ede1535586ce4b4e9bc55c703cc85663f5e3d6a7ab94a3be27014510d6201cde |