Skip to main content

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


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.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

dephell_markers-0.2.3-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file dephell_markers-0.2.3.tar.gz.

File metadata

  • Download URL: dephell_markers-0.2.3.tar.gz
  • Upload date:
  • Size: 6.7 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

Hashes for dephell_markers-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b908623641197108cfba5bc65f70f9e35b5d8d5da692c72bd11b7938466b6f34
MD5 6170247a701b65d1da71d60cf29b47cb
BLAKE2b-256 575dde033e2f497943b5475c040b6955d6978a21c4ca4a526c2d7a72797a50d3

See more details on using hashes here.

File details

Details for the file dephell_markers-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: dephell_markers-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 17.2 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

Hashes for dephell_markers-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a4047519884c1ea043e3c8ff934f6ea623bf289423268387ea4aa46b73dcdf2b
MD5 0550d0459635a218830257a3f1e0915d
BLAKE2b-256 50eaf082681c89b350900137800fd4f4833890dc0d583d6b4470700c13687bce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page