1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "sessionId": "session-001",
10 "firstPassId": "first",
11 "recountPassId": "recount",
12 "cutOffEvidence": "comparable",
13 "baselineCoverage": "complete",
14 "baselineRows": [
15 {
16 "rowId": "b0",
17 "sessionId": "session-001",
18 "sku": "0001",
19 "locationId": "warehouse-A",
20 "lotId": "",
21 "unit": "each",
22 "quantity": "0",
23 },
24 {
25 "rowId": "b1",
26 "sessionId": "session-001",
27 "sku": "revised",
28 "locationId": "warehouse-A",
29 "lotId": "",
30 "unit": "each",
31 "quantity": "12.5",
32 },
33 {
34 "rowId": "b2",
35 "sessionId": "session-001",
36 "sku": "missing-second",
37 "locationId": "warehouse-A",
38 "lotId": "",
39 "unit": "each",
40 "quantity": "5",
41 },
42 {
43 "rowId": "b3",
44 "sessionId": "session-001",
45 "sku": "duplicate-counter",
46 "locationId": "warehouse-A",
47 "lotId": "",
48 "unit": "each",
49 "quantity": "7",
50 },
51 {
52 "rowId": "b4",
53 "sessionId": "session-001",
54 "sku": "tracked",
55 "locationId": "warehouse-A",
56 "lotId": "lot-01",
57 "unit": "each",
58 "quantity": "9",
59 },
60 {
61 "rowId": "b5",
62 "sessionId": "session-001",
63 "sku": "units",
64 "locationId": "warehouse-A",
65 "lotId": "",
66 "unit": "kg",
67 "quantity": "1.125",
68 },
69 ],
70 "countRows": [
71 {
72 "rowId": "c0",
73 "sessionId": "session-001",
74 "passId": "first",
75 "sku": "0001",
76 "locationId": "warehouse-A",
77 "lotId": "",
78 "unit": "each",
79 "countedQuantity": "0",
80 },
81 {
82 "rowId": "c1",
83 "sessionId": "session-001",
84 "passId": "recount",
85 "sku": "0001",
86 "locationId": "warehouse-A",
87 "lotId": "",
88 "unit": "each",
89 "countedQuantity": "0.000",
90 },
91 {
92 "rowId": "c2",
93 "sessionId": "session-001",
94 "passId": "first",
95 "sku": "revised",
96 "locationId": "warehouse-A",
97 "lotId": "",
98 "unit": "each",
99 "countedQuantity": "12",
100 },
101 {
102 "rowId": "c3",
103 "sessionId": "session-001",
104 "passId": "recount",
105 "sku": "revised",
106 "locationId": "warehouse-A",
107 "lotId": "",
108 "unit": "each",
109 "countedQuantity": "12.5",
110 },
111 {
112 "rowId": "c4",
113 "sessionId": "session-001",
114 "passId": "first",
115 "sku": "missing-second",
116 "locationId": "warehouse-A",
117 "lotId": "",
118 "unit": "each",
119 "countedQuantity": "5",
120 },
121 {
122 "rowId": "c5",
123 "sessionId": "session-001",
124 "passId": "first",
125 "sku": "duplicate-counter",
126 "locationId": "warehouse-A",
127 "lotId": "",
128 "unit": "each",
129 "countedQuantity": "7",
130 },
131 {
132 "rowId": "c6",
133 "sessionId": "session-001",
134 "passId": "first",
135 "sku": "duplicate-counter",
136 "locationId": "warehouse-A",
137 "lotId": "",
138 "unit": "each",
139 "countedQuantity": "7",
140 },
141 {
142 "rowId": "c7",
143 "sessionId": "session-001",
144 "passId": "recount",
145 "sku": "duplicate-counter",
146 "locationId": "warehouse-A",
147 "lotId": "",
148 "unit": "each",
149 "countedQuantity": "7",
150 },
151 {
152 "rowId": "c8",
153 "sessionId": "session-001",
154 "passId": "first",
155 "sku": "tracked",
156 "locationId": "warehouse-A",
157 "lotId": "",
158 "unit": "each",
159 "countedQuantity": "9",
160 },
161 {
162 "rowId": "c9",
163 "sessionId": "session-001",
164 "passId": "recount",
165 "sku": "tracked",
166 "locationId": "warehouse-A",
167 "lotId": "",
168 "unit": "each",
169 "countedQuantity": "9",
170 },
171 {
172 "rowId": "c10",
173 "sessionId": "session-001",
174 "passId": "first",
175 "sku": "units",
176 "locationId": "warehouse-A",
177 "lotId": "",
178 "unit": "g",
179 "countedQuantity": "1125",
180 },
181 {
182 "rowId": "c11",
183 "sessionId": "session-001",
184 "passId": "recount",
185 "sku": "units",
186 "locationId": "warehouse-A",
187 "lotId": "",
188 "unit": "g",
189 "countedQuantity": "1125",
190 },
191 {
192 "rowId": "c12",
193 "sessionId": "session-001",
194 "passId": "first",
195 "sku": "count-only",
196 "locationId": "warehouse-A",
197 "lotId": "",
198 "unit": "each",
199 "countedQuantity": "0.1",
200 },
201 {
202 "rowId": "c13",
203 "sessionId": "session-001",
204 "passId": "recount",
205 "sku": "count-only",
206 "locationId": "warehouse-A",
207 "lotId": "",
208 "unit": "each",
209 "countedQuantity": "0.2",
210 },
211 {
212 "rowId": "other-session",
213 "sessionId": "another-session",
214 "passId": "first",
215 "sku": "0001",
216 "locationId": "warehouse-A",
217 "lotId": "",
218 "unit": "each",
219 "countedQuantity": "99",
220 },
221 {
222 "rowId": "other-pass",
223 "sessionId": "session-001",
224 "passId": "ignored",
225 "sku": "0001",
226 "locationId": "warehouse-A",
227 "lotId": "",
228 "unit": "each",
229 "countedQuantity": "88",
230 },
231 ],
232 "baselineCsv": "",
233 "countsCsv": "",
234 "baselineColumns": {
235 "rowId": "rowId",
236 "sessionId": "sessionId",
237 "sku": "sku",
238 "locationId": "locationId",
239 "lotId": "lotId",
240 "unit": "unit",
241 "quantity": "quantity",
242 },
243 "countColumns": {
244 "rowId": "rowId",
245 "sessionId": "sessionId",
246 "passId": "passId",
247 "sku": "sku",
248 "locationId": "locationId",
249 "lotId": "lotId",
250 "unit": "unit",
251 "countedQuantity": "countedQuantity",
252 },
253}
254
255
256run = client.actor("h_murdock/count-pass-consistency-evidence").call(run_input=run_input)
257
258
259print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
260for item in client.dataset(run.default_dataset_id).iterate_items():
261 print(item)
262
263