goatd for Python
Python bindings for goatd, built with PyO3 and maturin.
Install
pip install goatd
Wheels cover CPython 3.10 and later on Linux x86-64, macOS arm64 and Windows x64. Anywhere else, pip builds from the source distribution, which needs a Rust toolchain and a C++20 compiler.
Use
import goatd
graph = goatd.Graph(4, [(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)])
td = goatd.decompose(graph, order="portfolio", budget_ms=100)
td.treewidth # 2
td.bags # [[0, 1, 2], [0, 2, 3], [0, 3], [3]]
td.edges # [(0, 1), (1, 2), (2, 3)] — pairs of positions in td.bags
td.validate(graph) # raises goatd.Error if td does not decompose graph
print(td.to_td()) # PACE .td text
Options and formats
decompose takes the solver's knobs under the solver's names: order is one
of minfill, mindegree, nested-dissection, flowcutter and portfolio;
seed breaks ties; ties="sample" and weights control weighted sampling for
the two greedy orders; steps gives flowcutter a repeatable step budget in
place of a clock; refine=True re-cuts the result along FlowCutter separators.
An argument the chosen order cannot act on raises ValueError naming both.
Budgets are milliseconds, so the name is budget_ms rather than the command
line's --budget.
goatd.Graph.from_gr and TreeDecomposition.from_td read the PACE formats;
to_gr and to_td write them.
goatd is single-threaded. The interpreter lock is released for the whole of a solve, so a caller can decompose several graphs at once from Python threads.
Building from source
The extension builds the goatd sources in the repository, so it needs a Rust toolchain, a C++20 compiler for the vendored FlowCutter, and maturin.
PEP 639 resolves license-files against the directory holding
pyproject.toml and forbids .., so the two notice files are copied in from
the repository root first rather than kept here in a second copy:
mkdir -p bindings/python/notices
cp LICENSE docs/THIRD-PARTY.md bindings/python/notices/
pip install maturin
maturin build --release --manifest-path bindings/python/Cargo.toml
maturin develop installs the extension into the active virtualenv for
pytest bindings/python/tests.
Metadata
Release files for goatd 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| goatd-0.2.1.tar.gz | 1.2 MB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| goatd-0.2.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| goatd-0.2.1-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| goatd-0.2.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 3.3 MB
Release files / goatd-0.2.1.tar.gz
| Download URL | goatd-0.2.1.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3bd14a60818a1c557c11140e542df6f235a2a36989c0c72522e176e373c5960
|
|
BLAKE2b-256 checksum How to use checksums |
0e9810211469a70df69e8a994ce26996da0e53618ace73d41e34980a106cb74d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 14, 2026.
Transparency logRelease files / goatd-0.2.1-cp310-abi3-win_amd64.whl
| Download URL | goatd-0.2.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 673.4 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
024c3623f2868be38746be01eeaba33124841090c86a5ebfcc4e8b1f1fb17d6c
|
|
BLAKE2b-256 checksum How to use checksums |
36a18c43fa204dc1156f224b5ec983b3b2b83f78f369c510c073e9c9fff9e5c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 14, 2026.
Transparency logRelease files / goatd-0.2.1-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | goatd-0.2.1-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 791.5 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
41237c23bb41ef439b4a4448f5edee4ac2223665b5e6bbb4e43d0f7ef7d87e32
|
|
BLAKE2b-256 checksum How to use checksums |
7cb1a53160e7cf10ff7aa653bcb1fcfe785324126084652690221a876da2855c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 14, 2026.
Transparency logRelease files / goatd-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | goatd-0.2.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 694.1 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d157c543799368f4937317864f698b803a4f986b0c3904b06a3a42bfab046037
|
|
BLAKE2b-256 checksum How to use checksums |
9222b54397801a5e8115cb59fe27e48131c1589f25c00cc3c4b80cc500b1b1e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 14, 2026.
Transparency log