coderpad-py 2026.7.22__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.
- coderpad/__init__.py +1 -0
- coderpad/_dict_types.py +240 -0
- coderpad/async_client.py +810 -0
- coderpad/client.py +789 -0
- coderpad/exceptions.py +115 -0
- coderpad/py.typed +0 -0
- coderpad/transports.py +279 -0
- coderpad/types.py +1045 -0
- coderpad_py-2026.7.22.dist-info/METADATA +117 -0
- coderpad_py-2026.7.22.dist-info/RECORD +13 -0
- coderpad_py-2026.7.22.dist-info/WHEEL +5 -0
- coderpad_py-2026.7.22.dist-info/licenses/LICENSE +21 -0
- coderpad_py-2026.7.22.dist-info/top_level.txt +1 -0
coderpad/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""A library for the CoderPad Interview API."""
|
coderpad/_dict_types.py
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"""TypedDict types describing raw API response shapes."""
|
|
2
|
+
|
|
3
|
+
from typing import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class TeamDict(TypedDict):
|
|
7
|
+
"""A team within an organization."""
|
|
8
|
+
|
|
9
|
+
id: str
|
|
10
|
+
name: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PadInterviewerNotificationDict(TypedDict):
|
|
14
|
+
"""An interviewer notification associated with a pad."""
|
|
15
|
+
|
|
16
|
+
id: int
|
|
17
|
+
title: str
|
|
18
|
+
message: str
|
|
19
|
+
priority: str
|
|
20
|
+
request_id: str
|
|
21
|
+
auto_dismissed: bool
|
|
22
|
+
dismissed_at: str | None
|
|
23
|
+
useful: bool | None
|
|
24
|
+
created_at: str
|
|
25
|
+
updated_at: str
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class PadDict(TypedDict):
|
|
29
|
+
"""A CoderPad interview pad."""
|
|
30
|
+
|
|
31
|
+
id: str
|
|
32
|
+
title: str
|
|
33
|
+
state: str
|
|
34
|
+
owner_email: str
|
|
35
|
+
language: str | None
|
|
36
|
+
private: bool
|
|
37
|
+
execution_enabled: bool
|
|
38
|
+
contents: str | None
|
|
39
|
+
participants: list[str]
|
|
40
|
+
events: str
|
|
41
|
+
notes: str | None
|
|
42
|
+
created_at: str
|
|
43
|
+
updated_at: str
|
|
44
|
+
ended_at: str | None
|
|
45
|
+
url: str
|
|
46
|
+
playback: str
|
|
47
|
+
history: NotRequired[str]
|
|
48
|
+
drawing: str | None
|
|
49
|
+
type: str
|
|
50
|
+
question_ids: list[int]
|
|
51
|
+
pad_environment_ids: list[int]
|
|
52
|
+
active_environment_id: int | None
|
|
53
|
+
team: TeamDict
|
|
54
|
+
restrict_interviewer_access: NotRequired[bool]
|
|
55
|
+
pad_interviewer_notifications: NotRequired[
|
|
56
|
+
list[PadInterviewerNotificationDict]
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class PadEventDict(TypedDict):
|
|
61
|
+
"""An event associated with a pad."""
|
|
62
|
+
|
|
63
|
+
message: str
|
|
64
|
+
kind: str
|
|
65
|
+
metadata: str | None
|
|
66
|
+
user_name: str | None
|
|
67
|
+
user_email: str | None
|
|
68
|
+
created_at: str
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# An editor operation stored in a pad's Firebase history. The functional
|
|
72
|
+
# form prevents static analysis from treating its abbreviated wire keys as
|
|
73
|
+
# unused Python attributes.
|
|
74
|
+
PadHistoryEntryDict = TypedDict( # noqa: UP013
|
|
75
|
+
"PadHistoryEntryDict",
|
|
76
|
+
{
|
|
77
|
+
"a": str,
|
|
78
|
+
"o": list[int | str],
|
|
79
|
+
"t": int,
|
|
80
|
+
},
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class FileContentDict(TypedDict):
|
|
85
|
+
"""A file within a pad environment."""
|
|
86
|
+
|
|
87
|
+
path: str
|
|
88
|
+
contents: str | None
|
|
89
|
+
history: NotRequired[str]
|
|
90
|
+
binary: NotRequired[bool]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class PadEnvironmentDict(TypedDict):
|
|
94
|
+
"""A pad environment."""
|
|
95
|
+
|
|
96
|
+
id: int
|
|
97
|
+
pad_id: int
|
|
98
|
+
question_id: int | None
|
|
99
|
+
example_question_id: int | None
|
|
100
|
+
language: str
|
|
101
|
+
file_contents: list[FileContentDict]
|
|
102
|
+
created_at: str
|
|
103
|
+
updated_at: str
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class CandidateInstructionDict(TypedDict):
|
|
107
|
+
"""Instructions shown to a candidate."""
|
|
108
|
+
|
|
109
|
+
instructions: str
|
|
110
|
+
default_visible: NotRequired[bool]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class TestCaseDict(TypedDict):
|
|
114
|
+
"""A test case for a question."""
|
|
115
|
+
|
|
116
|
+
id: int
|
|
117
|
+
return_value: str
|
|
118
|
+
visible: bool
|
|
119
|
+
arguments: list[str]
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class CustomFileDict(TypedDict):
|
|
123
|
+
"""A custom file attached to a question."""
|
|
124
|
+
|
|
125
|
+
id: str
|
|
126
|
+
title: str
|
|
127
|
+
description: str
|
|
128
|
+
filename: str
|
|
129
|
+
filesize: str
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class CustomDatabaseColumnDict(TypedDict):
|
|
133
|
+
"""A column in a question's custom database schema."""
|
|
134
|
+
|
|
135
|
+
name: str
|
|
136
|
+
type: str
|
|
137
|
+
pk: bool
|
|
138
|
+
nn: bool
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class CustomDatabaseTableDict(TypedDict):
|
|
142
|
+
"""A table in a question's custom database schema."""
|
|
143
|
+
|
|
144
|
+
name: str
|
|
145
|
+
columns: list[CustomDatabaseColumnDict]
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class CustomDatabaseSchemaDict(TypedDict):
|
|
149
|
+
"""The structured schema for a question's custom database."""
|
|
150
|
+
|
|
151
|
+
arrangement: str
|
|
152
|
+
tables: list[CustomDatabaseTableDict]
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class CustomDatabaseDict(TypedDict):
|
|
156
|
+
"""A custom database attached to a question."""
|
|
157
|
+
|
|
158
|
+
id: int
|
|
159
|
+
title: str
|
|
160
|
+
description: str
|
|
161
|
+
language: str
|
|
162
|
+
schema: str
|
|
163
|
+
schema_json: CustomDatabaseSchemaDict
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class QuestionDict(TypedDict):
|
|
167
|
+
"""A CoderPad question."""
|
|
168
|
+
|
|
169
|
+
id: int
|
|
170
|
+
title: str
|
|
171
|
+
owner_email: str
|
|
172
|
+
language: str | None
|
|
173
|
+
description: str | None
|
|
174
|
+
candidate_instructions: list[CandidateInstructionDict]
|
|
175
|
+
contents: str | None
|
|
176
|
+
shared: bool
|
|
177
|
+
used: int
|
|
178
|
+
take_home: bool
|
|
179
|
+
test_cases_enabled: bool
|
|
180
|
+
solution: str | None
|
|
181
|
+
pad_type: str
|
|
182
|
+
is_draft: bool
|
|
183
|
+
author_name: str
|
|
184
|
+
organization_name: str
|
|
185
|
+
custom_files: list[CustomFileDict]
|
|
186
|
+
created_at: str
|
|
187
|
+
updated_at: str
|
|
188
|
+
public_take_home_setting_id: NotRequired[int]
|
|
189
|
+
contents_for_test_cases: NotRequired[str]
|
|
190
|
+
test_cases: NotRequired[list[TestCaseDict]]
|
|
191
|
+
custom_database: NotRequired[CustomDatabaseDict]
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class OrganizationUserDict(TypedDict):
|
|
195
|
+
"""A user within an organization."""
|
|
196
|
+
|
|
197
|
+
email: str
|
|
198
|
+
name: str
|
|
199
|
+
teams: list[str]
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class OrganizationStatsUserDict(TypedDict):
|
|
203
|
+
"""A user's pad usage statistics."""
|
|
204
|
+
|
|
205
|
+
email: str
|
|
206
|
+
name: str
|
|
207
|
+
pads_created: int
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
class QuotaDict(TypedDict):
|
|
211
|
+
"""Quota information."""
|
|
212
|
+
|
|
213
|
+
trial_expires_at: str
|
|
214
|
+
pads_used: int
|
|
215
|
+
quota_reset_at: str
|
|
216
|
+
unlimited: bool
|
|
217
|
+
overages_enabled: bool
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
class OrganizationDict(TypedDict):
|
|
221
|
+
"""Organization information."""
|
|
222
|
+
|
|
223
|
+
organization_name: str
|
|
224
|
+
user_count: int
|
|
225
|
+
users: list[OrganizationUserDict]
|
|
226
|
+
organization_default_language: str
|
|
227
|
+
single_sign_on_supported: bool
|
|
228
|
+
single_sign_in_url: NotRequired[str]
|
|
229
|
+
teams: list[TeamDict]
|
|
230
|
+
id: NotRequired[int]
|
|
231
|
+
child_organizations: NotRequired[list[dict[str, object]]]
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class OrganizationStatsDict(TypedDict):
|
|
235
|
+
"""Organization usage statistics."""
|
|
236
|
+
|
|
237
|
+
start_time: str
|
|
238
|
+
end_time: str
|
|
239
|
+
pads_created: int
|
|
240
|
+
users: list[OrganizationStatsUserDict]
|