Skip to main content

Work with environment markers (PEP-496)

Project description

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

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

Uploaded Source

Built Distribution

dephell_markers-1.0.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dephell_markers-1.0.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for dephell_markers-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e1bb888094d2d3fbc0b63e1fe7a13101e8445b682441b293000a0d262d3deb3c
MD5 0b1165e8d4241b489d8d9735d2f55349
BLAKE2b-256 dabf89e46ab8f776c9f21ee7d1b0a7701a89fc9512cc54ad9f364a0c7936ada6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dephell_markers-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for dephell_markers-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0371c03ca2902758d3a11c2809083c164937db874c32e51e385ff30934a12e17
MD5 9d3a7d807cceb32f764460c9771053b0
BLAKE2b-256 898b770bfa5ab0d29c384226451fe376e72267c2ef20baddb01b6ec2640b39b4

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