The Soup
A collection of Python utility classes and functions.
Full API documentation is available at sigabrtio.github.io/thesoup.
Installation
From PyPI
pip install thesoup
From source
git clone https://github.com/sigabrtio/thesoup.git
cd thesoup
pip install .
To run the tests:
pip install -e ".[test]"
python -m nose2 --start-dir tst
Components
Classes
-
Graphs
DiGraph— abstract directed graphMutableDiGraph— abstract mutable directed graphAdjListGraph— adjacency-list implementation ofMutableDiGraph
-
Heap
MinHeapMaxHeap
-
Binary Trees
BinarySearchTree
-
Trie (ASCII only)
-
Sets
CountSet— set that tracks occurrence counts of repeated elementsDisjointSets— disjoint-set / union-find structure (Wikipedia)
-
Result
Result— a result type similar to Rust'sResult
Functions
-
Collections
flatten— flatten a nested collectionflatten_to_tuple— flatten a nested collection, preserving tuplessubsequence— find all subsequences of a listforeach— foreach that works on any collectiongroup_by— group a collection into a map by some criteria
-
Graph Traversals
bfs— breadth-first searchdfs— depth-first searchdijkstra— Dijkstra's shortest pathshortest_path_dag— specialised shortest path for DAGs
-
Strings
is_anagram— test if two strings are anagrams
-
Other
merge— k-way merge
Release files for thesoup 1.3.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 | |
|---|---|---|---|
| thesoup-1.3.0.tar.gz | 22.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| thesoup-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.4 kB
Release files / thesoup-1.3.0.tar.gz
| Download URL | thesoup-1.3.0.tar.gz |
|---|---|
| Size | 22.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0dd2e4e26ca0641771f73ca4ec2cb9fa4e5817d2ac6aa58da953054b83962478
|
|
BLAKE2b-256 checksum How to use checksums |
e6a573b176d04b72898178b5e6fa068602ef4e0a25ee35a98eb959ce7ced8b33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / thesoup-1.3.0-py3-none-any.whl
| Download URL | thesoup-1.3.0-py3-none-any.whl |
|---|---|
| Size | 24.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6e31d2b4169262274978aaec7832274ce41194244d885e3f1d7e011302cb349
|
|
BLAKE2b-256 checksum How to use checksums |
a0585d314e26211082d3dcffe4fadd34e9bc892b05f4d8c4919c59f6990543a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|