Skip to main content

Dep-Logic

PyPI - Version Python Version from PEP 621 TOML GitHub License

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 specifiers
  • dep_logic.markers - PEP 508 environment markers
  • dep_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)

Source distribution for dep-logic 0.7.2
File Size Uploaded
dep_logic-0.7.2.tar.gz 38.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dep-logic 0.7.2
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.7.2 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.11

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page