namgpt 1.0.1__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.
namgpt-1.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nguyen Nhat Nam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
namgpt-1.0.1/PKG-INFO ADDED
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.4
2
+ Name: namgpt
3
+ Version: 1.0.1
4
+ Summary: A beautiful CLI built with Typer, Rich and Questionary
5
+ Author: Nguyen Nhat Nam
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: typer
11
+ Requires-Dist: rich
12
+ Requires-Dist: questionary
13
+ Dynamic: license-file
14
+
15
+ # GPT CLI
16
+
17
+ CLI đầu tiên của mình được viết bằng **Python** và **Typer** để học cách xây dựng các ứng dụng dòng lệnh.
18
+
19
+ ## 📖 Giới thiệu
20
+
21
+ GPT CLI là một dự án học tập giúp mình làm quen với:
22
+
23
+ - Python
24
+ - Typer
25
+ - Command Line Interface (CLI)
26
+ - setup.py
27
+ - pip install
28
+ - GitHub
29
+
30
+ Dự án được tạo với mục đích học lập trình và tìm hiểu cách hoạt động của các công cụ như Git, npm và Vercel CLI.
31
+
32
+ ---
33
+
34
+ ## ✨ Tính năng
35
+
36
+ Hiện tại CLI hỗ trợ các lệnh:
37
+
38
+ - hello
39
+ - about
40
+ - version
41
+ - login
42
+ - logout
43
+ - add
44
+ - multiply
45
+ - age
46
+ - calc
47
+ - me
48
+
49
+ ---
50
+
51
+ ## 📦 Cài đặt
52
+
53
+ Clone dự án:
54
+
55
+ ```bash
56
+ git clone https://github.com/namnn2016-ops/CLI
57
+ ```
58
+
59
+ Di chuyển vào thư mục:
60
+
61
+ ```bash
62
+ cd gpt
63
+ ```
64
+
65
+ Cài đặt:
66
+
67
+ ```bash
68
+ python -m pip install -e .
69
+ ```
70
+
71
+ ---
72
+
73
+ ## 🚀 Cách sử dụng
74
+
75
+ ### Xin chào
76
+
77
+ ```bash
78
+ gpt hello Nam
79
+ ```
80
+
81
+ Kết quả:
82
+
83
+ ```text
84
+ Hello Nam!
85
+ ```
86
+
87
+ ---
88
+
89
+ ### Cộng hai số
90
+
91
+ ```bash
92
+ gpt add 10 20
93
+ ```
94
+
95
+ Kết quả:
96
+
97
+ ```text
98
+ 30
99
+ ```
100
+
101
+ ---
102
+
103
+ ### Nhân hai số
104
+
105
+ ```bash
106
+ gpt multiply 7 8
107
+ ```
108
+
109
+ Kết quả:
110
+
111
+ ```text
112
+ 56
113
+ ```
114
+
115
+ ---
116
+
117
+ ### Hiển thị phiên bản
118
+
119
+ ```bash
120
+ gpt version
121
+ ```
122
+
123
+ Kết quả:
124
+
125
+ ```text
126
+ 1.0.0
127
+ ```
128
+
129
+ ---
130
+
131
+ ### Giới thiệu
132
+
133
+ ```bash
134
+ gpt about
135
+ ```
136
+
137
+ ---
138
+
139
+ ### Đăng nhập
140
+
141
+ ```bash
142
+ gpt login
143
+ ```
144
+
145
+ ---
146
+
147
+ ### Đăng xuất
148
+
149
+ ```bash
150
+ gpt logout
151
+ ```
152
+
153
+ ---
154
+
155
+ ### Hiển thị thông tin
156
+
157
+ ```bash
158
+ gpt me
159
+ ```
160
+
161
+ ---
162
+
163
+ ## 📂 Cấu trúc dự án
164
+
165
+ ```
166
+ gpt/
167
+
168
+ ├── main.py
169
+ ├── setup.py
170
+ ├── README.md
171
+ └── .gitignore
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 🛠 Công nghệ sử dụng
177
+
178
+ - Python
179
+ - Typer
180
+ - setuptools
181
+
182
+ ---
183
+
184
+ ## 🎯 Mục tiêu
185
+
186
+ Đây là dự án học tập nhằm:
187
+
188
+ - Học Python
189
+ - Học CLI
190
+ - Học GitHub
191
+ - Chuẩn bị kiến thức để xây dựng các dự án lớn hơn trong tương lai.
192
+
193
+ ---
194
+
195
+ ## 👨‍💻 Tác giả
196
+
197
+ Nguyen Nhat Nam
198
+
199
+ Dự án được tạo để học lập trình Python và CLI.
200
+
201
+ ---
202
+
203
+ ## 📄 Giấy phép
204
+
205
+ MIT License
namgpt-1.0.1/README.md ADDED
@@ -0,0 +1,191 @@
1
+ # GPT CLI
2
+
3
+ CLI đầu tiên của mình được viết bằng **Python** và **Typer** để học cách xây dựng các ứng dụng dòng lệnh.
4
+
5
+ ## 📖 Giới thiệu
6
+
7
+ GPT CLI là một dự án học tập giúp mình làm quen với:
8
+
9
+ - Python
10
+ - Typer
11
+ - Command Line Interface (CLI)
12
+ - setup.py
13
+ - pip install
14
+ - GitHub
15
+
16
+ Dự án được tạo với mục đích học lập trình và tìm hiểu cách hoạt động của các công cụ như Git, npm và Vercel CLI.
17
+
18
+ ---
19
+
20
+ ## ✨ Tính năng
21
+
22
+ Hiện tại CLI hỗ trợ các lệnh:
23
+
24
+ - hello
25
+ - about
26
+ - version
27
+ - login
28
+ - logout
29
+ - add
30
+ - multiply
31
+ - age
32
+ - calc
33
+ - me
34
+
35
+ ---
36
+
37
+ ## 📦 Cài đặt
38
+
39
+ Clone dự án:
40
+
41
+ ```bash
42
+ git clone https://github.com/namnn2016-ops/CLI
43
+ ```
44
+
45
+ Di chuyển vào thư mục:
46
+
47
+ ```bash
48
+ cd gpt
49
+ ```
50
+
51
+ Cài đặt:
52
+
53
+ ```bash
54
+ python -m pip install -e .
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 🚀 Cách sử dụng
60
+
61
+ ### Xin chào
62
+
63
+ ```bash
64
+ gpt hello Nam
65
+ ```
66
+
67
+ Kết quả:
68
+
69
+ ```text
70
+ Hello Nam!
71
+ ```
72
+
73
+ ---
74
+
75
+ ### Cộng hai số
76
+
77
+ ```bash
78
+ gpt add 10 20
79
+ ```
80
+
81
+ Kết quả:
82
+
83
+ ```text
84
+ 30
85
+ ```
86
+
87
+ ---
88
+
89
+ ### Nhân hai số
90
+
91
+ ```bash
92
+ gpt multiply 7 8
93
+ ```
94
+
95
+ Kết quả:
96
+
97
+ ```text
98
+ 56
99
+ ```
100
+
101
+ ---
102
+
103
+ ### Hiển thị phiên bản
104
+
105
+ ```bash
106
+ gpt version
107
+ ```
108
+
109
+ Kết quả:
110
+
111
+ ```text
112
+ 1.0.0
113
+ ```
114
+
115
+ ---
116
+
117
+ ### Giới thiệu
118
+
119
+ ```bash
120
+ gpt about
121
+ ```
122
+
123
+ ---
124
+
125
+ ### Đăng nhập
126
+
127
+ ```bash
128
+ gpt login
129
+ ```
130
+
131
+ ---
132
+
133
+ ### Đăng xuất
134
+
135
+ ```bash
136
+ gpt logout
137
+ ```
138
+
139
+ ---
140
+
141
+ ### Hiển thị thông tin
142
+
143
+ ```bash
144
+ gpt me
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 📂 Cấu trúc dự án
150
+
151
+ ```
152
+ gpt/
153
+
154
+ ├── main.py
155
+ ├── setup.py
156
+ ├── README.md
157
+ └── .gitignore
158
+ ```
159
+
160
+ ---
161
+
162
+ ## 🛠 Công nghệ sử dụng
163
+
164
+ - Python
165
+ - Typer
166
+ - setuptools
167
+
168
+ ---
169
+
170
+ ## 🎯 Mục tiêu
171
+
172
+ Đây là dự án học tập nhằm:
173
+
174
+ - Học Python
175
+ - Học CLI
176
+ - Học GitHub
177
+ - Chuẩn bị kiến thức để xây dựng các dự án lớn hơn trong tương lai.
178
+
179
+ ---
180
+
181
+ ## 👨‍💻 Tác giả
182
+
183
+ Nguyen Nhat Nam
184
+
185
+ Dự án được tạo để học lập trình Python và CLI.
186
+
187
+ ---
188
+
189
+ ## 📄 Giấy phép
190
+
191
+ MIT License
namgpt-1.0.1/main.py ADDED
@@ -0,0 +1,135 @@
1
+ import typer
2
+ import questionary
3
+ import time
4
+ import json
5
+ import random
6
+ from rich.panel import Panel
7
+ from rich.console import Console
8
+ from rich.progress import Progress
9
+ console = Console()
10
+ app = typer.Typer()
11
+ @app.command()
12
+ def hello(name = typer.Option("bạn")):
13
+ typer.echo(f"hello {name}!")
14
+ @app.command()
15
+ def about():
16
+ typer.echo("Đây là CLI của Nam.")
17
+ @app.command()
18
+ def version():
19
+ typer.echo("1.0.0")
20
+ @app.command()
21
+ def login():
22
+ typer.echo("Đăng nhập thành công.")
23
+ @app.command()
24
+ def logout():
25
+ typer.echo("Đã đăng xuất.")
26
+ @app.command()
27
+ def add(a:int, b:int):
28
+ typer.echo(a + b)
29
+ @app.command()
30
+ def multiply(a:int, b:int):
31
+ typer.echo(a * b)
32
+ @app.command()
33
+ def age(name, age:int):
34
+ typer.echo(f"Xin chào {name}, bạn {age} tuổi.")
35
+ @app.command()
36
+ def calc(a:int, b:int):
37
+ typer.echo(f"{a} + {b} = {a + b}")
38
+ typer.echo(f"{a} - {b} = {a - b}")
39
+ typer.echo(f"{a} * {b} = {a * b}")
40
+ typer.echo(f"{a} / {b} = {a / b}")
41
+ @app.command()
42
+ def me():
43
+ typer.echo("Tên: Nam \n Tuổi: 10 \n Sở thích: Học CLI")
44
+ @app.command()
45
+ def bmi(weight: float = typer.Option(...), height: float = typer.Option(...)):
46
+ typer.echo(weight / (height ** 2))
47
+ @app.command()
48
+ def rectangle(width: int = typer.Option(...), height: int = typer.Option(...)):
49
+ typer.echo(f"Chiều dài: {height}\nChiều rộng: {width}\nDiện tích: {height * width}\nChu vi: {(height + width) * 2}")
50
+ @app.command()
51
+ def info(name = typer.Option("Nam"), age: int = typer.Option(10), hobby = typer.Option("Học CLI"), country = typer.Option("Việt Nam")):
52
+ typer.echo(f"Tên: {name}\nTuổi: {age}\nSở thích: {hobby}\nQuốc gia: {country}")
53
+ @app.command(name="random")
54
+ def random_naumber():
55
+ typer.echo(random.randint(1, 100))
56
+ @app.command()
57
+ def save():
58
+ data = {
59
+ "user":[
60
+ {
61
+ "username":"nam",
62
+ "tuoi":10,
63
+ "status": "logout"
64
+ }
65
+ ]
66
+ }
67
+ with open ("user.json", "w") as file:
68
+ json.dump(data, file, indent = 4)
69
+ @app.command()
70
+ def read():
71
+ with open ("user.json", "r") as file:
72
+ data = json.load(file)
73
+ typer.echo(data)
74
+ @app.command(name = "save-user")
75
+ def user(username: str, tuoi: int):
76
+ with open ("user.json", "r") as file:
77
+ data = json.load(file)
78
+ data["user"].append({
79
+ "username": username,
80
+ "tuoi": tuoi,
81
+ "status": 'logout'
82
+ })
83
+ with open("user.json", "w") as file:
84
+ json.dump(data, file, indent = 4)
85
+ @app.command()
86
+ def khoi_dong():
87
+ console.print(
88
+ Panel(
89
+ "[bold cyan]Chào mừng đến với NamGPT[/bold cyan]",
90
+ title="NamGPT",
91
+ subtitle="Version 1.0",
92
+ border_style="cyan"
93
+ )
94
+ )
95
+
96
+ # Hiệu ứng đang khởi động
97
+ with console.status("[yellow]Đang khởi động...[/yellow]", spinner="dots"):
98
+ time.sleep(2)
99
+
100
+ # Thanh tiến trình
101
+ with Progress() as progress:
102
+ task = progress.add_task("Đang tải...", total=100)
103
+
104
+ for _ in range(100):
105
+ time.sleep(0.03)
106
+ progress.update(task, advance=1)
107
+
108
+ console.print("[bold green]✓ Khởi động thành công![/bold green]")
109
+ @app.command()
110
+ def chon():
111
+
112
+ commands = {
113
+ "about": about,
114
+ "me": me,
115
+ "login": login,
116
+ "logout": logout,
117
+ "version": version,
118
+ }
119
+
120
+ while True:
121
+
122
+ choice = questionary.select(
123
+ "Chọn chức năng:",
124
+ choices=list(commands.keys())
125
+ ).ask()
126
+
127
+ sure = questionary.confirm(
128
+ f"Bạn chọn '{choice}'. Bạn có chắc không?"
129
+ ).ask()
130
+
131
+ if sure:
132
+ commands[choice]()
133
+ break
134
+ if __name__ == "__main__":
135
+ app()
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.4
2
+ Name: namgpt
3
+ Version: 1.0.1
4
+ Summary: A beautiful CLI built with Typer, Rich and Questionary
5
+ Author: Nguyen Nhat Nam
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: typer
11
+ Requires-Dist: rich
12
+ Requires-Dist: questionary
13
+ Dynamic: license-file
14
+
15
+ # GPT CLI
16
+
17
+ CLI đầu tiên của mình được viết bằng **Python** và **Typer** để học cách xây dựng các ứng dụng dòng lệnh.
18
+
19
+ ## 📖 Giới thiệu
20
+
21
+ GPT CLI là một dự án học tập giúp mình làm quen với:
22
+
23
+ - Python
24
+ - Typer
25
+ - Command Line Interface (CLI)
26
+ - setup.py
27
+ - pip install
28
+ - GitHub
29
+
30
+ Dự án được tạo với mục đích học lập trình và tìm hiểu cách hoạt động của các công cụ như Git, npm và Vercel CLI.
31
+
32
+ ---
33
+
34
+ ## ✨ Tính năng
35
+
36
+ Hiện tại CLI hỗ trợ các lệnh:
37
+
38
+ - hello
39
+ - about
40
+ - version
41
+ - login
42
+ - logout
43
+ - add
44
+ - multiply
45
+ - age
46
+ - calc
47
+ - me
48
+
49
+ ---
50
+
51
+ ## 📦 Cài đặt
52
+
53
+ Clone dự án:
54
+
55
+ ```bash
56
+ git clone https://github.com/namnn2016-ops/CLI
57
+ ```
58
+
59
+ Di chuyển vào thư mục:
60
+
61
+ ```bash
62
+ cd gpt
63
+ ```
64
+
65
+ Cài đặt:
66
+
67
+ ```bash
68
+ python -m pip install -e .
69
+ ```
70
+
71
+ ---
72
+
73
+ ## 🚀 Cách sử dụng
74
+
75
+ ### Xin chào
76
+
77
+ ```bash
78
+ gpt hello Nam
79
+ ```
80
+
81
+ Kết quả:
82
+
83
+ ```text
84
+ Hello Nam!
85
+ ```
86
+
87
+ ---
88
+
89
+ ### Cộng hai số
90
+
91
+ ```bash
92
+ gpt add 10 20
93
+ ```
94
+
95
+ Kết quả:
96
+
97
+ ```text
98
+ 30
99
+ ```
100
+
101
+ ---
102
+
103
+ ### Nhân hai số
104
+
105
+ ```bash
106
+ gpt multiply 7 8
107
+ ```
108
+
109
+ Kết quả:
110
+
111
+ ```text
112
+ 56
113
+ ```
114
+
115
+ ---
116
+
117
+ ### Hiển thị phiên bản
118
+
119
+ ```bash
120
+ gpt version
121
+ ```
122
+
123
+ Kết quả:
124
+
125
+ ```text
126
+ 1.0.0
127
+ ```
128
+
129
+ ---
130
+
131
+ ### Giới thiệu
132
+
133
+ ```bash
134
+ gpt about
135
+ ```
136
+
137
+ ---
138
+
139
+ ### Đăng nhập
140
+
141
+ ```bash
142
+ gpt login
143
+ ```
144
+
145
+ ---
146
+
147
+ ### Đăng xuất
148
+
149
+ ```bash
150
+ gpt logout
151
+ ```
152
+
153
+ ---
154
+
155
+ ### Hiển thị thông tin
156
+
157
+ ```bash
158
+ gpt me
159
+ ```
160
+
161
+ ---
162
+
163
+ ## 📂 Cấu trúc dự án
164
+
165
+ ```
166
+ gpt/
167
+
168
+ ├── main.py
169
+ ├── setup.py
170
+ ├── README.md
171
+ └── .gitignore
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 🛠 Công nghệ sử dụng
177
+
178
+ - Python
179
+ - Typer
180
+ - setuptools
181
+
182
+ ---
183
+
184
+ ## 🎯 Mục tiêu
185
+
186
+ Đây là dự án học tập nhằm:
187
+
188
+ - Học Python
189
+ - Học CLI
190
+ - Học GitHub
191
+ - Chuẩn bị kiến thức để xây dựng các dự án lớn hơn trong tương lai.
192
+
193
+ ---
194
+
195
+ ## 👨‍💻 Tác giả
196
+
197
+ Nguyen Nhat Nam
198
+
199
+ Dự án được tạo để học lập trình Python và CLI.
200
+
201
+ ---
202
+
203
+ ## 📄 Giấy phép
204
+
205
+ MIT License
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ main.py
4
+ pyproject.toml
5
+ namgpt.egg-info/PKG-INFO
6
+ namgpt.egg-info/SOURCES.txt
7
+ namgpt.egg-info/dependency_links.txt
8
+ namgpt.egg-info/entry_points.txt
9
+ namgpt.egg-info/requires.txt
10
+ namgpt.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ namgpt = main:app
@@ -0,0 +1,3 @@
1
+ typer
2
+ rich
3
+ questionary
@@ -0,0 +1 @@
1
+ main
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "namgpt"
7
+ version = "1.0.1"
8
+ description = "A beautiful CLI built with Typer, Rich and Questionary"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ { name = "Nguyen Nhat Nam" }
14
+ ]
15
+ dependencies = [
16
+ "typer",
17
+ "rich",
18
+ "questionary"
19
+ ]
20
+
21
+ [project.scripts]
22
+ namgpt = "main:app"
namgpt-1.0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+