adventofcode 25.4__py3-none-any.whl → 25.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adventofcode/__about__.py +1 -1
- {adventofcode-25.4.dist-info → adventofcode-25.6.dist-info}/METADATA +83 -54
- adventofcode-25.6.dist-info/RECORD +9 -0
- adventofcode-25.4.dist-info/RECORD +0 -9
- {adventofcode-25.4.dist-info → adventofcode-25.6.dist-info}/WHEEL +0 -0
- {adventofcode-25.4.dist-info → adventofcode-25.6.dist-info}/entry_points.txt +0 -0
- {adventofcode-25.4.dist-info → adventofcode-25.6.dist-info}/licenses/LICENSE +0 -0
adventofcode/__about__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "25.
|
|
1
|
+
__version__ = "25.6"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: adventofcode
|
|
3
|
-
Version: 25.
|
|
3
|
+
Version: 25.6
|
|
4
4
|
Summary: Helper utilities for solving Advent of Code puzzles
|
|
5
5
|
Project-URL: Documentation, https://github.com/anze3db/adventofcode#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/anze3db/adventofcode/issues
|
|
@@ -27,19 +27,37 @@ Requires-Dist: requests
|
|
|
27
27
|
Requires-Dist: rich
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
|
|
30
|
-
# adventofcode
|
|
30
|
+
# 🎄 adventofcode [](https://pypi.org/project/adventofcode) [](https://pypi.org/project/adventofcode)
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
<p align="center">
|
|
33
|
+
<img width="742" height="613" alt="Screenshot 2025-12-02 at 10 04 42" src="https://github.com/user-attachments/assets/77b711b3-c2a2-4719-8d8a-083af2067c62" />
|
|
34
|
+
</p>
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
### Your framework for solving [Advent Of Code](https://adventofcode.com) puzzles 🧩 and benchmarking solutions 🚀
|
|
38
|
+
|
|
39
|
+
* Project scaffolding with `uv run adventofcode init`.
|
|
40
|
+
* Assert and submit your solutions with `uv run adventofcode run`.
|
|
41
|
+
* Benchmark all your solutions with `uv run adventofcode benchmark`.
|
|
37
42
|
* No copy-pasting puzzle inputs or loading inputs from files.
|
|
38
|
-
* Submit the answer immediately when your code returns the result 🏅
|
|
43
|
+
* Submit the answer immediately when your code returns the result. 🏅
|
|
44
|
+
|
|
45
|
+
------
|
|
46
|
+
|
|
47
|
+
**Table of Contents**
|
|
48
|
+
|
|
49
|
+
- [Setup](#setup)
|
|
50
|
+
- [Session cookie](#session-cookie)
|
|
51
|
+
- [Run and submit your solution](#run-and-submit-your-solution)
|
|
52
|
+
- [Benchmark all your solutions](#benchmark-all-your-solutions)
|
|
53
|
+
- [Using AoC class](#using-aoc-class)
|
|
54
|
+
- [Happy solving 🎄](#happy-solving-)
|
|
55
|
+
- [Similar projects](#similar-projects)
|
|
39
56
|
|
|
40
|
-
## Usage
|
|
41
57
|
|
|
42
|
-
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Setup
|
|
43
61
|
|
|
44
62
|
```bash
|
|
45
63
|
uv init
|
|
@@ -98,23 +116,12 @@ def part2(inp: str) -> str | int | None:
|
|
|
98
116
|
return None
|
|
99
117
|
|
|
100
118
|
```
|
|
119
|
+
## Session cookie
|
|
101
120
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
uv run adventofcode run
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
This will:
|
|
121
|
+
Before we can run these files we need to set up your session cookie. You can find the session cookie by going to [adventofcode.com] in your browser. Make sure you are logged in, then open your browser's developer tools and navigate to Application → Storage → Cookies. Look for the cookie named `session` and copy its value.
|
|
109
122
|
|
|
110
|
-
* Run your `part1` function with the inputs provided in the `part1_asserts` iterable and compare them with the expected values. If the function's return value doesn't match the expected answer, the command will stop. *Hint*: Each puzzle usually contains example input and an expected answer—these make for great asserts!
|
|
111
|
-
* If all the `part1_asserts` pass, `part1` will be called with your puzzle input fetched from adventofcode.com using your session cookie.
|
|
112
|
-
* If `part1` returns a non-None value for your puzzle input, that value will be submitted to adventofcode.com as your part 1 answer using your session cookie. All answer submissions are cached, so each unique answer will only be submitted once.
|
|
113
|
-
* If your answer was correct the same process repeats for `part2`.
|
|
114
123
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Add the [adventofcode.com](https://adventofcode.com) session cookie value to your `.env` file:
|
|
124
|
+
Then add the [adventofcode.com](https://adventofcode.com) session cookie value to your `.env` file:
|
|
118
125
|
|
|
119
126
|
```
|
|
120
127
|
# Set your Advent of Code session cookie below
|
|
@@ -131,10 +138,22 @@ or to your environment variables:
|
|
|
131
138
|
export AOC_SESSION="..."
|
|
132
139
|
```
|
|
133
140
|
|
|
134
|
-
|
|
135
|
-
> You can find the session cookie by going to adventofcode.com in your browser. Make sure you are logged in, then open your browser's developer tools and navigate to Application → Storage → Cookies. Look for the cookie named `session` and copy its value.
|
|
141
|
+
## Run and submit your solution
|
|
136
142
|
|
|
137
|
-
|
|
143
|
+
Implement your solution in `part1` and `part2` functions and run
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
uv run adventofcode run 01.py
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
This will:
|
|
150
|
+
|
|
151
|
+
* Run your day 1, `part1` function with the inputs provided in the `part1_asserts` iterable and compare them with the expected values. If the function's return value doesn't match the expected answer, the command will stop. *Hint*: Each puzzle usually contains example input and an expected answer—these make for great asserts!
|
|
152
|
+
* If all the `part1_asserts` pass, `part1` will be called with your puzzle input fetched from adventofcode.com using your session cookie.
|
|
153
|
+
* If `part1` returns a non-None value for your puzzle input, that value will be submitted to adventofcode.com as your part 1 answer using your session cookie. All answer submissions are cached, so each unique answer will only be submitted once.
|
|
154
|
+
* If your answer was correct the same process repeats for `part2`.
|
|
155
|
+
|
|
156
|
+
## Benchmark all your solutions
|
|
138
157
|
|
|
139
158
|
You can benchmark your solutions with
|
|
140
159
|
|
|
@@ -144,44 +163,51 @@ uv run adventofcode benchmark
|
|
|
144
163
|
|
|
145
164
|
This will run each day's solution and parse the timing results from the output. The results will be printed to the console as well as added to your README.md.
|
|
146
165
|
|
|
166
|
+
Example console output:
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
147
170
|
Example README:
|
|
148
171
|
|
|
172
|
+
<!-- BENCHMARK_RESULTS_START -->
|
|
149
173
|
| Day | Status | Part 1 Time | Part 2 Time | Total Time |
|
|
150
174
|
|:---:|:------:|------------:|------------:|-----------:|
|
|
151
|
-
| 01 | ✅ |
|
|
152
|
-
| 02 | ✅ |
|
|
153
|
-
| 03 | ✅ |
|
|
154
|
-
| 04 | ✅ |
|
|
155
|
-
| 05 | ✅ |
|
|
156
|
-
| 06 | ✅ | 3.
|
|
157
|
-
| 07 | ✅ |
|
|
158
|
-
| 08 | ✅ |
|
|
159
|
-
| 09 | ✅ |
|
|
160
|
-
| 10 | ✅ |
|
|
161
|
-
| 11 | ✅ |
|
|
162
|
-
| 12 | ✅ |
|
|
163
|
-
| 13 | ✅ |
|
|
164
|
-
| 14 | ✅ | 3.
|
|
165
|
-
| 15 | ✅ |
|
|
166
|
-
| 16 | ✅ |
|
|
167
|
-
| 17 | ✅ | 0.
|
|
168
|
-
| 18 | ✅ |
|
|
169
|
-
| 19 | ✅ | 9.
|
|
170
|
-
| 20 | ✅ |
|
|
171
|
-
| 21 | ✅ | 0.
|
|
172
|
-
| 22 | ✅ | 603.
|
|
173
|
-
| 23 | ✅ |
|
|
174
|
-
| 24 | ⚠️ |
|
|
175
|
-
| 25 | ✅ |
|
|
176
|
-
| **Total** | |
|
|
175
|
+
| 01 | ✅ | 0.28ms 🟢 | 0.41ms 🟢 | 0.69ms 🟢 |
|
|
176
|
+
| 02 | ✅ | 0.76ms 🟢 | 1.13ms 🟢 | 1.89ms 🟢 |
|
|
177
|
+
| 03 | ✅ | 0.15ms 🟢 | 0.33ms 🟢 | 0.48ms 🟢 |
|
|
178
|
+
| 04 | ✅ | 21.43ms 🟢 | 4.79ms 🟢 | 26.22ms 🟢 |
|
|
179
|
+
| 05 | ✅ | 1.95ms 🟢 | 3.51ms 🟢 | 5.46ms 🟢 |
|
|
180
|
+
| 06 | ✅ | 3.04ms 🟢 | 3.91s 🔴 | 3.91s 🔴 |
|
|
181
|
+
| 07 | ✅ | 30.58ms 🟢 | 1.01s 🔴 | 1.04s 🔴 |
|
|
182
|
+
| 08 | ✅ | 0.42ms 🟢 | 0.60ms 🟢 | 1.02ms 🟢 |
|
|
183
|
+
| 09 | ✅ | 5.75ms 🟢 | 1.01s 🔴 | 1.02s 🔴 |
|
|
184
|
+
| 10 | ✅ | 2.85ms 🟢 | 3.05ms 🟢 | 5.90ms 🟢 |
|
|
185
|
+
| 11 | ✅ | 0.97ms 🟢 | 37.60ms 🟢 | 38.57ms 🟢 |
|
|
186
|
+
| 12 | ✅ | 30.75ms 🟢 | 31.96ms 🟢 | 62.71ms 🟢 |
|
|
187
|
+
| 13 | ✅ | 108.79ms 🟡 | 342.44ms 🟡 | 451.23ms 🟡 |
|
|
188
|
+
| 14 | ✅ | 3.03ms 🟢 | 380.22ms 🟡 | 383.25ms 🟡 |
|
|
189
|
+
| 15 | ✅ | 2.28ms 🟢 | 4.71ms 🟢 | 6.99ms 🟢 |
|
|
190
|
+
| 16 | ✅ | 80.55ms 🟢 | 124.54ms 🟡 | 205.09ms 🟡 |
|
|
191
|
+
| 17 | ✅ | 0.02ms 🟢 | 19.99ms 🟢 | 20.01ms 🟢 |
|
|
192
|
+
| 18 | ✅ | 5.66ms 🟢 | 6.98s 🔴 | 6.99s 🔴 |
|
|
193
|
+
| 19 | ✅ | 9.05ms 🟢 | 99.83ms 🟢 | 108.88ms 🟡 |
|
|
194
|
+
| 20 | ✅ | 47.46s 🔴 | 4.28s 🔴 | 51.74s 🔴 |
|
|
195
|
+
| 21 | ✅ | 0.22ms 🟢 | 0.25ms 🟢 | 0.47ms 🟢 |
|
|
196
|
+
| 22 | ✅ | 603.65ms 🟡 | 1.87s 🔴 | 2.47s 🔴 |
|
|
197
|
+
| 23 | ✅ | 223.80ms 🟡 | 222.87ms 🟡 | 446.67ms 🟡 |
|
|
198
|
+
| 24 | ⚠️ | 0.94ms 🟢 | - | 0.94ms 🟢 |
|
|
199
|
+
| 25 | ✅ | 6.02ms 🟢 | - | 6.02ms 🟢 |
|
|
200
|
+
| **Total** | | 48.60s 🔴 | 20.34s 🔴 | 68.94s 🔴 |
|
|
177
201
|
|
|
178
202
|
Legend:
|
|
179
203
|
* 🟢 < 100ms
|
|
180
204
|
* 🟡 100ms - 1s
|
|
181
205
|
* 🔴 > 1s
|
|
206
|
+
<!-- BENCHMARK_RESULTS_END -->
|
|
182
207
|
|
|
208
|
+
## Using AoC class
|
|
183
209
|
|
|
184
|
-
|
|
210
|
+
Alternatively, you can build your own workflow using the lower level AoC class
|
|
185
211
|
|
|
186
212
|
```python
|
|
187
213
|
from adventofcode import AoC
|
|
@@ -199,7 +225,10 @@ aoc.print_p2() # prints the second part of the puzzle
|
|
|
199
225
|
aoc.submit_p2('part 2 answer') # submits the answer to the second part of the puzzle
|
|
200
226
|
```
|
|
201
227
|
|
|
202
|
-
|
|
203
228
|
### Happy solving 🎄
|
|
204
229
|
|
|
205
230
|
Enjoy and have fun!
|
|
231
|
+
|
|
232
|
+
### Similar projects
|
|
233
|
+
|
|
234
|
+
* [elf](https://pypi.org/project/elf/)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
adventofcode/__about__.py,sha256=wGmaA_0Eg5qc78mtYjz-_fyRfOYHu9H04iEm3hScm1A,21
|
|
2
|
+
adventofcode/__init__.py,sha256=Lyu-evu1YGwV94SThnt6-Bo4JP82Vt3JNRrCyjDd7w0,5533
|
|
3
|
+
adventofcode/cli.py,sha256=Ufj65ULzr_fz0l0NdnAVnIKcFgHAfP6LsRCWVd14qZ0,16422
|
|
4
|
+
adventofcode/utils.py,sha256=QJ2AanjoNt_yVI8VZM9plrl9cpHsEhl29NyA4Aqs8Ug,258
|
|
5
|
+
adventofcode-25.6.dist-info/METADATA,sha256=h1TYaCPYykDZOMoKgxjZK8JhAkoYBOtIvxnx5J1LJmc,7655
|
|
6
|
+
adventofcode-25.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
+
adventofcode-25.6.dist-info/entry_points.txt,sha256=Yw9pyDrVVS3XWRcjOv1BnAxkqtJdYoG747A1LysScak,83
|
|
8
|
+
adventofcode-25.6.dist-info/licenses/LICENSE,sha256=7w16SgIHVGYHh8TS_-XnKFvY6aKa_JDtVFoduWtIPTY,1069
|
|
9
|
+
adventofcode-25.6.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
adventofcode/__about__.py,sha256=u2olrcoiSx_e5LUioBrBIIk8i2hhHig6-r7KQ0xo4N4,21
|
|
2
|
-
adventofcode/__init__.py,sha256=Lyu-evu1YGwV94SThnt6-Bo4JP82Vt3JNRrCyjDd7w0,5533
|
|
3
|
-
adventofcode/cli.py,sha256=Ufj65ULzr_fz0l0NdnAVnIKcFgHAfP6LsRCWVd14qZ0,16422
|
|
4
|
-
adventofcode/utils.py,sha256=QJ2AanjoNt_yVI8VZM9plrl9cpHsEhl29NyA4Aqs8Ug,258
|
|
5
|
-
adventofcode-25.4.dist-info/METADATA,sha256=jQrNv1BQ4lcLrmjQMP7mAppw7z-kFAqCp6jhK6pPYmk,6494
|
|
6
|
-
adventofcode-25.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
-
adventofcode-25.4.dist-info/entry_points.txt,sha256=Yw9pyDrVVS3XWRcjOv1BnAxkqtJdYoG747A1LysScak,83
|
|
8
|
-
adventofcode-25.4.dist-info/licenses/LICENSE,sha256=7w16SgIHVGYHh8TS_-XnKFvY6aKa_JDtVFoduWtIPTY,1069
|
|
9
|
-
adventofcode-25.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|