umpaper-fetch 1.0.5__tar.gz → 1.0.6__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 (38) hide show
  1. {umpaper_fetch-1.0.5/umpaper_fetch.egg-info → umpaper_fetch-1.0.6}/PKG-INFO +15 -3
  2. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/README.md +14 -2
  3. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/pyproject.toml +1 -1
  4. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/setup.py +1 -1
  5. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/__init__.py +1 -1
  6. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/cli.py +34 -27
  7. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6/umpaper_fetch.egg-info}/PKG-INFO +15 -3
  8. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch.egg-info/top_level.txt +0 -1
  9. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/.gitignore +0 -0
  10. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/LICENSE +0 -0
  11. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/MANIFEST.in +0 -0
  12. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/auth/__init__.py +0 -0
  13. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/auth/chrome_fix.py +0 -0
  14. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/auth/um_authenticator.py +0 -0
  15. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/downloader/__init__.py +0 -0
  16. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/downloader/pdf_downloader.py +0 -0
  17. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/requirements.txt +0 -0
  18. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/scraper/__init__.py +0 -0
  19. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/scraper/paper_scraper.py +0 -0
  20. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/setup.cfg +0 -0
  21. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/auth/__init__.py +0 -0
  22. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/auth/chrome_fix.py +0 -0
  23. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/auth/um_authenticator.py +0 -0
  24. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/downloader/__init__.py +0 -0
  25. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/downloader/pdf_downloader.py +0 -0
  26. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/scraper/__init__.py +0 -0
  27. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/scraper/paper_scraper.py +0 -0
  28. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/utils/__init__.py +0 -0
  29. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/utils/logger.py +0 -0
  30. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch/utils/zip_creator.py +0 -0
  31. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch.egg-info/SOURCES.txt +0 -0
  32. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch.egg-info/dependency_links.txt +0 -0
  33. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch.egg-info/entry_points.txt +0 -0
  34. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch.egg-info/not-zip-safe +0 -0
  35. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/umpaper_fetch.egg-info/requires.txt +0 -0
  36. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/utils/__init__.py +0 -0
  37. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/utils/logger.py +0 -0
  38. {umpaper_fetch-1.0.5 → umpaper_fetch-1.0.6}/utils/zip_creator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: umpaper-fetch
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Automated downloader for University Malaya past year exam papers
5
5
  Home-page: https://github.com/MarcusMQF/umpaper-fetch
6
6
  Author: Marcus Mah
@@ -72,10 +72,14 @@ pip install --upgrade umpaper-fetch
72
72
 
73
73
  ### **Basic Usage**
74
74
  ```bash
75
- # Run the downloader
75
+ # See all available commands and options
76
+ python -m umpaper_fetch.cli --help
77
+
78
+ # Run the downloader interactively
76
79
  python -m umpaper_fetch.cli
77
80
 
78
- # Or with command-line shortcut (if available)
81
+ # Or with command-line shortcut (if install inside venv and activated)
82
+ um-papers --help
79
83
  um-papers
80
84
  ```
81
85
 
@@ -122,6 +126,10 @@ Follow the interactive prompts:
122
126
 
123
127
  #### **Interactive Mode (Recommended for beginners)**
124
128
  ```bash
129
+ # See all available options first
130
+ python -m umpaper_fetch.cli --help
131
+
132
+ # Run interactive mode
125
133
  python -m umpaper_fetch.cli
126
134
  ```
127
135
  *Prompts for all required information*
@@ -141,6 +149,7 @@ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt
141
149
  #### **Available Options**
142
150
  | Command | Short | Description | Default |
143
151
  |---------|-------|-------------|---------|
152
+ | `--help` | `-h` | Available command to use | |
144
153
  | `--username` | `-u` | UM username (without @siswa.um.edu.my) | *prompted* |
145
154
  | `--subject-code` | `-s` | Subject code to search for (e.g., WIA1005) | *prompted* |
146
155
  | `--output-dir` | `-o` | Custom download directory | `./downloads` |
@@ -283,6 +292,9 @@ python -m umpaper_fetch.cli -u your-username -s WXES1116 --browser edge --no-loc
283
292
  pip install umpaper-fetch
