Skip to main content

goldie

A humble library greasing the gears of golden file tests.

Installation

pip install goldie

Example

This is an example of how to use goldie to test a script across multiple JSON files. The golden files will be used as a reference to compare the output of the script. Adding GOLDIE_UPDATE=1 to the environment variables will update the golden files with the output of the script. Find the full example in the example directory.

import unittest

import goldie


class TestExample(unittest.TestCase):
    def test_script(self):
        config = goldie.ConfigDirectoryTest(
            # We want to test all JSON files in the data directory.
            file_filter="data/*.json",
            config_file_test=goldie.ConfigFileTest(
                run_configuration=goldie.ConfigRun(
                    # We simply run the script in this directory.
                    cmd="python",
                    args=["script.py"],
                    # The script reads from stdin and writes to stdout.
                    input_mode=goldie.InputMode.STDIN,
                    output_mode=goldie.OutputMode.STDOUT,
                ),
                comparison_configuration=goldie.ConfigComparison(
                    # We want to leverage the JSON structure instead of comparing raw strings.
                    comparison_type=goldie.ComparisonType.JSON,
                    json_processing_config=goldie.ConfigProcessJson(
                        replacements=[
                            # We want to replace an unstable value with a stable one.
                            goldie.JsonReplacement(path="data.random", value=3),
                        ],
                    ),
                ),
            ),
        )
        goldie.testing.run_directory_unittest(self, config)


if __name__ == "__main__":
    unittest.main()

Metadata

Release files for goldie 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for goldie 0.1.10
File Size Uploaded Provenance Actions
goldie-0.1.10.tar.gz 16.9 kB With provenance Details for goldie-0.1.10.tar.gz

Built distribution (wheel)

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

Total release size: 34.4 kB

Release files / goldie-0.1.10.tar.gz

Download URL goldie-0.1.10.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
031b6ecc754c3591732d12ac37a7e296b83a228a81af36b98a5ed63c2e2e3ce6
BLAKE2b-256 checksum
How to use checksums
81d573feb96ad77ec79803b5e5dca9f213ce25a344df67ec156fde126555222c
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 13, 2026.

Transparency log

Release files / goldie-0.1.10-py3-none-any.whl

Download URL goldie-0.1.10-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ddc8628c0a8d6ccb43b92c4a97b14406b58d8ab607e26aa52d28862a5febe38
BLAKE2b-256 checksum
How to use checksums
ceb3f02ccb7889f170567a06473489247373d669b2a9e3b01cf7682942543065
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 13, 2026.

Transparency log

Security for goldie 0.1.10

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for goldie-0.1.10.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 13, 2026.

Transparency log

A 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.

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