{"id":21971293,"url":"https://github.com/eldada/yaml-to-properties","last_synced_at":"2025-04-28T11:46:20.954Z","repository":{"id":48201921,"uuid":"334447842","full_name":"eldada/yaml-to-properties","owner":"eldada","description":"A bash script using  yq (https://github.com/mikefarah/yq) to convert a yaml file (or a part of it) to a properties file","archived":false,"fork":false,"pushed_at":"2022-11-28T07:11:16.000Z","size":11,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T09:21:52.208Z","etag":null,"topics":["bash","yaml","yq"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-30T15:39:40.000Z","updated_at":"2024-09-05T12:23:37.000Z","dependencies_parsed_at":"2022-08-31T12:03:05.396Z","dependency_job_id":null,"html_url":"https://github.com/eldada/yaml-to-properties","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fyaml-to-properties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fyaml-to-properties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fyaml-to-properties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fyaml-to-properties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldada","download_url":"https://codeload.github.com/eldada/yaml-to-properties/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251309154,"owners_count":21568754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bash","yaml","yq"],"created_at":"2024-11-29T14:49:54.073Z","updated_at":"2025-04-28T11:46:20.937Z","avatar_url":"https://github.com/eldada.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NOTICE\n**As of `yq` version 4.12, there is a built-in [Yaml to Properties](https://mikefarah.gitbook.io/yq/v/v4.x/usage/properties) support.**\u003cbr\u003e\nIt (almost) covers all capabilities of `yaml-to-properties.sh`.\n\n# Yaml to Properties\nConvert a YAML formatted file to a flat properties file with a bash script and the [yq](https://github.com/mikefarah/yq) utility\u003cbr\u003e\n**NOTES:**\n* You must have [yq v4](https://github.com/mikefarah/yq/releases) installed!\n* You should use a valid yaml formatted file as input\n\n## Usage\n```shell script\n# Get usage\n./yaml-to-properties.sh --help\n\n# Convert all elements in file\n./yaml-to-properties.sh --file ./examples/simple.yaml\n```\n\n## Examples\n### Simple YAML\nFor the [simple.yaml](examples/simple.yaml) file with the following\n```\na:\n  key1: \"value1\"\n  key2: 2.6\n  ab:\n    key1: 6\n    key2: \"h\"\nb:\n  emptyKey:\n\n```\nYou get\n```shell script\n$ ./yaml-to-properties.sh --file ./examples/simple.yaml\na.key1=value1\na.key2=2.6\na.ab.key1=6\na.ab.key2=h\nb.emptyKey=\n\n```\n\n### Arrays YAML\nFor the [arrays.yaml](examples/arrays.yaml) file with the following\n```\na:\n  array:\n    - name: \"element1\"\n      value: \"value1\"\n    - name: \"element2\"\n      value: \"value2\"\n      sub-array:\n        - sub1: \"x\"\n        - sub2: \"y\"\n        - sub3: \"z\"\nb:\n  emptyArray: []\nc:\n  emptyMap: {}\n\n```\nYou get\n```shell script\n$ ./yaml-to-properties.sh --file ./examples/arrays.yaml\na.array.0.name=element1\na.array.0.value=value1\na.array.1.name=element2\na.array.1.value=value2\na.array.1.sub-array.0.sub1=x\na.array.1.sub-array.1.sub2=y\na.array.1.sub-array.2.sub3=z\nb.emptyArray=\nc.emptyMap=\n\n```\n\n## Contribute\nContributing is more than welcome with a pull request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fyaml-to-properties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldada%2Fyaml-to-properties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fyaml-to-properties/lists"}