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.4.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for dephell_markers-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5de97c8d4e64c5bb814a78baac7292a71bf68c40929a4e789c1355a0ebd1d71d |
|
MD5 | c0f906e35412626f429a8788f8dca494 |
|
BLAKE2b-256 | 591b0cd266dc8102baea2a58039dcd7f7a0dd74e04c2e864b4fa162808e584c9 |