{"id":35803336,"url":"https://github.com/dlang-community/configy","last_synced_at":"2026-01-07T12:01:02.807Z","repository":{"id":36951247,"uuid":"403994613","full_name":"dlang-community/configy","owner":"dlang-community","description":"An automatic YAML to struct configuration parser for dlang","archived":false,"fork":false,"pushed_at":"2025-10-01T15:32:28.000Z","size":314,"stargazers_count":4,"open_issues_count":6,"forks_count":5,"subscribers_count":6,"default_branch":"v3.x.x","last_synced_at":"2025-10-01T15:32:41.325Z","etag":null,"topics":["configuration","dlang","metaprogramming","yaml"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlang-community.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-09-07T13:45:47.000Z","updated_at":"2025-10-01T13:55:23.000Z","dependencies_parsed_at":"2024-02-04T10:45:54.516Z","dependency_job_id":"9f14e75e-fadb-4f70-9ca6-5beef3584b50","html_url":"https://github.com/dlang-community/configy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dlang-community/configy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Fconfigy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Fconfigy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Fconfigy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Fconfigy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlang-community","download_url":"https://codeload.github.com/dlang-community/configy/tar.gz/refs/heads/v3.x.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Fconfigy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28235224,"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","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["configuration","dlang","metaprogramming","yaml"],"created_at":"2026-01-07T12:00:25.486Z","updated_at":"2026-01-07T12:01:02.795Z","avatar_url":"https://github.com/dlang-community.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configy: Simple, efficient YAML -\u003e `struct` converter\n\n## Why (would I use this) ?\n\nAny decently-sized application needs to eventually be configured.\nWhen an application's complexity is past the threshold where its options can be\nmanaged by command line arguments alone, one need to add a configuration file.\n\nEnter a myriad of questions:\n- What format do I use ?\n- How do I document it ?\n- What are sensible default values ?\n- How do I accurately report errors ?\n\nAnd so on. This framework provide an opiniated answer to all those questions.\n\n## How (do I use this) ?\n\nLet's start with an hello world:\n\n```D\nmodule helloworld;\n\nimport configy.easy;\n\nimport std.stdio;\nimport std.typecons;\nimport core.thread;\n\nstruct Config\n{\n    /// The name to greet\n    string name;\n\n    /// Other people to greet\n    SetInfo!(string[]) extra_names;\n\n    /// How often to greet the user\n    Duration frequency = 1.seconds;\n\n    /// How many times should we repeat the greeting (0: no limit)\n    @Optional size_t limit;\n}\n\nint main (string[] args)\n{\n    // `parseConfigFileSimple` will print to `stderr` if an error happened\n    Nullable!Config configN = parseConfigFileSimple!Config(\"config.yaml\");\n    if (configN.isNull())\n        return 1;\n    auto config = configN.get();\n\n    // Your program goes here\n    for (size_t i = 0; config.limit == 0 || i \u003c config.limit; ++i)\n    {\n        writeln(\"Hello World to you \", config.name);\n        if (config.extra_names.set)\n            writefln(\"And to you too, %-(%s, %)\", config.extra_names.value);\n        Thread.sleep(config.frequency);\n    }\n    return 0;\n}\n```\n\nThis code can be found [here](examples/helloworld/), along with the associated configuration:\n```YAML\nname: \"Lord Commander Tenant\"\nextra_names:\n  - The Gary\n  - Mooncake\n```\n\nThis demonstrate a few important properties of the config parser:\n- Any field with an initializer (different from `.init`) is considered optional;\n- Fields can be set to optional through to `Optional` UDA if their `init` value should be their default;\n- Using `SetInfo` allows on to have optional fields that carry whether they were set or not;\n- `Duration` is natively parsed;\n\n## Full documentation\n\nThe full, up-to-date API documentation can be found [here](https://dlang-community.github.io/configy/).\nA list of example for common use cases can be found [here](doc/FAQ.md).\n\n## Rich error reporting\n\nBecause humans make mistakes, and configuration are aimed towards humans, special care is given to errors.\nUsing the [helloworld](examples/helloworld) example, here are some of the errors that would be reported:\n```YAML\n# Missing required option `name`\nlimit: 1\n```\n\n![Resulting error message](doc/img/missing.png)\n\n```YAML\n# Wrong key: Should be `name`, not `username`\nusername: \"Lord Commander Tenant\"\n```\n\n![Resulting error message](doc/img/strict.png)\n\nThis error is optional, but enabled by default. See `strict mode` in documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlang-community%2Fconfigy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlang-community%2Fconfigy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlang-community%2Fconfigy/lists"}