Skip to main content

The Soup

A collection of Python utility classes and functions.

License: GPL v2 PyPI version Python 3.9+ Docs

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 graph
    • MutableDiGraph — abstract mutable directed graph
    • AdjListGraph — adjacency-list implementation of MutableDiGraph
  • Heap

    • MinHeap
    • MaxHeap
  • Binary Trees

    • BinarySearchTree
  • Trie (ASCII only)

  • Sets

    • CountSet — set that tracks occurrence counts of repeated elements
    • DisjointSets — disjoint-set / union-find structure (Wikipedia)
  • Result

    • Result — a result type similar to Rust's Result

Functions

  • Collections

    • flatten — flatten a nested collection
    • flatten_to_tuple — flatten a nested collection, preserving tuples
    • subsequence — find all subsequences of a list
    • foreach — foreach that works on any collection
    • group_by — group a collection into a map by some criteria
  • Graph Traversals

    • bfs — breadth-first search
    • dfs — depth-first search
    • dijkstra — Dijkstra's shortest path
    • shortest_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)

Source distribution for thesoup 1.3.0
File Size Uploaded
thesoup-1.3.0.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thesoup 1.3.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.1

1 release file

1.0

1 release file

0.11

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

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