1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "urls": ["https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registration_Card_for_Louis_Armstrong_1918.gif"],
10 "fields": [
11 {
12 "name": "full_name",
13 "type": "string",
14 },
15 {
16 "name": "date_of_birth",
17 "type": "date",
18 },
19 {
20 "name": "race",
21 "type": "string",
22 },
23 {
24 "name": "employer",
25 "type": "string",
26 },
27 {
28 "name": "signed",
29 "type": "boolean",
30 "description": "is it signed",
31 },
32 ],
33}
34
35
36run = client.actor("helenisapi/form-ocr-to-json-handwritten-printed-forms").call(run_input=run_input)
37
38
39print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
40for item in client.dataset(run.default_dataset_id).iterate_items():
41 print(item)
42
43