Advent of Code helper functions
Project description
Advent of Code helper functions
from aoc.helpers import output, read_input_from_file, input_lines
Setup Guide
Install with pip
pip install advent-of-code-helpers
Usage
Using the template:
from aoc import template
class Part1(template.Part1):
def __init__(self, day: int, year: int) -> None:
super().__init__(day, year)
def solve(self):
# Read input
lines = input_lines(self.input())
# Do some work here
# Sample output
result = ','.join(lines)
return result
def main():
output_dir = '../out'
test_data = os.path.join(os.path.dirname(__file__),
'resources/test_input.txt')
Part1(1, 2018).data(test_data).output(output_dir)
data = os.path.join(os.path.dirname(__file__), 'resources/input.txt')
Part1(1, 2018).data(data).output(output_dir)
if __name__ == "__main__":
main()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for advent-of-code-helpers-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91eb28a4372ea282f399e901401a0c0154101a5c6d1053c13f024bd79bef8816 |
|
MD5 | efd037a055e1e2343fe5bdd3906687ef |
|
BLAKE2b-256 | 649ff5c2ffa4e789a76bd620d934ae45f06fe5a3cc5feb3cec52b30b132063a7 |