You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get your puzzle data with a single import statement:
22
+
Speedhackers, get your puzzle data with a single import statement:
23
23
24
24
.. code-block:: python
25
25
26
26
from aocd import data
27
27
28
-
Might be useful for lazy Pythonistas and speedhackers.
29
-
30
-
If you'd just like to print or keep your own input files, there's a shell entry point for that:
31
-
32
-
.. code-block:: bash
33
-
34
-
aocd > input.txt # saves today's data
35
-
aocd 13 2018 > day13.txt # save some other day's data
36
-
37
-
If all that sounds too magical, there is a simple getter function to just return your raw data.
28
+
If that sounds too magical, use a simple function call to return your data in a string:
38
29
39
30
.. code-block:: python
40
31
41
32
>>>from aocd import get_data
42
33
>>> get_data(day=24, year=2015)
43
34
'1\n2\n3\n7\n11\n13\n17\n19\n23\n31...
44
35
36
+
If you'd just like to print or keep your own raw input files, there's a script for that:
37
+
38
+
.. code-block:: bash
39
+
40
+
aocd > input.txt # saves today's data
41
+
aocd 13 2018 > day13.txt # save some other day's data
42
+
45
43
Note that ``aocd`` will cache puzzle inputs and answers (including incorrect guesses) clientside, to save unnecessary requests to the server.
46
44
47
-
*New in version 2.0.0:* Get the sample data (and corresponding answers). For example, from `2022 day 5 <https://adventofcode.com/2022/day/5>`_ there was:
45
+
*New in version 2.0.0:* Get the example data (and corresponding answers). From `2022 day 5 <https://adventofcode.com/2022/day/5>`_ there was:
48
46
49
47
.. code-block:: bash
50
48
@@ -66,7 +64,7 @@ Note that ``aocd`` will cache puzzle inputs and answers (including incorrect gue
0 commit comments