noshot 0.1.4__py3-none-any.whl → 0.1.5__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.
noshot/main.py CHANGED
@@ -9,8 +9,8 @@ def get(name = None, open = False):
9
9
  try:
10
10
  if name is not None:
11
11
  name = str(name)
12
- if name in ['-1'] : get_folder("ML TS XAI", loc = True)
13
- elif name in ['0'] : remove_folder()
12
+ if name in ['-1'] : get_folder("ML TS XAI", loc = True)
13
+ elif name in ['0'] : remove_folder("ML TS XAI")
14
14
  else:
15
15
  for k, v in available.items():
16
16
  sep = " : " if v else ""
@@ -3,8 +3,8 @@ import shutil
3
3
  import subprocess
4
4
  import pathlib
5
5
 
6
- def get_folder(folder_path = "ML TS XAI", loc = False):
7
- src = os.path.join(os.path.realpath(__file__)[:-20], "data", folder_path)
6
+ def get_folder(folder_path, loc = False):
7
+ src = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", pathlib.Path(folder_path))
8
8
  try:
9
9
  dest = os.path.join(os.getcwd(), pathlib.Path(folder_path))
10
10
  shutil.copytree(src, dest, symlinks=False, copy_function = shutil.copy2,
@@ -24,7 +24,7 @@ def get_folder(folder_path = "ML TS XAI", loc = False):
24
24
  print("Path:",dest)
25
25
 
26
26
  def get_file(file_path, loc = False, open = False):
27
- src = os.path.realpath(os.path.join("./src/noshot/data", file_path))
27
+ src = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", pathlib.Path(file_path))
28
28
  try:
29
29
  dest = os.path.join(os.getcwd(), pathlib.Path(file_path).name)
30
30
  shutil.copy(src, dest)
@@ -40,15 +40,18 @@ def get_file(file_path, loc = False, open = False):
40
40
  if loc:
41
41
  print("Path:",dest)
42
42
 
43
- def remove_folder(folder_path = "ML TS XAI"):
43
+ def remove_folder(folder_path):
44
44
  try:
45
- shutil.rmtree(os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(folder_path)),
46
- ignore_errors = True)
47
- shutil.rmtree(os.path.join(os.getcwd(), pathlib.Path(folder_path)))
48
- print("Folder removed successfully")
49
- return True
50
- except WindowsError as error:
51
- print("Failed to delete!\nClose and reopen Jupyter Notebook and run this again")
52
- return False
45
+ src1 = os.path.join(os.getcwd(), pathlib.Path(folder_path))
46
+ src2 = os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(folder_path))
47
+ if os.path.exists(src1) or os.path.exists(src2):
48
+ shutil.rmtree(src1, ignore_errors = True)
49
+ shutil.rmtree(src2, ignore_errors = True)
50
+ if os.path.exists(src1) or os.path.exists(src2):
51
+ print("Deletion Impossible [File Not Closed - Shutdown File Kernel]\nGo to Home page -> Running Tab -> Click Shut Down All")
52
+ else:
53
+ print(f"Folder({pathlib.Path(folder_path)}) Removed Successfully")
54
+ else:
55
+ print(f"Folder({pathlib.Path(folder_path)}) Not Found [Repeated Iteration | Probably Removed Manually]")
53
56
  except Exception as error:
54
57
  print(error)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: noshot
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
5
  Author: Tim Stan S
6
6
  License: MIT
