{"id":1449,"library":"dep-logic","title":"Dep-Logic Python Library","description":"Dep-Logic is a Python library that provides a robust API for working with package version specifiers and dependencies, supporting logical operations (AND, OR) on them. It is currently at version 0.5.2 and sees active development with several releases per year.","status":"active","version":"0.5.2","language":"python","source_language":"en","source_url":"https://github.com/dashing-systems/dep-logic","tags":["dependency management","versioning","specifiers","packaging","logical operations"],"install":[{"cmd":"pip install dep-logic","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"from dep_logic import Specifier","symbol":"Specifier","correct":"from dep_logic import Specifier"}],"quickstart":{"code":"from dep_logic import Specifier, SpecifierSet, Dependency\n\n# Define specifiers\nspec1 = Specifier(\">=1.0.0,<2.0.0\")\nspec2 = Specifier(\"~=1.5.0\") # equivalent to >=1.5.0,==1.*,==1.5.*, <1.6.0 for a minor release\n\n# Perform logical operations\ncombined_spec_and = spec1 & spec2 # Intersection\ncombined_spec_or = spec1 | spec2  # Union\n\nprint(f\"Specifier 1: {spec1}\")\nprint(f\"Specifier 2: {spec2}\")\nprint(f\"Intersection (AND): {combined_spec_and}\")\nprint(f\"Union (OR): {combined_spec_or}\")\n\n# Check if a version satisfies a specifier\nassert combined_spec_and.contains(\"1.5.2\")\nassert not combined_spec_and.contains(\"1.0.0\")\n\n# Define a dependency\nmy_dependency = Dependency(\"my_package\", Specifier(\">=1.0.0,<2.0.0\"))\nprint(f\"Dependency: {my_dependency}\")","lang":"python","description":"This quickstart demonstrates how to create `Specifier` and `SpecifierSet` objects, perform logical AND/OR operations on them, check version containment, and define a `Dependency` object."},"warnings":[{"fix":"Consult the library's documentation or source code to find the current import path for `Specifier` and `SpecifierSet`, as they are not available directly under `dep_logic`.","message":"The `Specifier` and `SpecifierSet` classes are no longer directly importable from the top-level `dep_logic` package. The previously suggested import path `from dep_logic import Specifier` (intended for versions >=0.3.0) is no longer valid, indicating a further change or reversion.","severity":"breaking","affected_versions":">0.3.0"},{"fix":"Refactor code using `DependencySpecifier` or old `Dependency` constructors to use the new `Dependency(name, specifier)` signature.","message":"The `Dependency` API was significantly reworked. The `DependencySpecifier` class was removed, and `Dependency` now takes a `name` and `specifier` directly upon initialization.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Ensure that when creating `Dependency` objects, you always provide a `specifier` argument.","message":"The `specifier` attribute of `Dependency` objects became non-optional.","severity":"breaking","affected_versions":"<0.5.0"},{"fix":"Carefully consider the logical operation needed for your dependency constraints. Test with edge cases to ensure the combined specifier behaves as expected.","message":"Be aware of the difference between `&` (intersection/AND) and `|` (union/OR) for specifiers. Intersection requires a version to satisfy ALL combined conditions, while union requires it to satisfy ANY.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.5.2':38 'activ':41 'api':17 'current':35 'dep':2,7 'dep-log':1,6 'depend':25,48 'develop':42 'librari':5,12 'logic':3,8,27,53 'manag':49 'oper':28,54 'packag':21,52 'per':46 'provid':14 'python':4,11 'releas':45 'robust':16 'see':40 'sever':44 'specifi':23,51 'support':26 'version':22,37,50 'work':19 'year':47","created_at":"2026-04-09T03:48:25.111371+00:00","updated_at":"2026-04-16T06:12:20.527384+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'Specifier' from 'dep_logic' (/tmp/tmpw4vp8ygx/venv/lib/python3.12/site-packages/dep_logic/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.7.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/dep-logic/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-27","next_check":"2026-07-10","install_tag":"stale"}}