Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jarshwah/advent-of-code
Python implementations for Advent Of Code
https://github.com/jarshwah/advent-of-code
advent-of-code aoc fun python
Last synced: about 2 months ago
JSON representation
Python implementations for Advent Of Code
- Host: GitHub
- URL: https://github.com/jarshwah/advent-of-code
- Owner: jarshwah
- Created: 2020-12-01T09:44:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T04:40:52.000Z (about 1 year ago)
- Last Synced: 2024-01-03T05:43:32.553Z (about 1 year ago)
- Topics: advent-of-code, aoc, fun, python
- Language: Python
- Homepage:
- Size: 199 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# advent-of-code
Python implementations for [Advent Of Code](https://adventofcode.com/) (and some SQL).
I use AOC as an opportunity to use the latest and greatest python features as well
as learning new libraries that I don't use in my day to day.From the root directory each language I've used will have its own folder, and then
each of those will have a folder for each year I've participated.Since running python files as both a module or a script is a pain, the shared
utils are symlinked into each year's folder.The structure of most problems follows the pattern:
```python
def part_one(data: str):
...def part_two(data: str):
...def test():
test_input = """ ... """
assert part_one(test_input) == ...
assert part_two(test_input) == ...if __name__ == "__main__":
test()
data = aocd.get_data(day=1, year=2022)
print(part_one(data))
print(part_two(data))
```The `aocd` library (advent-of-code-data) fetches the specific input for my account
via a token stored at `~/.config/aocd/token`. Grab the session token from a browser
session when logged in and populate that file.