{"id":16120512,"url":"https://github.com/anze3db/adventofcode","last_synced_at":"2025-08-11T06:36:34.186Z","repository":{"id":211285867,"uuid":"728616941","full_name":"anze3db/adventofcode","owner":"anze3db","description":"Helper utilities for solving Advent of Code puzzles","archived":false,"fork":false,"pushed_at":"2024-12-02T20:46:07.000Z","size":94,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-04T09:10:07.083Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anze3db.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-12-07T10:23:23.000Z","updated_at":"2024-12-02T00:06:30.000Z","dependencies_parsed_at":"2024-02-05T20:01:15.321Z","dependency_job_id":"66ad8dd9-8132-4ac8-803a-5d8039d5eaf3","html_url":"https://github.com/anze3db/adventofcode","commit_stats":null,"previous_names":["anze3db/adventofcode"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anze3db%2Fadventofcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anze3db%2Fadventofcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anze3db%2Fadventofcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anze3db%2Fadventofcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anze3db","download_url":"https://codeload.github.com/anze3db/adventofcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230494921,"owners_count":18235046,"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-09T20:58:35.133Z","updated_at":"2024-12-19T20:08:48.942Z","avatar_url":"https://github.com/anze3db.png","language":"Python","readme":"# adventofcode\n\nHelper utilities for solving Advent of Code puzzles.\n\n* No copy-pasting puzzle inputs into files.\n* No need to use low-level file APIs to read your inputs.\n* Performance reports for example inputs and puzzle inputs.\n* Submit the answer immediately when your code returns the result 🏎️\n\n## Usage\n\n### Install the package\n\nInstall the package with pip:\n```bash\npip install adventofcode\n```\n\n### Set your session cookie\n\nAdd the [adventofcode.com](https://adventofcode.com) session cookie value to your env:\n\n```bash\nexport AOC_SESSION=\"...\"\n```\n\nAlternatively, you can save your `AOC_SESSION=\"******\"` value in a `.env` file.\n\n\u003e [!NOTE]\n\u003e Setting AOC_SESSION will allow you to get your personal puzzle output (`aoc.get_input()`) and submit your answers with `aoc.submit_p1()` and `aoc.submit_p2()`.\n\n### Use a template to solve puzzles\n\nI use the following template to start solving puzzles, see my examples in [my repo for 2023](https://github.com/anze3db/adventofcode2023).\n\n```python\nfrom adventofcode import AoC\n\n\ndef part1(inp):\n    return None\n\n\ndef part2(inp):\n    return None\n\n\naoc = AoC(part_1=part1, part_2=part2)\ninp = \"\"\"sample input\"\"\"\n# Run your part1 function with sample input and assert the expected result:\naoc.assert_p1(inp, 42)\n# Run your part1 function on puzzle input and submit the answer returned:\naoc.submit_p1()\n\n# Run your part2 function with sample input and assert the expected result:\naoc.assert_p2(inp, 6*7)\n# Run your part2 function on puzzle input and submit the answer returned:\naoc.submit_p2()\n```\n\n\u003e [!NOTE]\n\u003e All submissions and fetched results are cached locally in the `.cache.db` file so that we don't spam the AoC servers or resubmit the same answer multiple times.\n\n### Or build your workflow using the AoC class\n\n```python\nfrom adventofcode import AoC\n\naoc = AoC() # defaults to current year and parses the day from the filename (e.g. 01.py will be day 1)\n\naoc.print_p1() # prints the first part of the puzzle\ninp = aoc.get_input() # returns the input as a string\n# solve the puzzle here\n...\naoc.submit_p1('part 1 answer') # submits the answer to the first part of the puzzle\naoc.print_p2() # prints the second part of the puzzle\n# solve the puzzle here\n...\naoc.submit_p2('part 2 answer') # submits the answer to the second part of the puzzle\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanze3db%2Fadventofcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanze3db%2Fadventofcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanze3db%2Fadventofcode/lists"}