Names
NAME_EXAMPLE = 'YearYYYYDayDD'
module-attribute
The example of the name format.
get_key_by_name(name: str) -> Key
Gets the key representing the problem by the name of the solution type.
Note
The name
must match the format of NAME_EXAMPLE
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the solution type. |
required |
Returns:
Type | Description |
---|---|
Key
|
The key representing the problem. |
Raises:
Type | Description |
---|---|
TypeError
|
The |
ValueError
|
The year or the day is not valid. |
InternalError
|
The pattern was matched but |
Source code in aoc/names.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
get_name_by_key(key: Key) -> str
The inverse of get_key_by_name
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
Key
|
The key to create the name for. |
required |
Returns:
Type | Description |
---|---|
str
|
The name created. |
Source code in aoc/names.py
84 85 86 87 88 89 90 91 92 93 |
|