Core
Provide the shared types, constants and building primitives.
BuildError
Bases: ValueError
Raised when a builder cannot turn its arguments into the object asked for.
format_event_time(event_time)
Render an event time as the whole-minute token used in column names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_time
|
Timedelta
|
A time delta, e.g. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The token, e.g. |
Source code in src/sportsbet/core/_utils.py
11 12 13 14 15 16 17 18 19 20 21 | |
load_object(reference)
Return the object a reference names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference
|
str
|
A string with a path to a Python file and the name of an object inside it, separated by a colon. |
required |
Returns:
| Type | Description |
|---|---|
object
|
The object the reference names. |
Raises:
| Type | Description |
|---|---|
BuildError
|
If the reference is malformed, the file is missing or unreadable, or it has no such object. |
Source code in src/sportsbet/core/_utils.py
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 | |
parse_event_time(token)
Read the whole-minute token used in column names back into a time delta.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
A whole-minute token, e.g. |
required |
Returns:
| Type | Description |
|---|---|
Timedelta
|
The time delta the token names. |
Source code in src/sportsbet/core/_utils.py
24 25 26 27 28 29 30 31 32 33 | |