wtc-cli 1.0.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.
wtc/__init__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
wtc/main.py ADDED
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import pandas as pd
4
+ import argparse
5
+ import os
6
+ from datetime import datetime
7
+
8
+ VERSION = "1.0"
9
+
10
+ def main():
11
+ # -----------------------------
12
+ # CLI Argument Parser
13
+ # -----------------------------
14
+ parser = argparse.ArgumentParser(
15
+ description="Convert JIRA Excel to Worktop Format"
16
+ )
17
+
18
+ parser.add_argument("--input", help="Path to JIRA Excel file")
19
+ parser.add_argument("--output", help="Output file path (optional)")
20
+ parser.add_argument("--version", action="store_true")
21
+
22
+ args = parser.parse_args()
23
+
24
+ # -----------------------------
25
+ # Handle Version
26
+ # -----------------------------
27
+ if args.version:
28
+ print(f"Worktop Formatter Version: {VERSION}")
29
+ return
30
+
31
+ # -----------------------------
32
+ # Validate Input
33
+ # -----------------------------
34
+ if not args.input:
35
+ print("āŒ Error: --input is required")
36
+ return
37
+
38
+ jira_file = args.input
39
+
40
+ if not os.path.exists(jira_file):
41
+ raise FileNotFoundError(f"Input file does not exist: {jira_file}")
42
+
43
+ # -----------------------------
44
+ # Output File Handling
45
+ # -----------------------------
46
+ timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
47
+
48
+ if args.output:
49
+ output_file = args.output
50
+ else:
51
+ downloads_folder = os.path.join(os.path.expanduser("~"), "Downloads")
52
+ output_file = os.path.join(
53
+ downloads_folder,
54
+ f"formatted_worktop_output_{timestamp}.xlsx"
55
+ )
56
+
57
+ # -----------------------------
58
+ # # Read Excel
59
+ # # -----------------------------
60
+ # df_jira = pd.read_excel(jira_file)
61
+
62
+ # # -----------------------------
63
+ # # Validate Columns
64
+ # # -----------------------------
65
+ # required_columns = ["Issue key", "Summary", "Description"]
66
+
67
+ # missing_cols = [col for col in required_columns if col not in df_jira.columns]
68
+ # if missing_cols:
69
+ # raise ValueError(f"Missing columns in JIRA file: {missing_cols}")
70
+
71
+ # # -----------------------------
72
+ # # Transform
73
+ # # -----------------------------
74
+ # df_output = pd.DataFrame()
75
+
76
+ # df_output["user_story_id"] = df_jira["Issue key"]
77
+ # df_output["user_story_title"] = df_jira["Summary"]
78
+ # df_output["description"] = df_jira["Description"]
79
+
80
+ # df_output["datasource_project_name"] = "Timely Quote User Stories"
81
+ # df_output["work_item_type"] = "story"
82
+
83
+ # # -----------------------------
84
+ # # Save Output
85
+ # # -----------------------------
86
+ # df_output.to_excel(output_file, index=False, engine="openpyxl")
87
+
88
+ output_file = convert(jira_file, output_file)
89
+
90
+ print(f"\nāœ… File created successfully:\n{output_file}")
91
+
92
+
93
+ def convert(input_file, output_file=None):
94
+ # Read Excel
95
+ df_jira = pd.read_excel(input_file)
96
+
97
+ # Validate Columns
98
+ required_columns = ["Issue key", "Summary", "Description"]
99
+ missing_cols = [col for col in required_columns if col not in df_jira.columns]
100
+ if missing_cols:
101
+ raise ValueError(f"Missing columns in JIRA file: {missing_cols}")
102
+
103
+ # Transform
104
+ df_output = pd.DataFrame()
105
+ df_output["user_story_id"] = df_jira["Issue key"]
106
+ df_output["user_story_title"] = df_jira["Summary"]
107
+ df_output["description"] = df_jira["Description"]
108
+
109
+ df_output["datasource_project_name"] = "Timely Quote User Stories"
110
+ df_output["work_item_type"] = "story"
111
+
112
+ # Save Output
113
+ if not output_file:
114
+ timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
115
+ output_file = f"formatted_worktop_output_{timestamp}.xlsx"
116
+
117
+ df_output.to_excel(output_file, index=False, engine="openpyxl")
118
+
119
+ return str(output_file)
120
+
121
+
122
+ # āœ… THIS LINE IS VERY IMPORTANT
123
+ if __name__ == "__main__":
124
+ main()
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: wtc-cli
3
+ Version: 1.0.0
4
+ Summary: CLI tool to convert JIRA Excel into Worktop format
5
+ Home-page: https://github.com/anjancoforge/wtc-cli
6
+ Author: Anjani Kumar Chejarla
7
+ Requires-Dist: pandas
8
+ Requires-Dist: openpyxl
9
+ Dynamic: author
10
+ Dynamic: home-page
11
+ Dynamic: requires-dist
12
+ Dynamic: summary
@@ -0,0 +1,7 @@
1
+ wtc/__init__.py,sha256=Aj77VL1d5Mdku7sgCgKQmPuYavPpAHuZuJcy6bygQZE,21
2
+ wtc/main.py,sha256=wyQdchfpddBIdSTmLY8ZlHfM5NigOsu8A7dz9VaaL98,3719
3
+ wtc_cli-1.0.0.dist-info/METADATA,sha256=9HqnEet2fnxfD03oYKpQy_AZldvEJetcl9sazmtrb0A,313
4
+ wtc_cli-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
5
+ wtc_cli-1.0.0.dist-info/entry_points.txt,sha256=1o9KuOFRur1mEJEJbtSHWaVYPURPs0z1Dg2DN3egrs4,38
6
+ wtc_cli-1.0.0.dist-info/top_level.txt,sha256=05LOmeC5kIc9dVccmeu418j00P2Gwp8NiWGDrHfrHac,4
7
+ wtc_cli-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ wtc = wtc.main:main
@@ -0,0 +1 @@
1
+ wtc