test-graph2 0.2.0__tar.gz → 0.3.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.
Files changed (31) hide show
  1. {test_graph2-0.2.0 → test_graph2-0.3.0}/PKG-INFO +2 -2
  2. {test_graph2-0.2.0 → test_graph2-0.3.0}/pyproject.toml +3 -3
  3. {test_graph2-0.2.0 → test_graph2-0.3.0}/setup.py +3 -3
  4. {test_graph2-0.2.0 → test_graph2-0.3.0}/test_graph2.egg-info/PKG-INFO +2 -2
  5. test_graph2-0.3.0/test_graph2.egg-info/SOURCES.txt +27 -0
  6. test_graph2-0.3.0/test_mod/cli.py +90 -0
  7. test_graph2-0.2.0/test_graph2.egg-info/SOURCES.txt +0 -27
  8. test_graph2-0.2.0/test_mod/cli.py +0 -49
  9. {test_graph2-0.2.0 → test_graph2-0.3.0}/README.md +0 -0
  10. {test_graph2-0.2.0 → test_graph2-0.3.0}/setup.cfg +0 -0
  11. {test_graph2-0.2.0 → test_graph2-0.3.0}/test_graph2.egg-info/dependency_links.txt +0 -0
  12. {test_graph2-0.2.0 → test_graph2-0.3.0}/test_graph2.egg-info/entry_points.txt +0 -0
  13. {test_graph2-0.2.0 → test_graph2-0.3.0}/test_graph2.egg-info/requires.txt +0 -0
  14. {test_graph2-0.2.0 → test_graph2-0.3.0}/test_graph2.egg-info/top_level.txt +0 -0
  15. {test_graph2-0.2.0 → test_graph2-0.3.0}/test_mod/__init__.py +0 -0
  16. {test_graph2-0.2.0 → test_graph2-0.3.0}/test_mod/__main__.py +0 -0
  17. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/ai}/PR01(BFS).py +0 -0
  18. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/ai}/PR01(IDFS).py +0 -0
  19. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/ai}/PR02(A star).py +0 -0
  20. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/ai}/PR05(Adaboost).py +0 -0
  21. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/ai}/PR07(KNN).py +0 -0
  22. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/ai}/PR08(SVM).py +0 -0
  23. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR01(Column).py +0 -0
  24. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR01(Railfence).py +0 -0
  25. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR01(ceaser).py +0 -0
  26. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR01(monoalphabetic).py +0 -0
  27. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR02(ImpRSA).py +0 -0
  28. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR02(RSA).py +0 -0
  29. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR03(HMAC).py +0 -0
  30. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR04(DigitalSign).py +0 -0
  31. {test_graph2-0.2.0/test_mod/files → test_graph2-0.3.0/test_mod/files/cis}/PR05(Diffie).py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: test-graph2
3
- Version: 0.2.0
4
- Summary: AI, ML and Cryptography practical codes
3
+ Version: 0.3.0
4
+ Summary: AI, ML and Cryptography practical codes with sections support
5
5
  Author: Aquif Shaikh
6
6
  Requires-Python: >=3.8
7
7
  Description-Content-Type: text/markdown
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "test-graph2"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  authors = [
9
9
  { name="Aquif Shaikh" },
10
10
  ]
