Dep-Logic
Python dependency specifications supporting logical operations
Installation
pip install dep-logic
This library requires Python 3.9 or later.
Currently, it contains two sub-modules:
dep_logic.specifier- a module for parsing and calculating PEP 440 version specifiers.dep_logic.markers- a module for parsing and calculating PEP 508 environment markers.
What does it do?
This library allows logic operations on version specifiers and environment markers.
For example:
>>> from dep_logic.specifiers import parse_version_specifier
>>>
>>> a = parse_version_specifier(">=1.0.0")
>>> b = parse_version_specifier("<2.0.0")
>>> print(a & b)
>=1.0.0,<2.0.0
>>> a = parse_version_specifier(">=1.0.0,<2.0.0")
>>> b = parse_version_specifier(">1.5")
>>> print(a | b)
>=1.0.0
For markers:
>>> from dep_logic.markers import parse_marker
>>> m1 = parse_marker("python_version < '3.8'")
>>> m2 = parse_marker("python_version >= '3.6'")
>>> print(m1 & m2)
python_version < "3.8" and python_version >= "3.6"
About the project
This project is based on @sdispater's poetry-core code, but it includes additional packages and a lark parser, which increases the package size and makes it less reusable.
Furthermore, poetry-core does not always comply with PEP-508. As a result, this project aims to offer a lightweight utility for dependency specification logic using PyPA's packaging.
Submodules:
dep_logic.specifiers- PEP 440 version specifiersdep_logic.markers- PEP 508 environment markersdep_logic.tags- PEP 425 platform tags
Caveats
Logic operations with ===<string> specifiers is partially supported.
Release files for dep-logic 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dep_logic-0.7.2.tar.gz | 38.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dep_logic-0.7.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.1 kB
Release files / dep_logic-0.7.2.tar.gz
| Download URL | dep_logic-0.7.2.tar.gz |
|---|---|
| Size | 38.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a3c49526075b0bc6825f0ea8c2d9f464de48b7b85f3f3d2900b4e5950fefedf
|
|
BLAKE2b-256 checksum How to use checksums |
1b7aac7db322bfc792c237e059e0b048e8e0784eb624d0447e3cf5e231323725
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency logRelease files / dep_logic-0.7.2-py3-none-any.whl
| Download URL | dep_logic-0.7.2-py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33640c4ba7fd45f2504442eb9e0c12e57dac253c748ca3925749548a5c556bae
|
|
BLAKE2b-256 checksum How to use checksums |
d071e6979663eb7feaab2a2fcd3a004c0fc33b2a5d0ebafc4c474000b2be6732
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency log