{"id":15629576,"url":"https://github.com/pyaillet/placeholder","last_synced_at":"2025-06-14T14:38:51.791Z","repository":{"id":64304931,"uuid":"177157577","full_name":"pyaillet/placeholder","owner":"pyaillet","description":"Minimal project used to handle placeholders in files","archived":false,"fork":false,"pushed_at":"2019-06-27T07:42:53.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T18:15:15.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyaillet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-22T14:43:47.000Z","updated_at":"2019-06-27T07:42:54.000Z","dependencies_parsed_at":"2023-01-15T10:15:50.932Z","dependency_job_id":null,"html_url":"https://github.com/pyaillet/placeholder","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/pyaillet/placeholder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaillet%2Fplaceholder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaillet%2Fplaceholder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaillet%2Fplaceholder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaillet%2Fplaceholder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyaillet","download_url":"https://codeload.github.com/pyaillet/placeholder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaillet%2Fplaceholder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259833396,"owners_count":22918911,"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":[],"created_at":"2024-10-03T10:27:39.887Z","updated_at":"2025-06-14T14:38:51.762Z","avatar_url":"https://github.com/pyaillet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# placeholder\n\n[![Build Status](https://travis-ci.org/pyaillet/placeholder.svg?branch=master)](https://travis-ci.org/pyaillet/placeholder)\n[![codecov](https://codecov.io/gh/pyaillet/placeholder/branch/master/graph/badge.svg)](https://codecov.io/gh/pyaillet/placeholder)\n\nMinimal project used to handle placeholders in files\n\n## Description\n\nThe goal of this project is to provide a simple tool to replace placeholders\nin files with values either from json, yaml, property files or from the\nenvironment.\nA placeholder is made from a prefix, a suffix and a key identifier matching\nthis regex: `[A-Za-z][A-Za-z0-9_]*`.\n\nIt's also possible to list keys identified in one or more files by using the\ncommand: `placeholder -s '{{' -e '}}' list *.templates`.\n\nWhen a key is identified but no corresponding value is provided the program\nexits with an error.\n\n## Usage examples\n\n### With json\n\n```shell\n$ cat template.file\nThis is a simple template file containing a \u003cKEY\u003e placeholder surrounded with\n'${' and '}' which will be replaced by the value contained in a value file.\n\nThe key value is ${KEY}\n```\n```shell\n$ cat values.json\n{\n  \"KEY\": \"value from json\"\n}\n```\n```shell\n$ placeholder replace -i values.json template.file\n```\n```shell\n$ cat template.file\nThis is a simple template file containing a \u003cKEY\u003e placeholder surrounded with\n'${' and '}' which will be replaced by the value contained in a value file.\n\nThe key value is value from json\n```\n\n### With yaml\n\n```shell\n$ cat values.yaml\nKEY: value from yaml\n```\n```shell\n$ placeholder replace -i values.yaml template.file\n```\n```shell\n$ cat template.file\nThis is a simple template file containing a \u003cKEY\u003e placeholder surrounded with\n'${' and '}' which will be replaced by the value contained in a value file.\n\nThe key value is value from yaml\n```\n\n### With properties\n\n```shell\n$ cat values.properties\nKEY=value from properties\n```\n```shell\n$ placeholder replace -i values.properties template.file\n```\n```shell\n$ cat template.file\nThis is a simple template file containing a \u003cKEY\u003e placeholder surrounded with\n'${' and '}' which will be replaced by the value contained in a value file.\n\nThe key value is value from properties\n```\n\n### From environment\n\n```shell\n$ KEY=\"value from env\" placeholder replace template.file\n```\n```shell\n$ cat template.file\nThis is a simple template file containing a \u003cKEY\u003e placeholder surrounded with\n'${' and '}' which will be replaced by the value contained in a value file.\n\nThe key value is value from env\n```\n\n### Bloc separator\nYou can also change the default bloc separator by specifying the start and end bloc with the `-s` and `-e` arguments :\n\n```shell\n$ placeholder -s '%#' -e '#%' replace -i values.json template.file\n```\n```shell\n$ cat template.file\nThis is a simple template file containing a \u003cKEY\u003e placeholder surrounded with\n'%#' and '#%' which will be replaced by the value contained in a value file.\n\nThe key value is value from env\n```\n\n## Build it\n\nTo build this project, you must have make and go \u003e= 1.12 installed.\nYou can then just type:\n`make build`\n\nIf you don't want to install go but use docker instead, type:\n`make docker-build`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyaillet%2Fplaceholder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyaillet%2Fplaceholder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyaillet%2Fplaceholder/lists"}