Skip to content

Instantly share code, notes, and snippets.

@netdoggy
Created August 8, 2021 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netdoggy/39735c95d221421249eb0efdc55e4522 to your computer and use it in GitHub Desktop.
Save netdoggy/39735c95d221421249eb0efdc55e4522 to your computer and use it in GitHub Desktop.
sdrsharp to sdrpp frequency manager list converter
import xml.etree.ElementTree as ET
import json
tree = ET.parse('frequencies.xml')
root = tree.getroot()
freq_list = {}
for child in root:
name = child.find("Name").text
group = child.find("GroupName").text
frequency = child.find("Frequency").text
bandwidth = child.find("FilterBandwidth").text
if not freq_list.get(group):
freq_list[group] = {'bookmarks':{}, "showOnWaterfall": True}
freq_list[group]['bookmarks'][name] = {
"frequency": int(frequency),
"bandwidth": int(bandwidth),
"mode": 0
}
print(json.dumps({'bookmarkDisplayMode':1, 'lists':freq_list, "selectedList": list(freq_list.keys())[1]}, sort_keys=True, indent=4))
# > frequency_manager_config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment