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-1.0.3.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for dephell_markers-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54ad6807b087d6c9171efc2d94eda3a9e3cad7ea2ca4b27186789d455a6c730a |
|
MD5 | 706db173800084b61c717c7b18428073 |
|
BLAKE2b-256 | dae436df3acf05d258dcfdcaa1d11270572a1d22a1968bd8455b591ecbe46ec1 |