aboutsummaryrefslogtreecommitdiff
path: root/v1/combine-feature-fragments.py
diff options
context:
space:
mode:
Diffstat (limited to 'v1/combine-feature-fragments.py')
-rwxr-xr-xv1/combine-feature-fragments.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/v1/combine-feature-fragments.py b/v1/combine-feature-fragments.py
new file mode 100755
index 0000000..bbc9913
--- /dev/null
+++ b/v1/combine-feature-fragments.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+# Run from repo root.
+
+import os
+
+featureDirs = os.listdir('./collection')
+
+beginning = """
+{
+ "features": [
+"""
+
+middle = ""
+
+end = """
+ ]
+}
+"""
+
+count = len(featureDirs)
+
+for fDir in featureDirs:
+ count -= 1
+ config = f'./collection/{fDir}/feature.json'
+ data = open(config, "r").read()
+ middle += f'{data}'
+ if count != 0:
+ middle += ','
+ middle += '\n'
+
+print(f'{beginning}{middle}{end}')