vunghixuan 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.
- vunghixuan/__init__.py +1 -0
- vunghixuan/api_and_otp.py +23 -0
- vunghixuan/create_project.py +65 -0
- vunghixuan/main.py +30 -0
- vunghixuan-0.1.0.dist-info/METADATA +7 -0
- vunghixuan-0.1.0.dist-info/RECORD +9 -0
- vunghixuan-0.1.0.dist-info/WHEEL +5 -0
- vunghixuan-0.1.0.dist-info/entry_points.txt +2 -0
- vunghixuan-0.1.0.dist-info/top_level.txt +1 -0
vunghixuan/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
from .api_and_otp import APIKey, Otp
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# src/vunghixuan/create_project.py
|
2
|
+
import pyotp
|
3
|
+
class APIKey:
|
4
|
+
def __init__(self, key):
|
5
|
+
self.key = key
|
6
|
+
|
7
|
+
def get_api(self):
|
8
|
+
# Thực hiện các tác vụ của bạn
|
9
|
+
print(self.key)
|
10
|
+
|
11
|
+
class Otp:
|
12
|
+
def __init__(self):
|
13
|
+
pass
|
14
|
+
|
15
|
+
def get_otp(self, key):
|
16
|
+
# Thực hiện các tác vụ của bạn
|
17
|
+
topt = pyotp.TOTP(key)
|
18
|
+
print(topt.now())
|
19
|
+
|
20
|
+
# Đây là mã của pypi vunghixuan
|
21
|
+
def otp_vunghixuan(self):
|
22
|
+
key = 'OXATAFVTTUIVMXNQCKMZAOFZYUYE6MGZ'
|
23
|
+
self.get_otp(key)
|
@@ -0,0 +1,65 @@
|
|
1
|
+
|
2
|
+
# src/vunghixuan/create_project.py
|
3
|
+
import os
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
class Project:
|
7
|
+
def __init__(self):
|
8
|
+
self.root_path = Path(__file__).parent
|
9
|
+
# self.create_project()
|
10
|
+
|
11
|
+
# def create_project(self):
|
12
|
+
# for folder, content in structure.items():
|
13
|
+
# if isinstance(content, dict):
|
14
|
+
# folder_path = os.path.join(self.root_path, folder)
|
15
|
+
# os.makedirs(folder_path)
|
16
|
+
# self.create_project()
|
17
|
+
# else:
|
18
|
+
# with open(os.path.join(folder_path, 'models', '__init__.py'), 'w') as f:
|
19
|
+
# f.write("# Init file for models\n")
|
20
|
+
|
21
|
+
# Tạo ra folder
|
22
|
+
def create_folder(self, folder_path, name):
|
23
|
+
folder_path = os.path.join(folder_path, name)
|
24
|
+
os.makedirs(folder_path, exist_ok=True)
|
25
|
+
|
26
|
+
# Tạo ra folder apps
|
27
|
+
def create_project(self):
|
28
|
+
list_folder = ['apps', 'config', 'data_base']
|
29
|
+
for folder in list_folder:
|
30
|
+
self.create_folder(self.root_path, folder)
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
def create_app(self, app_name):
|
35
|
+
folder_path = os.path.join(self.root_path, 'apps')
|
36
|
+
|
37
|
+
if not os.path.exists(folder_path):
|
38
|
+
self.create_project()
|
39
|
+
self.create_app(app_name)
|
40
|
+
else:
|
41
|
+
self.create_folder(folder_path, app_name)
|
42
|
+
folder_path = os.path.join(self.root_path, 'apps', app_name)
|
43
|
+
|
44
|
+
list_folder = ['models', 'views', 'controlers']
|
45
|
+
for folder in list_folder:
|
46
|
+
self.create_folder(folder_path, folder)
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
if __name__=="__main__":
|
57
|
+
|
58
|
+
project = Project()
|
59
|
+
|
60
|
+
# 1. Tạo ra project
|
61
|
+
# project.create_project()
|
62
|
+
|
63
|
+
# 2. Tạo app
|
64
|
+
project.create_app('app1')
|
65
|
+
|
vunghixuan/main.py
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# src/vunghixuan/main.py
|
2
|
+
import sys
|
3
|
+
from .api_and_otp import APIKey, Otp
|
4
|
+
from .create_project import Project
|
5
|
+
|
6
|
+
def main():
|
7
|
+
args = sys.argv[1:]
|
8
|
+
if '-h' in args or '--help' in args:
|
9
|
+
print("Help message")
|
10
|
+
else:
|
11
|
+
key = args[1] if len(args) > 1 else None
|
12
|
+
if key:
|
13
|
+
if '-api' in args:
|
14
|
+
obj = APIKey(key)
|
15
|
+
obj.get_api()
|
16
|
+
if '-otp' in args or '-totp' in args:
|
17
|
+
obj = Otp(key)
|
18
|
+
obj.get_otp()
|
19
|
+
if '-create_project' in args :
|
20
|
+
obj = Project(key)
|
21
|
+
obj.create_project()
|
22
|
+
if '-create_app' in args :
|
23
|
+
obj = Project(key)
|
24
|
+
obj.create_app()
|
25
|
+
else:
|
26
|
+
print("Missing API key")
|
27
|
+
|
28
|
+
|
29
|
+
if __name__ == '__main__':
|
30
|
+
main()
|
@@ -0,0 +1,9 @@
|
|
1
|
+
vunghixuan/__init__.py,sha256=XJZldrnzPcJ9Okg129nZo82TDpxOm6amb5xAX5rkzyg,38
|
2
|
+
vunghixuan/api_and_otp.py,sha256=qmqVzLgnqYW1fFIpuh8PefTChiFXRHG3yhZb8aJwlZ8,568
|
3
|
+
vunghixuan/create_project.py,sha256=pniUYUCmZzJuxX9MwD1eBzoNrGqFizNnKNkpwG1IqHk,1833
|
4
|
+
vunghixuan/main.py,sha256=tqC9Kpr8RNwYdCrOrIOA808UgCyIofB-a7zUylyxCdg,843
|
5
|
+
vunghixuan-0.1.0.dist-info/METADATA,sha256=eaisUzUHJWs9Se-kciiV-877q00BHuE6W8Mj_RhI0hQ,176
|
6
|
+
vunghixuan-0.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
7
|
+
vunghixuan-0.1.0.dist-info/entry_points.txt,sha256=ItPfGjQnpyp6eR1oHdSbpfuf309GxCvEpX64UwBBTAU,52
|
8
|
+
vunghixuan-0.1.0.dist-info/top_level.txt,sha256=_Q6TIeNruS-ZEyAlP1gS80DCPggKksv8GoO396v9gr8,11
|
9
|
+
vunghixuan-0.1.0.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
vunghixuan
|