Skip to main content

Work with python versions

Project description

travis appveyor MIT License

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


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 details)

Uploaded Source

Built Distribution

dephell_pythons-0.1.8-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file dephell_pythons-0.1.8.tar.gz.

File metadata

  • Download URL: dephell_pythons-0.1.8.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for dephell_pythons-0.1.8.tar.gz
Algorithm Hash digest
SHA256 5ad7dfaff4cd7e5e5a5147dfc233858f893435031ed3db84ede285c4d740d236
MD5 d3f8bd9351d2f91bdd81e8bae16bd8c4
BLAKE2b-256 aa8cc8c505e3f0a7563991feebc8e2f27809e56045463996afdb5799636b8fb5

See more details on using hashes here.

File details

Details for the file dephell_pythons-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: dephell_pythons-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for dephell_pythons-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f5364e6db1f0d65cc4f80c17c5fc33774aa4f1d3af077f632e974d3f0a06bb49
MD5 b79410953d6bf804cd1f0fe48d950cc8
BLAKE2b-256 ede1535586ce4b4e9bc55c703cc85663f5e3d6a7ab94a3be27014510d6201cde

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