@@ -32,7 +32,7 @@ Dynamic: summary
32
32
  ![Static Badge](https://img.shields.io/badge/OneShotCoding-NoShot-blue?logoColor=yell)
33
33
  [![PyPI - Version](https://img.shields.io/pypi/v/noshot)](https://pypi.org/project/noshot)
34
34
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/suganthangnanavelan/one-shot-coding/blob/main/LICENSE.txt)
35
- [![Pepy Total Downloads](https://img.shields.io/pepy/dt/noshot)](https://pypi.org/project/noshot)
35
+ [![Pepy Total Downloads](https://img.shields.io/pepy/dt/noshot)](https://pepy.tech/projects/noshot)
36
36
  ![Python Versions](https://img.shields.io/pypi/pyversions/noshot.svg?logo=python&color=yellow)
37
37
  ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/suganthangnanavelan/one-shot-coding/test.yml)
38
38
 
@@ -52,4 +52,4 @@ Dynamic: summary
52
52
  ## 📦 **Installation**
53
53
  Install latest version via `pip`:
54
54
  ```sh
55
- pip install noshot==0.1.4
55
+ pip install noshot==0.1.5
@@ -1,5 +1,5 @@
1
1
  noshot/__init__.py,sha256=000R40tii8lDFU8C1fBaD3SOnxD0PWRNWZU-km49YrU,21
2
- noshot/main.py,sha256=B-S8Sm66z_eJv9zml7GVvgpECnGeO1_1gLmlidyXqeo,639
2
+ noshot/main.py,sha256=FG_DlXpjZaN3bOeuhlZdqaxHkuAUjjLQGpR9bGx5Fc4,645
3
3
  noshot/data/ML TS XAI/Ubuntu CN Lab.iso,sha256=CkoX_H3nGO6EqfK3Qa62mt_vYNpmMOzKU0oCcBJQ41M,4589568
4
4
  noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(A) Breadth First Search.ipynb,sha256=Xde_I0zbFZb4SmiAYDzH7ft6JBFBvGkpv48X2I_LGiQ,3548
5
5
  noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(B) Depth First Search.ipynb,sha256=pfZ8D_bQiqxt_qLoWlQjwK8mbblh053AupAwxyyEhrM,3535
@@ -208,9 +208,9 @@ noshot/data/ML TS XAI/NLP/NLP 6/4. Hinddle and Rooth.ipynb,sha256=E5TYdhHCAOlUIV
208
208
  noshot/data/ML TS XAI/NLP/NLP 6/7. PCFG using CYK.ipynb,sha256=gOb9b8dUslegyuGVXjm4BB9XSKFgIME-ZfkjFrUhoAk,8735
209
209
  noshot/data/ML TS XAI/NLP/NLP 6/8. BOW and TF-IDF.ipynb,sha256=xgey9ML4zdVWOEg8wkEuWsM20Pz1-amMzcIt7IH9RFs,11133
210
210
  noshot/utils/__init__.py,sha256=QVrN1ZpzPXxZqDOqot5-t_ulFjZXVx7Cvr-Is9AK0po,110
211
- noshot/utils/shell_utils.py,sha256=n_EU1etspEb3WH4TguFdMgQlRoeq-AWaL4xE0XP_vuA,2253
212
- noshot-0.1.4.dist-info/LICENSE.txt,sha256=fgCruaVm5cUjFGOeEoGIimT6nnUunBqcNZHpGzK8TSw,1086
213
- noshot-0.1.4.dist-info/METADATA,sha256=E_UqtwNztFe7zt3hF3xA3H52Q1vBROIzMnBkjBYizrQ,2451
214
- noshot-0.1.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
215
- noshot-0.1.4.dist-info/top_level.txt,sha256=UL-c0HffdRwohz-y9icY_rnY48pQDdxGcBsgyCKh2Q8,7
216
- noshot-0.1.4.dist-info/RECORD,,
211
+ noshot/utils/shell_utils.py,sha256=-XfgYlNQlULa_rRJ3vsfTns4m_jiueGEj396J_y0Gus,2611
212
+ noshot-0.1.5.dist-info/LICENSE.txt,sha256=fgCruaVm5cUjFGOeEoGIimT6nnUunBqcNZHpGzK8TSw,1086
213
+ noshot-0.1.5.dist-info/METADATA,sha256=UId2D6UibRiyY-wn5m9jFcyc5DRDE6kq5hjt1ltgvtM,2453
214
+ noshot-0.1.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
215
+ noshot-0.1.5.dist-info/top_level.txt,sha256=UL-c0HffdRwohz-y9icY_rnY48pQDdxGcBsgyCKh2Q8,7
216
+ noshot-0.1.5.dist-info/RECORD,,
File without changes