radiochart 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
radiochart/__init__.py
ADDED
File without changes
|
radiochart/cli.py
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
import argparse
|
2
|
+
import json
|
3
|
+
from graphviz import Digraph
|
4
|
+
import os
|
5
|
+
|
6
|
+
def load_json(filepath):
|
7
|
+
with open(filepath, 'r') as f:
|
8
|
+
return json.load(f)
|
9
|
+
|
10
|
+
def build_graph(tree, graph=None, parent=None):
|
11
|
+
if graph is None:
|
12
|
+
graph = Digraph(format='png')
|
13
|
+
graph.attr('node', shape='box', style='filled', fillcolor='lightgrey', fontname='Arial')
|
14
|
+
|
15
|
+
for node, children in tree.items():
|
16
|
+
graph.node(node)
|
17
|
+
if parent:
|
18
|
+
graph.edge(parent, node)
|
19
|
+
build_graph(children, graph, node)
|
20
|
+
|
21
|
+
return graph
|
22
|
+
|
23
|
+
def main():
|
24
|
+
parser = argparse.ArgumentParser(description="Generate a hierarchical radio chart from a JSON file")
|
25
|
+
parser.add_argument('--input', '-i', required=True, help='Input JSON file')
|
26
|
+
parser.add_argument('--output', '-o', default='radio_chart.png', help='Output image file name')
|
27
|
+
args = parser.parse_args()
|
28
|
+
|
29
|
+
data = load_json(args.input)
|
30
|
+
graph = build_graph(data)
|
31
|
+
|
32
|
+
output_path = os.path.splitext(args.output)[0]
|
33
|
+
graph.render(output_path, cleanup=True)
|
34
|
+
print(f"✅ Chart saved as {output_path}.png")
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: radiochart
|
3
|
+
Version: 0.1.0
|
4
|
+
Summary: CLI tool to generate Arma 3 radio frequency hierarchy charts
|
5
|
+
Author-email: KingCharlesVII <viikingcharles@gmail.com>
|
6
|
+
License: MIT
|
7
|
+
Requires-Python: >=3.7
|
8
|
+
Description-Content-Type: text/markdown
|
9
|
+
Requires-Dist: graphviz
|
10
|
+
|
11
|
+
# radio-chart-cli
|
12
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
radiochart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
radiochart/cli.py,sha256=Z7-3E_D3cs2QhtY6wzlHCNJdyPF4IApsZoQ9ntG_OQ0,1119
|
3
|
+
radiochart-0.1.0.dist-info/METADATA,sha256=wOnW7hqtaTZBSkF9OF_tlQMBxsjUPUsKhCrQUR2Jp4Q,312
|
4
|
+
radiochart-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
5
|
+
radiochart-0.1.0.dist-info/entry_points.txt,sha256=0YgYH_Sc1VwuKgcS1Vum6VAnn1e4HUyE9JLOHEYEB9w,51
|
6
|
+
radiochart-0.1.0.dist-info/top_level.txt,sha256=Q1BACtGLsnWStOzjTlXfurlbIBu5Wx6sbP-zZtLnXj8,11
|
7
|
+
radiochart-0.1.0.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
radiochart
|