# Dephell Pythons
[![travis](https://travis-ci.org/dephell/dephell_pythons.svg?branch=master)](https://travis-ci.org/dephell/dephell_pythons)
[![appveyor](https://ci.appveyor.com/api/projects/status/github/dephell/dephell_pythons?svg=true)](https://ci.appveyor.com/project/orsinium/dephell-pythons)
[![MIT License](https://img.shields.io/pypi/l/dephell-pythons.svg)](https://github.com/dephell/dephell_pythons/blob/master/LICENSE)
Work with python versions.
## Installation
Install from [PyPI](https://pypi.org/project/dephell-pythons/):
```bash
python3 -m pip install --user dephell_pythons
```
## Usage
```python
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')>
```
Raw data
{
"_id": null,
"home_page": "",
"name": "dephell-pythons",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "dephell,python,pythons,interpreter,pyenv,asdf,pip,pipenv",
"author": "Gram",
"author_email": "mail@orsinium.dev",
"download_url": "https://files.pythonhosted.org/packages/6d/fa/d0a59abf5b4b30445efb13ea3168a0f2b0371f156adcc17d80bacceb9c10/dephell_pythons-0.1.15.tar.gz",
"platform": "None",
"description": "# Dephell Pythons\n\n\n[![travis](https://travis-ci.org/dephell/dephell_pythons.svg?branch=master)](https://travis-ci.org/dephell/dephell_pythons)\n[![appveyor](https://ci.appveyor.com/api/projects/status/github/dephell/dephell_pythons?svg=true)](https://ci.appveyor.com/project/orsinium/dephell-pythons)\n[![MIT License](https://img.shields.io/pypi/l/dephell-pythons.svg)](https://github.com/dephell/dephell_pythons/blob/master/LICENSE)\n\nWork with python versions.\n\n## Installation\n\nInstall from [PyPI](https://pypi.org/project/dephell-pythons/):\n\n```bash\npython3 -m pip install --user dephell_pythons\n```\n\n## Usage\n\n```python\nfrom dephell_pythons import Pythons\n\npythons = Pythons()\n\n# get current:\npython = pythons.get_best()\n\n# properties:\npython.name # 'python3.7'\npython.path # Path('/usr/local/bin/python3.7')\npython.version # <Version('3.7.0')>\n\npython.lib_paths\n# [Path('/usr/local/lib/python37.zip'), Path('/usr/local/lib/python3.7'), ...]\n\npython.lib_path\n# Path('/home/gram/.local/lib/python3.7/site-packages')\n\n# get by version\npythons.get_best('3.5').version\n# <Version('3.5.2')>\n\n# get by name\npythons.get_best('python3').version\n# <Version('3.6.7')>\n\n# get by specifier\npythons.get_best('<3.7').version\n# <Version('3.6.7')>\n\n# get by path\npythons.get_best('/usr/bin/python3.6').version\n# <Version('3.6.7')>\n\n# get all\nlist(pythons)\n# [Python(...), Python(...), ...]\n\n# work not only with installed pythons:\nPythons(abstract=True).get_best('>=2.8,<3.5').version\n# <Version('3.4')>\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Work with python versions",
"version": "0.1.15",
"project_urls": {
"Repository": "https://github.com/dephell/dephell_pythons"
},
"split_keywords": [
"dephell",
"python",
"pythons",
"interpreter",
"pyenv",
"asdf",
"pip",
"pipenv"
],
"urls": [
{
"comment_text": "None",
"digests": {
"blake2b_256": "d9bad48125f7c0885d3c37773085b91383bac797b223c33283663f1aed07c5c6",
"md5": "a5963ebf3e28df5024f1418cb7d8b293",
"sha256": "03132d083d0369683b87d03767dc0f0f88b8d92d5cf19cfdb36d8845b70ecdb2"
},
"downloads": -1,
"filename": "dephell_pythons-0.1.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a5963ebf3e28df5024f1418cb7d8b293",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 14185,
"upload_time": "2020-05-28T14:36:19",
"upload_time_iso_8601": "2020-05-28T14:36:19.541468Z",
"url": "https://files.pythonhosted.org/packages/d9/ba/d48125f7c0885d3c37773085b91383bac797b223c33283663f1aed07c5c6/dephell_pythons-0.1.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "None",
"digests": {
"blake2b_256": "6dfad0a59abf5b4b30445efb13ea3168a0f2b0371f156adcc17d80bacceb9c10",
"md5": "28de153d24f1e65bbaf5ab97e12082e4",
"sha256": "804c29afa2147322aa23e791f591d0204fd1e9983afa7d91e1d1452fc7be1c5c"
},
"downloads": -1,
"filename": "dephell_pythons-0.1.15.tar.gz",
"has_sig": false,
"md5_digest": "28de153d24f1e65bbaf5ab97e12082e4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11544,
"upload_time": "2020-05-28T14:36:17",
"upload_time_iso_8601": "2020-05-28T14:36:17.593956Z",
"url": "https://files.pythonhosted.org/packages/6d/fa/d0a59abf5b4b30445efb13ea3168a0f2b0371f156adcc17d80bacceb9c10/dephell_pythons-0.1.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-05-28 14:36:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dephell",
"github_project": "dephell_pythons",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"appveyor": true,
"lcname": "dephell-pythons"
}