{"id":16340831,"url":"https://github.com/casey/starstar","last_synced_at":"2025-11-04T21:30:26.892Z","repository":{"id":81088192,"uuid":"69074397","full_name":"casey/starstar","owner":"casey","description":"** for the win","archived":false,"fork":false,"pushed_at":"2016-09-25T03:06:10.000Z","size":297,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T01:18:26.538Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casey.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-24T02:26:57.000Z","updated_at":"2016-09-24T03:30:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f57b2e2-06ac-4c71-ab3f-529182451f66","html_url":"https://github.com/casey/starstar","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/casey%2Fstarstar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fstarstar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fstarstar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casey%2Fstarstar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casey","download_url":"https://codeload.github.com/casey/starstar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239441677,"owners_count":19639122,"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-10T23:57:59.789Z","updated_at":"2025-11-04T21:30:26.832Z","avatar_url":"https://github.com/casey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"starstar\n--------\n\nThis repo contains a simple example of a pattern in python that I've found useful when I need to load a config file and do something with the data it contains.\n\nThe pattern is simple:\n\n1. Load the config file off of disk\n2. Parse it into python objects using the `**` operator and list comprehensions\n3. Do something with the python objects\n\nIn this example the config file is a YAML file, although it could just as easily be JSON, TOML, or a CSV, and we use it to instantiate python objects which then serve as the context for a jinja2 markdown template. This might also be useful for parsing a config file that contains program settings.\n\nThere are a number of advantages to this approach:\n\n- It is resistant to bugs caused by misspellings in the config file. If you misspell an item in the config file, the corresponding call to `__init__` will fail with a helpful error message.\n\n- If you misspell a property name in a template you'll get an error message which has the class name in it, instead of a generic dictionary key error.\n\n- It is concise and appealing.\n\nFiles:\n\n- `main` is the code. Start reading here\n- `README.md` is this readme\n- `config.yaml` is the YAML config file\n- `template.md` is the jinja2 markdown template\n- `output.md` is the rendered template\n- `yaml` is a copy of the PyYAML YAML library\n- `jinja2` is a copy of the Jinja2 template engine\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasey%2Fstarstar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasey%2Fstarstar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasey%2Fstarstar/lists"}