1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "tasks": [
10 {
11 "name": "inline-yaml",
12 "inputData": """name: John Doe
13age: 30
14roles:
15 - admin
16 - editor""",
17 },
18 {
19 "name": "inline-json",
20 "inputData": "{\"service\":\"api\",\"enabled\":true,\"replicas\":2}",
21 },
22 {
23 "name": "inline-toml",
24 "inputData": """title = \"Example\"
25[owner]
26name = \"Ada\"""",
27 },
28 {
29 "name": "yaml-stream",
30 "inputData": """---
31kind: ConfigMap
32metadata:
33 name: app-config
34---
35kind: Secret
36metadata:
37 name: app-secret
38""",
39 },
40 {
41 "name": "public-config",
42 "inputUrl": "https://raw.githubusercontent.com/apify/crawlee/master/package.json",
43 },
44 ],
45 "operation": "validate",
46 "outputFormat": "json",
47 "jsonIndent": 2,
48 "stopOnError": False,
49 "includeOriginal": False,
50}
51
52
53run = client.actor("maximedupre/yaml-validator-converter").call(run_input=run_input)
54
55
56print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
57for item in client.dataset(run["defaultDatasetId"]).iterate_items():
58 print(item)
59
60