Skip to main content

Ganzua

[ GitHub: latk/ganzua | PyPI: ganzua | Documentation: https://ganzua.latk.de ]

Ganzua is tool for picking dependency information from Python lockfiles, and manipulating the version constraints in pyproject.toml files.

For example, we can summarize the differences between two uv.lock files. Ganzua is designed for scripting, so by default we get JSON output:

$ ganzua diff corpus/old-uv-project corpus/new-uv-project
{
  "stat": {
    "total": 2,
    "added": 1,
    "removed": 0,
    "updated": 1
  },
  "packages": [
    {
      "name": "annotated-types",
      "old": null,
      "new": {
        "name": "annotated-types",
        "version": "0.7.0",
        "source": "pypi"
      }
    },
    {
      "name": "typing-extensions",
      "old": {
        "name": "typing-extensions",
        "version": "3.10.0.2",
        "source": "pypi"
      },
      "new": {
        "name": "typing-extensions",
        "version": "4.14.1",
        "source": "pypi"
      },
      "is_major_change": true
    }
  ]
}

We can also opt in to Markdown (GFM) output, which will produce a summary and a table:

$ ganzua diff --format=markdown corpus/old-uv-project corpus/new-uv-project
2 changed packages (1 added, 1 updated)

| package           | old      | new    | notes |
|-------------------|----------|--------|-------|
| annotated-types   | -        | 0.7.0  |       |
| typing-extensions | 3.10.0.2 | 4.14.1 | (M)   |

* (M) major change

Aside from inspecting or diffing lockfiles, we can extract and manipulate constraints from pyproject.toml files:

$ ganzua constraints inspect --format=markdown corpus/new-uv-project/pyproject.toml
| package           | version |
|-------------------|---------|
| annotated-types   | >=0.7.0 |
| typing-extensions | >=4     |

For more examples and further background, see the announcement blog post.

Installation

Ganzua is available on PyPI: https://pypi.org/project/ganzua/

Recommended: run or install via the uv package manager:

  • uvx ganzua to try Ganzua without installation
  • uv tool install ganzua to install Ganzua on your machine

Alternative: run or install via the pipx tool:

  • pipx run ganzua to try Ganzua without installation
  • pipx install ganzua to install Ganzua on your machine

When invoking Ganzua in scripts or in a CI job, consider pinning or constraining a version. This prevents your scripts from breaking when Ganzua has an incompatible change. For example:

  • uvx ganzua==0.4.0 to pin an exact version
  • uvx 'ganzua>=0.4.0' to constraint to a version range (remember quotes to escape special characters like <)

To preview a bleeding-edge version without waiting for a PyPI release, you can install directly from the Ganzua repository on GitHub. For example:

  • uvx git+https://github.com/latk/ganzua.git
  • pipx run --spec git+https://github.com/latk/ganzua.git ganzua

Do not add Ganzua as a dependency to your project, instead prefer invoking Ganzua via uvx or pipx run. You can technically install Ganzua into an existing venv using tools like uv, Poetry, or Pip. But since Ganzua might require conflicting dependencies, and might even need a different Python version, this is likely to cause more problems than it solves.

Usage

Usage: ganzua [OPTIONS] COMMAND [ARGS]...

See the command line reference on the website for detailed docs on each subcommand:

Support

Ganzua is Open Source software, provided to you free of charge and on an "as is" basis. You are not entitled to support, help, or bugfixes of any kind.

Nevertheless, the Ganzua project may occasionally offer help.

Ganzua intends to maintain a backwards-compatible command line interface, and intends to use SemVer version numbers.

Only those parts of the CLI that are relevant for scripting are covered by this stability policy:

  • commands that inspect or modify files
  • machine-readable output, e.g. the schema of JSON output

For example, Ganzua might increment the "minor" version number if a new field is added to JSON output or if new command line options are added, and increment the "major" version if output fields are removed or new required command line arguments are added.

Out of scope are:

  • interacting with the ganzua Python module
  • Python versions or dependency versions used by Ganzua
  • formatting of human-readable output (e.g. Markdown)
  • formatting of error messages
  • commands and flags that relate to help messages

What does Ganzua mean?

The Spanish term ganzúa means lockpick. It is pronounced gan-THU-a.

This ganzua tool for interacting with Python dependency lockfiles is unrelated to the 2004 cryptoanalysis tool of the same name.

What makes Ganzua special?

Ganzua is not a general-purpose tool. It's focused solely on working with two modern Python project managers, uv and Poetry, and their native lockfile formats. In particular, there's no support for requirements.txt.

Ganzua strives to be complete, compliant, and correct. Ganzua is 0% AI and 100% human expertise, informed by reading the relevant PEPs, docs, and the source code of relevant tools. The tool is thoroughly tested with 100% branch coverage, and has seen extensive use in large-scale real-world projects. Ganzua is intentionally stupid and avoids dangerous stuff like editing lockfiles or interacting with Git.

Ganzua is designed for scripting. All subcommands are designed for JSON output first, with output that conforms to a stable schema. Where appropriate, Ganzua offers an optional Markdown view on the same data, which lets scripts generate human-readable summaries. Ganzua does not offer GitHub Actions, but it's really easy to integrate Ganzua into your CI workflows.

License

Copyright 2025 Lukas Atkinson

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Metadata

Release files for ganzua 0.4.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 ganzua 0.4.0
File Size Uploaded
ganzua-0.4.0.tar.gz 52.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ganzua 0.4.0
File Interpreter ABI Platform
ganzua-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 103.2 kB

Release files / ganzua-0.4.0.tar.gz

Download URL ganzua-0.4.0.tar.gz
Size 52.2 kB
Tags Source
SHA-256 checksum
How to use checksums
201a92ed6c1e5dcafda8722fa037908e333f7b762d217f2b399b6985011dc762
BLAKE2b-256 checksum
How to use checksums
931c9dd6254510f0368a0e86203249f102507a4b2e066c6aba70c5a589c36135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 11, 2026.

Transparency log

Release files / ganzua-0.4.0-py3-none-any.whl

Download URL ganzua-0.4.0-py3-none-any.whl
Size 51.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5538dcb8c6b36b2d7020e3fce6f4a64cdf27d2dd5f903ab902367fe33c703da
BLAKE2b-256 checksum
How to use checksums
fb3ed853ac2ab36c6fdd3f6c913cd465236ecab50b334e6c51a3a5e2383c1d0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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