11
- description = "AI, ML and Cryptography practical codes"
11
+ description = "AI, ML and Cryptography practical codes with sections support"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.8"
14
14
  dependencies = [
@@ -25,4 +25,4 @@ where = ["."]
25
25
  include = ["test_mod*"]
26
26
 
27
27
  [tool.setuptools.package-data]
28
- "test_mod" = ["files/*.py"]
28
+ "test_mod" = ["files/**/*.py"]
@@ -2,12 +2,12 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="test-graph2",
5
- version="0.2.0",
5
+ version="0.3.0",
6
6
  author="Aquif Shaikh",
7
- description="AI, ML and Cryptography practical codes",
7
+ description="AI, ML and Cryptography practical codes with sections support",
8
8
  packages=find_packages(),
9
9
  package_data={
10
- "test_mod": ["files/*.py"],
10
+ "test_mod": ["files/**/*.py"],
11
11
  },
12
12
  include_package_data=True,
13
13
  entry_points={
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: test-graph2
3
- Version: 0.2.0
4
- Summary: AI, ML and Cryptography practical codes
3
+ Version: 0.3.0
4
+ Summary: AI, ML and Cryptography practical codes with sections support
5
5
  Author: Aquif Shaikh
6
6
  Requires-Python: >=3.8
7
7
  Description-Content-Type: text/markdown
@@ -0,0 +1,27 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ test_graph2.egg-info/PKG-INFO
5
+ test_graph2.egg-info/SOURCES.txt
6
+ test_graph2.egg-info/dependency_links.txt
7
+ test_graph2.egg-info/entry_points.txt
8
+ test_graph2.egg-info/requires.txt
9
+ test_graph2.egg-info/top_level.txt
10
+ test_mod/__init__.py
11
+ test_mod/__main__.py
12
+ test_mod/cli.py
13
+ test_mod/files/ai/PR01(BFS).py
14
+ test_mod/files/ai/PR01(IDFS).py
15
+ test_mod/files/ai/PR02(A star).py
16
+ test_mod/files/ai/PR05(Adaboost).py
17
+ test_mod/files/ai/PR07(KNN).py
18
+ test_mod/files/ai/PR08(SVM).py
19
+ test_mod/files/cis/PR01(Column).py
20
+ test_mod/files/cis/PR01(Railfence).py
21
+ test_mod/files/cis/PR01(ceaser).py
22
+ test_mod/files/cis/PR01(monoalphabetic).py
23
+ test_mod/files/cis/PR02(ImpRSA).py
24
+ test_mod/files/cis/PR02(RSA).py
25
+ test_mod/files/cis/PR03(HMAC).py
26
+ test_mod/files/cis/PR04(DigitalSign).py
27
+ test_mod/files/cis/PR05(Diffie).py
@@ -0,0 +1,90 @@
1
+ import os
2
+ import shutil
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ def extract_files(query=None, destination=None):
7
+ if destination is None:
8
+ destination = os.getcwd()
9
+
10
+ files_dir = Path(__file__).parent / "files"
11
+ if not files_dir.exists():
12
+ print("Error: Practical files directory not found.")
13
+ return
14
+
15
+ # Find all python files across all subdirectories/sections
16
+ all_files = list(files_dir.rglob("*.py"))
17
+
18
+ # If user wants a list
19
+ if query in ["--list", "-l", "list"]:
20
+ print("\n=== Available Sections & Practicals ===")
21
+ sections = {}
22
+ for f in all_files:
23
+ rel_path = f.relative_to(files_dir)
24
+ section = rel_path.parent.as_posix()
25
+ sections.setdefault(section, []).append(f.name)
26
+
27
+ for sec, files in sorted(sections.items()):
28
+ sec_name = sec if sec != "." else "root"
29
+ print(f"\n[Section: {sec_name}]")
30
+ for fname in sorted(files):
31
+ print(f" * {sec_name}/{fname} (or: {fname})")
32
+ print("\nUsage:")
33
+ print(" get-practicals ai/BFS -> Get specific file by section")
34
+ print(" get-practicals BFS -> Get file by name")
35
+ print(" get-practicals ai -> Get entire 'ai' section")
36
+ print(" get-practicals -> Get all files\n")
37
+ return
38
+
39
+ matched_files = []
40
+
41
+ if query:
42
+ q = query.strip().replace("\\", "/").lower()
43
+
44
+ # Case 1: Check if query matches "section/filename" (e.g. ai/bfs or ai/PR01(BFS).py)
45
+ if "/" in q:
46
+ sec_query, file_query = q.split("/", 1)
47
+ for f in all_files:
48
+ sec_part = f.relative_to(files_dir).parent.as_posix().lower()
49
+ file_part = f.name.lower()
50
+ if (sec_query in sec_part or sec_query == sec_part) and (file_query in file_part):
51
+ matched_files.append(f)
52
+
53
+ # Case 2: Query matches an entire section folder name (e.g. "ai" or "cis")
54
+ if not matched_files:
55
+ for f in all_files:
56
+ sec_part = f.relative_to(files_dir).parent.as_posix().lower()
57
+ if q == sec_part or q in sec_part.split("/"):
58
+ matched_files.append(f)
59
+
60
+ # Case 3: Query matches the filename anywhere (e.g. "BFS")
61
+ if not matched_files:
62
+ for f in all_files:
63
+ if q in f.name.lower():
64
+ matched_files.append(f)
65
+ else:
66
+ # No query: get all files
67
+ matched_files = all_files
68
+
69
+ if not matched_files:
70
+ print(f"\n[!] No practical found matching: '{query}'")
71
+ print("Tip: Run 'get-practicals --list' to see all available files and sections.\n")
72
+ return
73
+
74
+ print(f"\n--- Extracting ({len(matched_files)} file{'s' if len(matched_files) > 1 else ''}) ---")
75
+ created_files = []
76
+ for f in matched_files:
77
+ dest_file = Path(destination) / f.name
78
+ shutil.copy2(f, dest_file)
79
+ rel = f.relative_to(files_dir).as_posix()
80
+ created_files.append(f.name)
81
+ print(f" [+] Unpacked: {rel} -> {f.name}")
82
+
83
+ print(f"\n[OK] Done! {len(created_files)} file(s) saved to current directory.\n")
84
+
85
+ def main():
86
+ query = sys.argv[1] if len(sys.argv) > 1 else None
87
+ extract_files(query=query)
88
+
89
+ if __name__ == "__main__":
90
+ main()
@@ -1,27 +0,0 @@
1
- README.md
2
- pyproject.toml
3
- setup.py
4
- test_graph2.egg-info/PKG-INFO
5
- test_graph2.egg-info/SOURCES.txt
6
- test_graph2.egg-info/dependency_links.txt
7
- test_graph2.egg-info/entry_points.txt
8
- test_graph2.egg-info/requires.txt
9
- test_graph2.egg-info/top_level.txt
10
- test_mod/__init__.py
11
- test_mod/__main__.py
12
- test_mod/cli.py
13
- test_mod/files/PR01(BFS).py
14
- test_mod/files/PR01(Column).py
15
- test_mod/files/PR01(IDFS).py
16
- test_mod/files/PR01(Railfence).py
17
- test_mod/files/PR01(ceaser).py
18
- test_mod/files/PR01(monoalphabetic).py
19
- test_mod/files/PR02(A star).py
20
- test_mod/files/PR02(ImpRSA).py
21
- test_mod/files/PR02(RSA).py
22
- test_mod/files/PR03(HMAC).py
23
- test_mod/files/PR04(DigitalSign).py
24
- test_mod/files/PR05(Adaboost).py
25
- test_mod/files/PR05(Diffie).py
26
- test_mod/files/PR07(KNN).py
27
- test_mod/files/PR08(SVM).py
@@ -1,49 +0,0 @@
1
- import os
2
- import shutil
3
- import sys
4
- from pathlib import Path
5
-
6
- def extract_files(query=None, destination=None):
7
- if destination is None:
8
- destination = os.getcwd()
9
-
10
- files_dir = Path(__file__).parent / "files"
11
- if not files_dir.exists():
12
- print("Error: Practical files directory not found.")
13
- return
14
-
15
- all_files = list(files_dir.glob("*.py"))
16
-
17
- # Filter files if query is provided
18
- if query:
19
- query_lower = query.strip().lower()
20
- matched_files = [
21
- f for f in all_files if query_lower in f.name.lower()
22
- ]
23
- else:
24
- matched_files = all_files
25
-
26
- if not matched_files:
27
- print(f"\n[!] No practical found matching: '{query}'")
28
- print("Available files:")
29
- for f in all_files:
30
- print(f" - {f.name}")
31
- return
32
-
33
- print(f"\n--- Extracting Practical Files (Destination: {destination}) ---")
34
- created_files = []
35
- for file_path in matched_files:
36
- dest_file = Path(destination) / file_path.name
37
- shutil.copy2(file_path, dest_file)
38
- created_files.append(file_path.name)
39
- print(f" [+] Created: {file_path.name}")
40
-
41
- print(f"\n[OK] Successfully unpacked {len(created_files)} file(s) into current directory!\n")
42
-
43
- def main():
44
- # If an argument is provided, treat it as the search keyword (e.g. 'BFS', 'Diffie', 'RSA')
45
- query = sys.argv[1] if len(sys.argv) > 1 else None
46
- extract_files(query=query)
47
-
48
- if __name__ == "__main__":
49
- main()
File without changes
File without changes