284
293
  python -m umpaper_fetch.cli
285
294
 
295
+ # Get help and see all options
296
+ python -m umpaper_fetch.cli --help
297
+
286
298
  # Quick download with subject code
287
299
  python -m umpaper_fetch.cli -s WIA1005
288
300
 
@@ -23,10 +23,14 @@ pip install --upgrade umpaper-fetch
23
23
 
24
24
  ### **Basic Usage**
25
25
  ```bash
26
- # Run the downloader
26
+ # See all available commands and options
27
+ python -m umpaper_fetch.cli --help
28
+
29
+ # Run the downloader interactively
27
30
  python -m umpaper_fetch.cli
28
31
 
29
- # Or with command-line shortcut (if available)
32
+ # Or with command-line shortcut (if install inside venv and activated)
33
+ um-papers --help
30
34
  um-papers
31
35
  ```
32
36
 
@@ -73,6 +77,10 @@ Follow the interactive prompts:
73
77
 
74
78
  #### **Interactive Mode (Recommended for beginners)**
75
79
  ```bash
80
+ # See all available options first
81
+ python -m umpaper_fetch.cli --help
82
+
83
+ # Run interactive mode
76
84
  python -m umpaper_fetch.cli
77
85
  ```
78
86
  *Prompts for all required information*
@@ -92,6 +100,7 @@ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt
92
100
  #### **Available Options**
93
101
  | Command | Short | Description | Default |
94
102
  |---------|-------|-------------|---------|
103
+ | `--help` | `-h` | Available command to use | |
95
104
  | `--username` | `-u` | UM username (without @siswa.um.edu.my) | *prompted* |
96
105
  | `--subject-code` | `-s` | Subject code to search for (e.g., WIA1005) | *prompted* |
97
106
  | `--output-dir` | `-o` | Custom download directory | `./downloads` |
@@ -234,6 +243,9 @@ python -m umpaper_fetch.cli -u your-username -s WXES1116 --browser edge --no-loc
234
243
  pip install umpaper-fetch
235
244
  python -m umpaper_fetch.cli
236
245
 
246
+ # Get help and see all options
247
+ python -m umpaper_fetch.cli --help
248
+
237
249
  # Quick download with subject code
238
250
  python -m umpaper_fetch.cli -s WIA1005
239
251
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "umpaper-fetch"
7
- version = "1.0.5"
7
+ version = "1.0.6"
8
8
  description = "Automated downloader for University Malaya past year exam papers"
