deepset - Recursive Subset Comparison for Python
Recursive subset comparison for complex nested Python data structures. Express relationships like "this nested structure is contained within that one" naturally.
Quick Start
from deepset import deepset
# Set subsets
assert deepset({1, 2}) <= {1, 2, 3} # True
# Nested structures
assert deepset({('a', frozenset({2}))}) <= {('a', frozenset({2, 3}))} # True
# Sequential lists (order matters, gaps allowed)
assert deepset([1, 3]) <= [1, 2, 3, 4] # True
# Dictionary subsets
assert deepset({'a': 1}) <= {'a': 1, 'b': 2} # True
# Mixed nested
data1 = {'sets': {frozenset({1, 2})}, 'lists': [[1, 2]]}
data2 = {'sets': {frozenset({1, 2, 3})}, 'lists': [[1, 2, 3]]}
assert deepset(data1) <= data2 # True
Installation
pip install deepset
Comparison Types
Sets: Traditional subset semantics
assert deepset({1, 2}) < {1, 2, 3} # True (strict subset)
assert deepset({frozenset({1, 2})}) <= {frozenset({1, 2, 3})} # Recursive
Lists/Tuples: Sequential subset (order preserved, gaps allowed)
assert deepset([1, 3]) <= [1, 2, 3, 4] # True
assert not deepset([1, 3]) <= [3, 1] # False (wrong order)
Dictionaries: Key subset + recursive value comparison
assert deepset({'a': 1}) <= {'a': 1, 'b': 2} # True (extra key)
assert deepset({'a': [1, 2]}) <= {'a': [1, 2, 3]} # True (recursive)
All Operators: <, <=, ==, >=, > supported
Development
git clone https://github.com/pjkundert/python-deepset.git
cd python-deepset
# Standard development (with user provided Python, package installation)
make install-dev # Install dev dependencies
make test # Run tests
make style # Format code (autopep8, black, isort)
make build # Build package
# Nix environment (recommended for reproducible builds)
make nix-venv # Enter Nix + venv environment
make nix-venv-test # Run tests in Nix environment
make nix-venv-unit-test_name # Run specific test class
# Multi-version testing
TARGET=py310 make nix-venv-test # Test with Python 3.10
TARGET=py312 make nix-venv-test # Test with Python 3.12
License
MIT License - Perry Kundert perry@dominionrnd.com
Metadata
Release files for deepset 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deepset-1.1.0.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deepset-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / deepset-1.1.0.tar.gz
| Download URL | deepset-1.1.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77bdb3acbc483a92f5b6eac17c09d865e1ee02193b3eabc0c65b490438c6ba6a
|
|
BLAKE2b-256 checksum How to use checksums |
952dd0ed5b077ebfa6daee86085fcac5ae6c189bf97a6ae20031f9f063734255
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Jul 29, 2025.
Transparency logRelease files / deepset-1.1.0-py3-none-any.whl
| Download URL | deepset-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b01d547ed572e54a0644ee5cbd7c7961d1c4b9445004687307141da072a447f9
|
|
BLAKE2b-256 checksum How to use checksums |
0a3fcb033b4f39b58ac4ba043f73b5bf272c90a97471de514707eee8390310e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Jul 29, 2025.
Transparency log