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, budget_ms=100)
td.treewidth # 2
td.bags # lists of graph vertices, one per bag
td.edges # 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,
the default;
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. For the elimination orders and the portfolio budget_ms is
a soft budget and a hard cutoff at twice it ends the construction, so such a
call can take about 2 * budget_ms, and refine=True gets its own
budget_ms on top of that.
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.
The two notice files are copied in from the repository root first, since
pyproject.toml cannot reference files above its own directory:
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.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 | Provenance | Actions |
|---|---|---|---|---|
| goatd-0.3.0.tar.gz | 1.2 MB | With provenance | Details for goatd-0.3.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| goatd-0.3.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for goatd-0.3.0-cp310-abi3-win_amd64.whl |
| goatd-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for goatd-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl |
| goatd-0.3.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for goatd-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
Total release size: 3.4 MB
Release files / goatd-0.3.0.tar.gz
| Download URL | goatd-0.3.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
773c9292498fe86d75b62360d9c2a0f14f70fb72dac86d4ab7e7a322f7488eaa
|
|
BLAKE2b-256 checksum How to use checksums |
ab3bec7e94b8d8f985ba526fe2a7b55b6aa4b6c8f93ea70c811b475662997a86
|
| 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 Oct 19, 2026.
Transparency logRelease files / goatd-0.3.0-cp310-abi3-win_amd64.whl
| Download URL | goatd-0.3.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 684.5 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
efc916aa5d643aabf1149ab549a3bb0c6d637aee8527cfd6360fd752dffe2954
|
|
BLAKE2b-256 checksum How to use checksums |
b8f6572608c4f8b2418397508abd68b220d4f4163e9a1a0a0d963bef97887857
|
| 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 Oct 19, 2026.
Transparency logRelease files / goatd-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | goatd-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 800.3 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c66f1de65d13df22597846fefd7104f25e3230884a6c119f4572ef41a9e4b9c2
|
|
BLAKE2b-256 checksum How to use checksums |
bcb89fea43ba50eacfbc277cb4fec8a9f1098422302d6ba594e6f40ac45bb1d3
|
| 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 Oct 19, 2026.
Transparency logRelease files / goatd-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | goatd-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 704.9 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ac18e47cf456d946f272e0e892df051d5399ab23efaac2045d35872a3ddb9b98
|
|
BLAKE2b-256 checksum How to use checksums |
c38b123e60bb5e5e37a564d042a6c4b7dfc9377d6f39339cb776918590cbf94a
|
| 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 Oct 19, 2026.
Transparency logSecurity for goatd 0.3.0
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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for goatd-0.3.0.tar.gz
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 Oct 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.