9
9
  authors = [
10
10
  {name = "Marcus Mah", email = "marcusmah6969@gmail.com"}
@@ -29,7 +29,7 @@ except FileNotFoundError:
29
29
 
30
30
  setup(
31
31
  name="umpaper-fetch",
32
- version="1.0.5",
32
+ version="1.0.6",
33
33
  author="Marcus Mah", # Replace with your actual name
34
34
  author_email="marcusmah6969@gmail.com",
35
35
  description="Automated downloader for University Malaya past year exam papers",
@@ -5,7 +5,7 @@ This package provides tools to automatically download past year exam papers
5
5
  from University Malaya's repository through an automated browser interface.
6
6
  """
7
7
 
8
- __version__ = "1.0.5"
8
+ __version__ = "1.0.6"
9
9
  __author__ = "Marcus Mah"
10
10
  __email__ = "marcusmah6969@gmail.com"
11
11
  __description__ = "Automated downloader for University Malaya past year exam papers"
@@ -22,14 +22,28 @@ from .utils.logger import setup_logger
22
22
  def parse_arguments():
23
23
  """Parse command line arguments."""
24
24
  parser = argparse.ArgumentParser(
25
- description="Download all past year papers for a UM subject code",
25
+ prog="python -m umpaper_fetch.cli",
26
+ description="⬇️ UM PastYear Paper Downloader (CLI Tools)",
26
27
  formatter_class=argparse.RawDescriptionHelpFormatter,
28
+ usage=argparse.SUPPRESS,
27
29
  epilog="""
28
- Examples:
29
- um-papers
30
- um-papers --username 24012345 --subject-code WIA1005
31
- um-papers --username 24056789 --subject-code WXES1116 --show-browser
32
- um-papers --no-location-prompt --output-dir "C:/Downloads"
30
+ How to run:
31
+ python -m umpaper_fetch.cli # Interactive mode
32
+ um-papers # Alternative if install in virtual environment
33
+
34
+ Basic Examples:
35
+ python -m umpaper_fetch.cli -s WIA1005 # Download WIA1005 papers (will prompt for username/password)
36
+ python -m umpaper_fetch.cli -u your_username -s WIA1006 # Pre-specify username
37
+ python -m umpaper_fetch.cli -s CSC1025 --no-location-prompt # Use default Downloads folder
38
+
39
+ Batch Processing:
40
+ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt -o "./Papers/WIA1005"
41
+ python -m umpaper_fetch.cli -s WIA1006 --no-location-prompt -o "./Papers/WIA1006"
42
+
43
+ Advanced Options:
44
+ python -m umpaper_fetch.cli -s WIA1005 --show-browser # Show browser for debugging
45
+ python -m umpaper_fetch.cli -s WIA1005 --verbose # Enable detailed logging
46
+ python -m umpaper_fetch.cli -s WIA1005 --browser chrome # Use specific browser
33
47
  """
34
48
  )
35
49
 
@@ -41,32 +55,32 @@ Examples:
41
55
 
42
56
  parser.add_argument(
43
57
  '--subject-code', '-s',
44
- help='Subject code to search for (e.g., WIA1005)',
58
+ help='Subject code to search for (e.g., WIA1005, WIA1006, CSC1025)',
45
59
  type=str
46
60
  )
47
61
 
48
62
  parser.add_argument(
49
63
  '--output-dir', '-o',
50
- help='Output directory for downloads (default: ./downloads)',
51
- default='./downloads',
64
+ help='Output directory for downloads (default: ~/Downloads)',
65
+ default=str(Path.home() / 'Downloads'),
52
66
  type=str
53
67
  )
54
68
 
55
69
  parser.add_argument(
56
70
  '--no-location-prompt',
57
- help='Skip location selection prompt and use default output directory',
71
+ help='Skip location prompt, use default output directory',
58
72
  action='store_true'
59
73
  )
60
74
 
61
75
  parser.add_argument(
62
76
  '--show-browser',
63
- help='Show browser window (default is headless mode)',
77
+ help='Show browser window for debugging (default: headless)',
64
78
  action='store_true'
65
79
  )
66
80
 
67
81
  parser.add_argument(
68
82
  '--browser', '-b',
69
- help='Browser to use (auto, chrome, edge). Default: edge',
83
+ help='Browser to use: auto, chrome, edge (default: edge)',
70
84
  choices=['auto', 'chrome', 'edge'],
71
85
  default='edge',
72
86
  type=str
@@ -88,14 +102,14 @@ Examples:
88
102
 
89
103
  parser.add_argument(
90
104
  '--verbose', '-v',
91
- help='Enable verbose logging',
105
+ help='Enable detailed debug logging',
92
106
  action='store_true'
93
107
  )
94
108
 
95
109
  parser.add_argument(
96
110
  '--version',
97
111
  action='version',
98
- version='%(prog)s 1.0.5'
112
+ version='%(prog)s 1.0.6'
99
113
  )
100
114
 
101
115
  return parser.parse_args()
@@ -145,7 +159,7 @@ def get_download_location(default_output_dir):
145
159
  print("="*50)
146
160
  print(f"Default location: {default_output_dir.absolute()}")
147
161
  print("\nOptions:")
148
- print("1. Use default location (downloads folder)")
162
+ print("1. Use default location (user Downloads folder)")
149
163
  print("2. Choose custom location")
150
164
 
151
165
  while True:
@@ -308,11 +322,10 @@ def main():
308
322
  logger.info(f"✅ ZIP archive created: {zip_path}")
309
323
  print(f"\n🎉 Success! All papers downloaded and zipped:")
310
324
  print(f"📦 ZIP file: {zip_path}")
311
- print(f"📁 Individual files: {output_dir / subject_code}")
325
+ print(f"📁 Individual files: {output_dir}")
312
326
 
313
327
  # Ask if user wants to delete individual files
314
- subject_dir = output_dir / subject_code
315
- print(f"\n📁 Individual PDF files are still in: {subject_dir}")
328
+ print(f"\n📁 Individual PDF files are still in: {output_dir}")
316
329
  delete_confirm = input("Delete individual files to save space? (y/N): ").strip().lower()
317
330
  if delete_confirm in ['y', 'yes']:
318
331
  try:
@@ -328,13 +341,7 @@ def main():
328
341
  except Exception as file_error:
329
342
  logger.warning(f"Could not delete {file_path}: {file_error}")
330
343
 
331
- # Try to remove the subject directory if it's empty
332
- try:
333
- if subject_dir.exists() and not any(subject_dir.iterdir()):
334
- subject_dir.rmdir()
335
- logger.debug(f"Removed empty directory: {subject_dir}")
336
- except Exception as dir_error:
337
- logger.debug(f"Could not remove directory {subject_dir}: {dir_error}")
344
+ # Note: Individual files are stored directly in output_dir, not in subdirectory
338
345
 
339
346
  print(f"✅ Individual files deleted successfully ({deleted_count} files)")
340
347
  logger.info(f"Individual files deleted by user request ({deleted_count} files)")
@@ -346,7 +353,7 @@ def main():
346
353
  else:
347
354
  logger.warning("⚠️ ZIP creation failed, but individual files are available")
348
355
  print(f"\n⚠️ Papers downloaded but ZIP creation failed")
349
- print(f"📁 Individual files: {output_dir / subject_code}")
356
+ print(f"📁 Individual files: {output_dir}")
350
357
 
351
358
  # Cleanup
352
359
  authenticator.cleanup()
@@ -366,4 +373,4 @@ def main():
366
373
 
367
374
 
368
375
  if __name__ == "__main__":
369
- main()
376
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: umpaper-fetch
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Automated downloader for University Malaya past year exam papers
5
5
  Home-page: https://github.com/MarcusMQF/umpaper-fetch
6
6
  Author: Marcus Mah
@@ -72,10 +72,14 @@ pip install --upgrade umpaper-fetch
72
72
 
73
73
  ### **Basic Usage**
74
74
  ```bash
75
- # Run the downloader
75
+ # See all available commands and options
76
+ python -m umpaper_fetch.cli --help
77
+
78
+ # Run the downloader interactively
76
79
  python -m umpaper_fetch.cli
77
80
 
78
- # Or with command-line shortcut (if available)
81
+ # Or with command-line shortcut (if install inside venv and activated)
82
+ um-papers --help
79
83
  um-papers
80
84
  ```
81
85
 
@@ -122,6 +126,10 @@ Follow the interactive prompts:
122
126
 
123
127
  #### **Interactive Mode (Recommended for beginners)**
124
128
  ```bash
129
+ # See all available options first
130
+ python -m umpaper_fetch.cli --help
131
+
132
+ # Run interactive mode
125
133
  python -m umpaper_fetch.cli
126
134
  ```
127
135
  *Prompts for all required information*
@@ -141,6 +149,7 @@ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt
141
149
  #### **Available Options**
142
150
  | Command | Short | Description | Default |
143
151
  |---------|-------|-------------|---------|
152
+ | `--help` | `-h` | Available command to use | |
144
153
  | `--username` | `-u` | UM username (without @siswa.um.edu.my) | *prompted* |
145
154
  | `--subject-code` | `-s` | Subject code to search for (e.g., WIA1005) | *prompted* |
146
155
  | `--output-dir` | `-o` | Custom download directory | `./downloads` |
@@ -283,6 +292,9 @@ python -m umpaper_fetch.cli -u your-username -s WXES1116 --browser edge --no-loc
283
292
  pip install umpaper-fetch
284
293
  python -m umpaper_fetch.cli
285
294
 
295
+ # Get help and see all options
296
+ python -m umpaper_fetch.cli --help
297
+
286
298
  # Quick download with subject code
287
299
  python -m umpaper_fetch.cli -s WIA1005
288
300
 
@@ -2,7 +2,6 @@ auth
2
2
  dist
3
3
  docs
4
4
  downloader
5
- downloads
6
5
  logs
7
6
  scraper
8
7
  umpaper_fetch
File without changes
File without changes
File without changes
File without changes