A soup of random python utils
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
thesoup-1.3.0.tar.gz
(22.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
thesoup-1.3.0-py3-none-any.whl
(24.5 kB
view details)
File details
Details for the file thesoup-1.3.0.tar.gz.
File metadata
- Download URL: thesoup-1.3.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dd2e4e26ca0641771f73ca4ec2cb9fa4e5817d2ac6aa58da953054b83962478
|
|
| MD5 |
f603f1b103a2fd328b15ce60eaecad00
|
|
| BLAKE2b-256 |
e6a573b176d04b72898178b5e6fa068602ef4e0a25ee35a98eb959ce7ced8b33
|
File details
Details for the file thesoup-1.3.0-py3-none-any.whl.
File metadata
- Download URL: thesoup-1.3.0-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6e31d2b4169262274978aaec7832274ce41194244d885e3f1d7e011302cb349
|
|
| MD5 |
a281c129cd7d72f5edbaa43d8e3f8f9f
|
|
| BLAKE2b-256 |
a0585d314e26211082d3dcffe4fadd34e9bc892b05f4d8c4919c59f6990543a8
|