Skip to content
Work with environment markers (PEP-496).
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dephell_markers
tests
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
appveyor.yml
pyproject.toml
requirements-flake.txt
setup.cfg

README.md

Dephell Markers

travis appveyor MIT License

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
You can’t perform that action at this time.