Spaces:
Sleeping
Sleeping
Create ingest.py
Browse files
ingest.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
SCHEMA_FILE = Path(__file__).parent / "data_schema.json"
|
| 5 |
+
|
| 6 |
+
def load_schema() -> dict:
|
| 7 |
+
return json.loads(SCHEMA_FILE.read_text())
|
| 8 |
+
|
| 9 |
+
def ingest_physical_metrics(source: str) -> dict:
|
| 10 |
+
"""
|
| 11 |
+
Stub: Replace with real API / IoT / ERP integration.
|
| 12 |
+
"""
|
| 13 |
+
return {
|
| 14 |
+
"production": 1000,
|
| 15 |
+
"inventory": 200,
|
| 16 |
+
"transport_delay": 5
|
| 17 |
+
}
|