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

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.1
File Size Uploaded Provenance Actions
dep_logic-0.8.1.tar.gz 39.8 kB With provenance Details for dep_logic-0.8.1.tar.gz

Built distribution (wheel)

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

Total release size: 76.6 kB

Release files / dep_logic-0.8.1.tar.gz

Download URL dep_logic-0.8.1.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9ef9525860653240750981bb0eb4859fd16c91fa10e1ad763a050dcec99c605f
BLAKE2b-256 checksum
How to use checksums
d8ab599798616831b8a04708c3d96eb70fd8847aeacd8c45cb11daa31221c88c
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 30, 2026.

Transparency log

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

Download URL dep_logic-0.8.1-py3-none-any.whl
Size 36.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46f8423a20f67fc829597cf99131763e8d38211b91870c941382253963236c2d
BLAKE2b-256 checksum
How to use checksums
910c86089156996462ec7559ac514fae4cb331306951aabd05bddcd279b872cf
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 30, 2026.

Transparency log

Security for dep-logic 0.8.1

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.1.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 30, 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.1 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