{"id":13682461,"url":"https://github.com/awslabs/aws-cfn-template-flip","last_synced_at":"2026-02-21T10:32:00.524Z","repository":{"id":37663792,"uuid":"75023443","full_name":"awslabs/aws-cfn-template-flip","owner":"awslabs","description":"Tool for converting AWS CloudFormation templates between JSON and YAML formats.","archived":false,"fork":false,"pushed_at":"2023-02-08T16:38:58.000Z","size":324,"stargazers_count":1008,"open_issues_count":3,"forks_count":139,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-12-09T23:59:08.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awslabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-11-28T23:29:17.000Z","updated_at":"2025-11-13T06:28:15.000Z","dependencies_parsed_at":"2024-02-10T21:46:15.626Z","dependency_job_id":null,"html_url":"https://github.com/awslabs/aws-cfn-template-flip","commit_stats":{"total_commits":188,"total_committers":29,"mean_commits":6.482758620689655,"dds":0.5,"last_synced_commit":"2a1b714f23eec6306c8572938aecb52a31a92f69"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/awslabs/aws-cfn-template-flip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Faws-cfn-template-flip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Faws-cfn-template-flip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Faws-cfn-template-flip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Faws-cfn-template-flip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awslabs","download_url":"https://codeload.github.com/awslabs/aws-cfn-template-flip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awslabs%2Faws-cfn-template-flip/sbom","scorecard":{"id":219541,"data":{"date":"2025-08-11","repo":{"name":"github.com/awslabs/aws-cfn-template-flip","commit":"2a1b714f23eec6306c8572938aecb52a31a92f69"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 2/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/awslabs/aws-cfn-template-flip/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/awslabs/aws-cfn-template-flip/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/awslabs/aws-cfn-template-flip/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/awslabs/aws-cfn-template-flip/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/awslabs/aws-cfn-template-flip/test.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3-alpine to python:3-alpine@sha256:c28add7bfdd8e8c0bb557f4123d73a0f3afc2f3d7972c9af021b7551658bc641","Warn: pipCommand not pinned by hash: Dockerfile:6","Warn: pipCommand not pinned by hash: Dockerfile:9","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:27","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   8 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact dist/cfn_flip-1.3.0.tar.gz not signed: https://api.github.com/repos/awslabs/aws-cfn-template-flip/releases/50951137","Warn: release artifact dist/cfn_flip-1.3.0.tar.gz does not have provenance: https://api.github.com/repos/awslabs/aws-cfn-template-flip/releases/50951137"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/awslabs/.github/SECURITY.md:1","Info: Found linked content: github.com/awslabs/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/awslabs/.github/SECURITY.md:1","Info: Found text in security policy: github.com/awslabs/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: PYSEC-2018-49 / GHSA-rprw-h62v-c2w7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T02:12:58.527Z","repository_id":37663792,"created_at":"2025-08-17T02:12:58.527Z","updated_at":"2025-08-17T02:12:58.527Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T13:01:46.366Z","updated_at":"2026-02-21T10:32:00.504Z","avatar_url":"https://github.com/awslabs.png","language":"Python","funding_links":[],"categories":["Python","Tools"],"sub_categories":[],"readme":"**NOTICE:** For CLI usage, AWS CloudFormation Template Flip is now *deprecated*.\n\nYou should use [rain](https://github.com/aws-cloudformation/rain) instead. `rain fmt` can convert CloudFormation templates between JSON and YAML.\n\nSee [the rain fmt documentation](https://aws-cloudformation.github.io/rain/rain_fmt.html) for details.\n\nThis deprecation notice does not affect the API in this package which may continue to be used.\n\n---\n\n[![Build Status](https://github.com/awslabs/aws-cfn-template-flip/actions/workflows/test.yml/badge.svg)](https://github.com/awslabs/aws-cfn-template-flip/actions/workflows/test.yml)\n[![PyPI version](https://badge.fury.io/py/cfn-flip.svg)](https://badge.fury.io/py/cfn-flip)\n[![Codecov Test Coverage](https://codecov.io/gh/awslabs/aws-cfn-template-flip/branch/master/graphs/badge.svg?style=flat)](https://codecov.io/gh/awslabs/aws-cfn-template-flip)\n\n# AWS CloudFormation Template Flip\n\n## About\n\nAWS CloudFormation Template Flip is a tool that converts [AWS CloudFormation](https://aws.amazon.com/cloudformation/) templates between [JSON](http://json.org/) and [YAML](http://yaml.org) formats, making use of the YAML format's short function syntax where possible.\n\nThe term \"Flip\" is inspired by the well-known Unix command-line tool [flip](https://ccrma.stanford.edu/~craig/utility/flip/) which converts text files between Unix, Mac, and MS-DOS formats.\n\n## Installation\n\nAWS CloudFormation Template Flip can be installed using [pip](https://pip.pypa.io/en/stable/):\n\n```bash\npip install cfn-flip\n```\n\n## Usage\n\nAWS CloudFormation Template Flip is both a command line tool and a python library.\n\nNote that the command line tool is spelled `cfn-flip` with a hyphen, while the python package is `cfn_flip` with an underscore.\n\n### Command line tool\n\n```\nUsage: cfn-flip [OPTIONS] [INPUT] [OUTPUT]\n\n  AWS CloudFormation Template Flip is a tool that converts AWS\n  CloudFormation templates between JSON and YAML formats, making use of the\n  YAML format's short function syntax where possible.\"\n\nOptions:\n  -i, --input [json|yaml]   Specify the input format. Overrides -j and -y\n                            flags.\n  -o, --output [json|yaml]  Specify the output format. Overrides -j, -y, and\n                            -n flags.\n  -j, --json                Convert to JSON. Assume the input is YAML.\n  -y, --yaml                Convert to YAML. Assume the input is JSON.\n  -c, --clean               Performs some opinionated cleanup on your\n                            template.\n  -l, --long                Use long-form syntax for functions when converting\n                            to YAML.\n  -n, --no-flip             Perform other operations but do not flip the\n                            output format.\n  --version                 Show the version and exit.\n  --help                    Show this message and exit.\n```\n\n\ncfn-flip will detect the format of the input template and convert JSON to YAML and YAML to JSON, respectively.\n\nExamples:\n\n* Reading from `stdin` and outputting to `stdout`:\n\n    ```bash\n    cat examples/test.json | cfn-flip\n    ```\n\n* Reading from a file and outputting to `stdout`:\n\n    ```bash\n    cfn-flip examples/test.yaml\n    ```\n\n* Reading from a file and outputting to another file:\n\n    ```bash\n    cfn-flip examples/test.json output.yaml\n    ```\n\n* Reading from a file and cleaning up the output\n\n    ```bash\n    cfn-flip -c examples/test.json\n    ```\n\n### Python package\n\nTo use AWS CloudFormation Template Flip from your own python projects, import one of the functions `flip`, `to_yaml`, or `to_json` as needed.\n\n```python\nfrom cfn_flip import flip, to_yaml, to_json\n\n\"\"\"\nAll functions expect a string containing serialised data\nand return a string containing serialised data\nor raise an exception if there is a problem parsing the input\n\"\"\"\n\n# flip takes a best guess at the serialisation format\n# and returns the opposite, converting json into yaml and vice versa\nsome_yaml_or_json = flip(some_json_or_yaml)\n\n# to_json expects serialised yaml as input, and returns serialised json\nsome_json = to_json(some_yaml)\n\n# to_yaml expects serialised json as input, and returns serialised yaml\nsome_yaml = to_yaml(some_json)\n\n# The clean_up flag performs some opinionated, CloudFormation-specific sanitation of the input\n# For example, converting uses of Fn::Join to Fn::Sub\n# flip, to_yaml, and to_json all support the clean_up flag\nclean_yaml = to_yaml(some_json, clean_up=True)\n```\n\n### Configuration paramters\n\nYou can configure some parameters like:\n\n`max_col_width`: Maximum columns before breakline. Default value is 200\nTo change the configuration you can use:\n\n**Environment Variable**\n\nLinux/Unix:\n`export CFN_MAX_COL_WIDTH=120`\n\nWindows: `SET CFN_MAX_COL_WIDTH=120`\n\n**Python**\n\n```python\n\nfrom cfn_tools._config import config\nfrom cfn_flip import flip, to_yaml, to_json\n\n\"\"\"\nAll functions expect a string containing serialised data\nand return a string containing serialised data\nor raise an exception if there is a problem parsing the input\n\"\"\"\n\n# Change the default number of columns to break line to 120\nconfig['max_col_width'] = \"120\"\n\n# flip takes a best guess at the serialisation format\n# and returns the opposite, converting json into yaml and vice versa\nsome_yaml_or_json = flip(some_json_or_yaml)\n\n# to_json expects serialised yaml as input, and returns serialised json\nsome_json = to_json(some_yaml)\n\n# to_yaml expects serialised json as input, and returns serialised yaml\nsome_yaml = to_yaml(some_json)\n\n# The clean_up flag performs some opinionated, CloudFormation-specific sanitation of the input\n# For example, converting uses of Fn::Join to Fn::Sub\n# flip, to_yaml, and to_json all support the clean_up flag\nclean_yaml = to_yaml(some_json, clean_up=True)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawslabs%2Faws-cfn-template-flip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawslabs%2Faws-cfn-template-flip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawslabs%2Faws-cfn-template-flip/lists"}