wtc-cli 1.0.0__tar.gz

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_cli-1.0.0/PKG-INFO ADDED
@@ -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,17 @@
1
+ # WTC CLI
2
+
3
+ CLI tool to convert JIRA Excel into Worktop format.
4
+
5
+ ## Installation
6
+
7
+ pip install wtc-cli
8
+
9
+ ## Usage
10
+
11
+ wtc --input input.xlsx
12
+
13
+ ## Version
14
+
15
+ wtc --version
16
+
17
+ ## new version
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
wtc_cli-1.0.0/setup.py ADDED
@@ -0,0 +1,16 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="wtc-cli",
5
+ version="1.0.0",
6
+ packages=find_packages(),
7
+ install_requires=["pandas", "openpyxl"],
8
+ entry_points={
9
+ "console_scripts": [
10
+ "wtc=wtc.main:main"
11
+ ]
12
+ },
13
+ author="Anjani Kumar Chejarla",
14
+ url="https://github.com/anjancoforge/wtc-cli",
15
+ description="CLI tool to convert JIRA Excel into Worktop format",
16
+ )
@@ -0,0 +1,17 @@
1
+ from wtc.main import convert
2
+ import pandas as pd
3
+ import os
4
+
5
+ def test_convert(tmp_path):
6
+ file = tmp_path / "input.xlsx"
7
+
8
+ df = pd.DataFrame({
9
+ "Issue key": ["ABC-1"],
10
+ "Summary": ["Test"],
11
+ "Description": ["Desc"]
12
+ })
13
+
14
+ df.to_excel(file, index=False)
15
+
16
+ output = convert(str(file))
17
+ assert os.path.exists(output)
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -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,12 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ tests/test_basic.py
5
+ wtc/__init__.py
6
+ wtc/main.py
7
+ wtc_cli.egg-info/PKG-INFO
8
+ wtc_cli.egg-info/SOURCES.txt
9
+ wtc_cli.egg-info/dependency_links.txt
10
+ wtc_cli.egg-info/entry_points.txt
11
+ wtc_cli.egg-info/requires.txt
12
+ wtc_cli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ wtc = wtc.main:main
@@ -0,0 +1,2 @@
1
+ pandas
2
+ openpyxl
@@ -0,0 +1 @@
1
+ wtc