Work with environment markers (PEP-496)
Project description
Work with environment markers (PEP-496).
Installation
Install from PyPI:
python3 -m pip install --user dephell_markers
Usage
from dephell_markers import Markers
m = Markers('os_name == "posix" and python_version >= "2.7"')
m.get_version(name='python_version')
# '>=2.7'
m.get_string(name='os_name')
# 'posix'
Markers('python_version >= "2.4" or python_version <= "2.7"').get_version(name='python_version')
'<=2.7 || >=2.4'
Markers('python_version >= "2.4" or python_version <= "2.7"').python_version
# RangeSpecifier(<=2.7 || >=2.4)
# Nothing better than lie:
Markers('python_version == "2.4" or os_name == "linux"').get_version(name='python_version')
# None
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_markers-0.2.0.tar.gz
(6.2 kB
view details)
Built Distribution
File details
Details for the file dephell_markers-0.2.0.tar.gz
.
File metadata
- Download URL: dephell_markers-0.2.0.tar.gz
- Upload date:
- Size: 6.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0ec28e7fdfe138175d2b593dad98f3d35190f89c9d9c582993503593d29475b |
|
MD5 | 037e5b008c8c8db8f8607e8956e358f9 |
|
BLAKE2b-256 | e1ee0082f44c265c009d19ae76b347e4bf7652c134752504b767e8ae47822017 |
File details
Details for the file dephell_markers-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: dephell_markers-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.8 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75acff98b9ef69af7577313505b896bdd40e29afe0500daa2b1fd186bc0d40bc |
|
MD5 | 9c9563233df2713bd3aed1aa3887f09d |
|
BLAKE2b-256 | c22794565fbdf768f494a52fba332211af1f9e334d869a363abcbd57955244db |