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.10 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.

Metadata

Release files for dep-logic 0.8.0

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.8.0
File Size Uploaded Provenance Actions
dep_logic-0.8.0.tar.gz 38.5 kB With provenance Details for dep_logic-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dep-logic 0.8.0
File Interpreter ABI Platform Actions
dep_logic-0.8.0-py3-none-any.whl Python 3 none any Details for dep_logic-0.8.0-py3-none-any.whl

Total release size: 74.7 kB

Release files / dep_logic-0.8.0.tar.gz

Download URL dep_logic-0.8.0.tar.gz
Size 38.5 kB
Tags Source
SHA-256 checksum
How to use checksums
25b8f42a512fe8ee8b11e99937b9235151b341f181aab2fa6f17557e350833ee
BLAKE2b-256 checksum
How to use checksums
1f6f3f6563cafd986ba2a4018fe3f629f4de5acaaf7a1a6cb454f84863fd4d55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Release files / dep_logic-0.8.0-py3-none-any.whl

Download URL dep_logic-0.8.0-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
269715dfcc615615d038d045f5f849576febdd552028db8a7d290a928f0571d5
BLAKE2b-256 checksum
How to use checksums
d160a65da63c363c19014ab28fb61587203dc5dbfd46396fc1c05b665ea18281
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Security for dep-logic 0.8.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dep_logic-0.8.0.tar.gz

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 Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files Full provenance

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