Files
Inure/scripts/trackers/categories_parser.py
Hamza417 928038de29 Build100.2.0
- Fixed various issues with tracker details interface
2024-03-01 11:05:09 +05:30

21 lines
588 B
Python

import json
# Load the JSON file
with open('../../app/src/main/resources/trackers.json') as f:
data = json.load(f)
# Initialize an empty set to store unique categories
categories = set()
# Iterate over each tracker in the JSON data
for tracker in data['trackers'].values():
# Check if the "categories" field exists for the tracker
if 'categories' in tracker:
# If it does, add each category to the set
for category in tracker['categories']:
categories.add(category)
# Print all unique categories
for category in categories:
print(category)