{"id":37044965,"url":"https://github.com/leifwritescode/ornaments","last_synced_at":"2026-01-14T05:11:55.204Z","repository":{"id":166914467,"uuid":"576949343","full_name":"leifwritescode/Ornaments","owner":"leifwritescode","description":"An Advent of Code standard library.","archived":false,"fork":false,"pushed_at":"2023-12-12T00:16:37.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T01:06:39.598Z","etag":null,"topics":["advent","advent-of-code","advent-of-code-2022","adventofcode"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Ornaments","language":"C#","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/leifwritescode.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}},"created_at":"2022-12-11T14:10:50.000Z","updated_at":"2024-10-22T17:41:47.000Z","dependencies_parsed_at":"2024-10-23T02:33:56.019Z","dependency_job_id":"51a57d5c-f0fa-4504-9c64-1c09981d5bd9","html_url":"https://github.com/leifwritescode/Ornaments","commit_stats":null,"previous_names":["leifwritescode/ornaments"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leifwritescode/Ornaments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leifwritescode%2FOrnaments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leifwritescode%2FOrnaments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leifwritescode%2FOrnaments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leifwritescode%2FOrnaments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leifwritescode","download_url":"https://codeload.github.com/leifwritescode/Ornaments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leifwritescode%2FOrnaments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28410306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["advent","advent-of-code","advent-of-code-2022","adventofcode"],"created_at":"2026-01-14T05:11:54.446Z","updated_at":"2026-01-14T05:11:55.187Z","avatar_url":"https://github.com/leifwritescode.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ornaments SDK\r\n\r\nAn [Advent of Code](https://adventofcode.com) solutions runner and standard library by [Leif Walker-Grant](https://uk.linkedin.com/in/championofgoats).\r\n\r\n## (Really) Quick Start\r\n\r\nA working example project, implementing day 1 of event year 2022, is included. See [ExampleApp](.\\ExampleApp), and don't forget to [configure](#configuration) it!\r\n\r\n### (Slighty Less) Quick Start\r\n\r\n```csharp\r\n// Create a new .NET 7 C# Console App named SomeConsoleApp\r\n// Install Ornaments from NuGet\r\n// Replace Program.cs with this code\r\n// $ dotnet run solve --year 2022 --day 1 --dry-run\r\n\r\nusing Ornaments.App;\r\nusing Ornaments.Solutions;\r\n\r\nnamespace SomeConsoleApp;\r\n\r\n[RegisterOrnament(\"SomeChallenge\", 2022, 1)]\r\ninternal sealed class SomeSolution : ISolution\r\n{\r\n    public SomeSolution() {}\r\n\r\n    public async Task\u003cobject\u003e DoPartOneAsync(ISolutionContext solutionContext)\r\n    {\r\n        return new();\r\n    }\r\n\r\n    public async Task\u003cobject\u003e DoPartTwoAsync(ISolutionContext solutionContext)\r\n    {\r\n        return new();\r\n    }\r\n\r\n    public bool TryParse(string input, out object parsed)\r\n    {\r\n        parsed = new();\r\n        return true;\r\n    }\r\n}\r\n\r\ninternal class Program\r\n{\r\n    static async Task Main(string[] args)\r\n    {\r\n        await OrnamentsApp.CreateDefault().RunAsync(args);\r\n    }\r\n}\r\n```\r\n\r\n## Command Line\r\n\r\nOrnaments implements a command line runner capable of listing avaialble solutions, solving challenges, and benchmarking solutions.\r\n\r\nTo list all challenges --\r\n\r\n```\r\ndotnet run list\r\n```\r\n\r\nTo solve a challenge --\r\n\r\n```\r\ndotnet run solve --year 2022 --day 1 [--dry-run] [--users GitHub]\r\n```\r\n\r\nWhere `--year` is the event year, `--day` is the challenge date, `--dry-run` is an optional flag indicating answers should **not** be submitted, and `--users` specifies the tokens you would like to use.\r\n\r\nLastly, to benchmark a solution --\r\n\r\n```\r\ndotnet run benchmark --year 2022 --day 1 [--runs 1000]\r\n```\r\n\r\nWhere `--year` is the event year, `--day` is the challenge date, and `runs` is an optional integer argument specifying the number of runs to average over.\r\n\r\nFor more information on how to use each command, and information on the commands themselves including default option values, you can use one of the following --\r\n\r\n```\r\ndotnet run -h\r\ndotnet run solve -h\r\ndotnet run list -h\r\ndotnet run benchmark -h\r\n```\r\n\r\n## Configuration\r\n\r\nIn order to comply with Eric's request that all automated submissons carry a unique user-agent, Ornaments requires that you provide a contact email address and fully-qualified URI pointing to the **public** source code of your implementing project. Additionally, if you are not using the `--dry-run` switch, you must specify at least one token.\r\n\r\n### Getting a Session Token\r\n\r\nSession tokens are obtained by logging in to [Advent of Code](https://adventofcode.com/2022/auth/login) with one of the supported authorisation providers. You can then find the token in the request headers of each subsequent page load. Each token is unique to the provider.\r\n\r\n### Minimal Configuration\r\n\r\n```json\r\n{\r\n  \"tokens\": {\r\n    \"gitHub\": \"github_token\",\r\n  },\r\n  \"ornaments\": {\r\n    \"emailAddress\": \"mail@example.com\",\r\n    \"sourceCodeUri\": \"https://example.com/user/repo\"\r\n  }\r\n}\r\n\r\n```\r\n\r\n### Full Configuration\r\n\r\n```json\r\n{\r\n  \"tokens\": {\r\n    \"gitHub\": \"github_token\",\r\n    \"google\": \"google_token\",\r\n    \"reddit\": \"reddit_token\",\r\n    \"twitter\": \"twitter_token\"\r\n  },\r\n  \"ornaments\": {\r\n    \"database\": \"database.db\",\r\n    \"emailAddress\": \"mail@example.com\",\r\n    \"sourceCodeUri\": \"https://example.com/user/repo\"\r\n  }\r\n}\r\n\r\n```\r\n\r\n## Caching\r\n\r\nOrnaments records your inputs and submissions in an internal cache. Additionally, after their first use with Ornaments, tokens are recorded in the cache and matched to inputs and submissions. Multiple tokens can be recorded for a given provider, however the token specified in `appsettings.json` at the time of execution shall be used. The cache is stored on your local disk adjacent your project executables.\r\n\r\nThe singlular copy of your cache exists on your machine, and deleting it is a destructive and permanent operation.  Whilst you can fetch inputs again, you are unable to resubmit answers. Attempting to do so may result in your token(s) being blacklisted by Eric.\r\n\r\n## Please be Considerate\r\n\r\nOrnaments includes a feature enabling automated scraping of, and submission of answers to, the Advent of Code wesbite. Sending a large volume of requests to the Advent of Code website within a short space of time may result in your user-agent and/or IP address being flagged, or you may blocked from making further requests entirely. Please be considerate of Eric, his work, and the many tens of thousands of participants that enjoy the event every year. Please use Ornaments considerably.\r\n\r\nA caching mechanism is employed to ensure that Ornaments will not scrape data more than once or, on a per-identity basis, submit the same answer twice. If you wish, you may disable automated submission entirely by setting `global.autosubmit` to `false` in your `appsettings.json`.\r\n\r\n## Todo\r\n\r\n- [ ] Implement core runner. (In progress)\r\n- [x] Implement data model.\r\n- [x] Implement input fetch support.\r\n- [x] Implement minimum submission support.\r\n- [ ] Implement existing standard library classses. (In progress)\r\n- [ ] Implement wait support.\r\n\r\n## License and Disclaimer\r\n\r\nThe Ornaments SDK is written by, and the copyright \u0026copy; of, Leif Walker-Grant. Neither Ornaments nor Leif Walker-Grant are affiliated with the Advent of Code in any way. The SDK is made available free-of-charge, as-is and without warranty, under the MIT license. For more information, see LICENSE.\r\n\r\nThis project is indirectly dependent on SixLabors.ImageSharp, a library which is licensed under Apache 2.0 when disitributed as part of the Ornaments SDK. All other usage is covered by the [Six Labors Split License](https://github.com/SixLabors/ImageSharp/blob/master/LICENSE).\r\n\r\n## Special Mentions\r\n\r\nThis project exists with my thanks to [Eric Wastl](https://twitter.com/ericwastl) for running the Advent of Code event each year.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleifwritescode%2Fornaments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleifwritescode%2Fornaments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleifwritescode%2Fornaments/lists"}