{"id":22663607,"url":"https://github.com/zeph1997/adventofcodeinputreader","last_synced_at":"2025-03-29T09:17:17.564Z","repository":{"id":57408306,"uuid":"434505930","full_name":"zeph1997/AdventOfCodeInputReader","owner":"zeph1997","description":"Package to get Advent Of Code Input. Available on PyPI.","archived":false,"fork":false,"pushed_at":"2021-12-03T16:31:14.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T11:46:16.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/zeph1997.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}},"created_at":"2021-12-03T07:33:37.000Z","updated_at":"2022-08-22T17:52:43.000Z","dependencies_parsed_at":"2022-09-26T16:31:20.856Z","dependency_job_id":null,"html_url":"https://github.com/zeph1997/AdventOfCodeInputReader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeph1997%2FAdventOfCodeInputReader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeph1997%2FAdventOfCodeInputReader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeph1997%2FAdventOfCodeInputReader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeph1997%2FAdventOfCodeInputReader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeph1997","download_url":"https://codeload.github.com/zeph1997/AdventOfCodeInputReader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162148,"owners_count":20733357,"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-12-09T12:31:10.564Z","updated_at":"2025-03-29T09:17:17.539Z","avatar_url":"https://github.com/zeph1997.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AdventOfCodeInputReader\n\n# \u003cp align=\"center\"\u003eAdventOfCodeInputReader\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eA python package to get the input for Advent Of Code challenges as a list\u003c/p\u003e\n\n## Contents\n\n  * [Getting started](#getting-started)\n  * [Using AdventOfCodeInputReader](#using-adventofcodeinputreader)\n  * [Methods](#methods)\n    * [get_input()](#get_input)\n    * [get_input_by_day()](#get_input_by_day)\n    * [get_input_by_year_and_day()](#get_input_by_year_and_day)\n      \n## Getting Started\n\n* Installation using pip (Python Package Index):\n\n```\n$ pip install AdventOfCodeInputReader\n```\n\n## Using AdventOfCodeInputReader\n\n### Import and Initialise\n\nThe AdventOfCode class (defined in __init__.py) has one mandatory parameter (`session_id`) and two optional parameters (`year` and `day`). To get `session_id`, you need to log into Advent of Code and retreieve the session id from your browser cookies. Your session id is required as the challenge input is different for each user.\n\n```python\nfrom AdventOfCodeInputReader import AdventOfCodeInputReader\n\n# Initialize with only session_id\nreader = AdventOfCodeInputReader(\"your_session_id\")\n\n# Initialize with session_id and year only\nreader = AdventOfCodeInputReader(\"your_session_id\",2021)\n\n# Initialize with session_id and year and day\nreader = AdventOfCodeInputReader(\"your_session_id\",2021,1)\n\n```\n\n## Methods\n\nThe AdventOfCode class has three methods: `get_input()`, `get_input_by_day()`, `get_input_by_year_and_day()`. All three methods will return a list of strings, with each line of the input as an element in the list.\n\n### get_input()\n\nThe `get_input(day=None, year=None)` method has two optional parameters, `day` and `year`. If you have specified the values for `day` and `year` at initalization, you can use this method without any arguments. If you have included values for `day` and `year` at initization but included `day` and `year` arguments for `get_input()`, the method will override and use the arguments provided in `get_input()` for this specific run only. It will not update the class value.\n\n```python\n# Using get_input() with year and day specified at initalization\nreader = AdventOfCodeInputReader(\"your_session_id\",2021,1)\ninput = reader.get_input()\n\n# Using get_input() with only year specified at initalization\nreader = AdventOfCodeInputReader(\"your_session_id\",2021)\ninput = reader.get_input(day=1)\n\n# Using get_input() without year and day specified at initalization\nreader = AdventOfCodeInputReader(\"your_session_id\")\ninput = reader.get_input(day=1,year=2021)\n\n```\n\nThis method returns a list of strings, with each line of the input as an element in the list.\n\nIf the input from Advent of Code looks like:\n```\nline 1\nline 2\nline 3\n```\nThe method will return:\n```\n[\"line 1\", \"line 2\", \"line 3\"]\n```\n\n### get_input_by_day()\n\nThe `get_input_by_day(day)` method requires the `year` to be declared at initialization. If you have included value for `day` at initization but included `day` argument for `get_input_by_day()`, the method will override and use the argument provided in `get_input_by_day()` for this specific run only. It will not update the class value.\n\n```python\nreader = AdventOfCodeInputReader(\"your_session_id\",2021)\ninput = reader.get_input_by_day(1)\n\n```\n\nThis method returns a list of strings, with each line of the input as an element in the list.\n\nIf the input from Advent of Code looks like:\n```\nline 1\nline 2\nline 3\n```\nThe method will return:\n```\n[\"line 1\", \"line 2\", \"line 3\"]\n```\n\n### get_input_by_year_and_day()\n\nThe `get_input_by_year_and_day(year, day)` method requires the `year` and `day` arguments to be specified when using the method. If you have included value for `year` or `day` at initization, the `year` and `day` arguments provided will be used instead of the values specified at initalization for this specific run only. It will not update the class value.\n\n```python\nreader = AdventOfCodeInputReader(\"your_session_id\")\ninput = reader.get_input_by_year_and_day(year=2021,day=1)\n\n```\n\nThis method returns a list of strings, with each line of the input as an element in the list.\n\nIf the input from Advent of Code looks like:\n```\nline 1\nline 2\nline 3\n```\nThe method will return:\n```\n[\"line 1\", \"line 2\", \"line 3\"]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeph1997%2Fadventofcodeinputreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeph1997%2Fadventofcodeinputreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeph1997%2Fadventofcodeinputreader/lists"}