Skip to main content

goatd for Python

goatd logo

PyPI Python versions Wheels License: Apache-2.0

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.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 goatd 0.2.0
File Size Uploaded
goatd-0.2.0.tar.gz 1.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for goatd 0.2.0
File Interpreter ABI Platform
goatd-0.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
goatd-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
goatd-0.2.0-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.0.tar.gz

Download URL goatd-0.2.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
735bd498fcfb90f1811f1cc0e922611b43065c5954a79f093897a9276e2d5d4e
BLAKE2b-256 checksum
How to use checksums
1e545226a94f67df72e710e7b5d902ffe2c6ecebff66df45bebcdec92d073bb3
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 12, 2026.

Transparency log

Release files / goatd-0.2.0-cp310-abi3-win_amd64.whl

Download URL goatd-0.2.0-cp310-abi3-win_amd64.whl
Size 658.3 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
74d489044755f0a2b6ccd0740673cf1fecf519de2825fb6a4c4dd7b5dab3883f
BLAKE2b-256 checksum
How to use checksums
5a612a8b308f0b5c5ea3c84372030f4ca31de749544e25f054482a79697da1ad
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 12, 2026.

Transparency log

Release files / goatd-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL goatd-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 779.7 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
cf8f59e064eee092d4b1a5482a5f11b005cd4740d4fb73941fb8df5d619af444
BLAKE2b-256 checksum
How to use checksums
9e2444784764ec1267edb03d9df2bd9679207d25e672c88ee0c6eed451b62ba4
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 12, 2026.

Transparency log

Release files / goatd-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL goatd-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Size 680.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6b32c1107dd9728b52e607219a84cf402a499bfd0067c30889c06d92d30f5c3f
BLAKE2b-256 checksum
How to use checksums
f63f47274602934f0485aca47240b72a825678b3bd8b16d76912b12787a19be0
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 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

4 release files

This release

0.2.0 This release

4 release files

0.1.2

4 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