umpaper-fetch 1.0.2__tar.gz → 1.0.4__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 (47) hide show
  1. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/.gitignore +17 -1
  2. umpaper_fetch-1.0.4/PKG-INFO +363 -0
  3. umpaper_fetch-1.0.4/README.md +314 -0
  4. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/pyproject.toml +1 -1
  5. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/setup.py +1 -1
  6. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/__init__.py +1 -1
  7. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/cli.py +25 -6
  8. umpaper_fetch-1.0.4/umpaper_fetch.egg-info/PKG-INFO +363 -0
  9. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch.egg-info/SOURCES.txt +0 -6
  10. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch.egg-info/top_level.txt +1 -0
  11. umpaper_fetch-1.0.2/DEMO.md +0 -170
  12. umpaper_fetch-1.0.2/PKG-INFO +0 -462
  13. umpaper_fetch-1.0.2/PUBLISHING_GUIDE.md +0 -253
  14. umpaper_fetch-1.0.2/PYPI_README.md +0 -120
  15. umpaper_fetch-1.0.2/README.md +0 -413
  16. umpaper_fetch-1.0.2/TESTING_GUIDE.md +0 -266
  17. umpaper_fetch-1.0.2/TROUBLESHOOTING.md +0 -165
  18. umpaper_fetch-1.0.2/search_response.html +0 -603
  19. umpaper_fetch-1.0.2/umpaper_fetch.egg-info/PKG-INFO +0 -462
  20. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/LICENSE +0 -0
  21. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/MANIFEST.in +0 -0
  22. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/auth/__init__.py +0 -0
  23. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/auth/chrome_fix.py +0 -0
  24. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/auth/um_authenticator.py +0 -0
  25. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/downloader/__init__.py +0 -0
  26. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/downloader/pdf_downloader.py +0 -0
  27. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/requirements.txt +0 -0
  28. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/scraper/__init__.py +0 -0
  29. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/scraper/paper_scraper.py +0 -0
  30. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/setup.cfg +0 -0
  31. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/auth/__init__.py +0 -0
  32. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/auth/chrome_fix.py +0 -0
  33. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/auth/um_authenticator.py +0 -0
  34. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/downloader/__init__.py +0 -0
  35. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/downloader/pdf_downloader.py +0 -0
  36. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/scraper/__init__.py +0 -0
  37. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/scraper/paper_scraper.py +0 -0
  38. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/utils/__init__.py +0 -0
  39. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/utils/logger.py +0 -0
  40. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch/utils/zip_creator.py +0 -0
  41. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch.egg-info/dependency_links.txt +0 -0
  42. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch.egg-info/entry_points.txt +0 -0
  43. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch.egg-info/not-zip-safe +0 -0
  44. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/umpaper_fetch.egg-info/requires.txt +0 -0
  45. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/utils/__init__.py +0 -0
  46. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/utils/logger.py +0 -0
  47. {umpaper_fetch-1.0.2 → umpaper_fetch-1.0.4}/utils/zip_creator.py +0 -0
@@ -50,4 +50,20 @@ Thumbs.db
50
50
 
51
51
  # Credentials (never commit these)
52
52
  credentials.txt
53
- config.ini
53
+ config.ini
54
+
55
+ # Documentation (local development only)
56
+ docs/
57
+
58
+ # Development/Debug files
59
+ test_*.py
60
+ debug_*.py
61
+ example_*.py
62
+ main.py
63
+ search_response.html
64
+
65
+ # Root-level duplicate modules (use umpaper_fetch/ instead)
66
+ auth/
67
+ downloader/
68
+ scraper/
69
+ utils/
@@ -0,0 +1,363 @@
1
+ Metadata-Version: 2.4
2
+ Name: umpaper-fetch
3
+ Version: 1.0.4
4
+ Summary: Automated downloader for University Malaya past year exam papers
5
+ Home-page: https://github.com/MarcusMQF/umpaper-fetch
6
+ Author: Marcus Mah
7
+ Author-email: Marcus Mah <marcusmah6969@gmail.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/MarcusMQF/umpaper-fetch
10
+ Project-URL: Documentation, https://github.com/MarcusMQF/umpaper-fetch#readme
11
+ Project-URL: Repository, https://github.com/MarcusMQF/umpaper-fetch
12
+ Project-URL: Bug Reports, https://github.com/MarcusMQF/umpaper-fetch/issues
13
+ Keywords: university,malaya,um,exam,papers,downloader,automation,selenium
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Topic :: Education
17
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
18
+ Classifier: Topic :: Utilities
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.8
22
+ Classifier: Programming Language :: Python :: 3.9
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Operating System :: OS Independent
27
+ Classifier: Environment :: Console
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: selenium>=4.15.2
32
+ Requires-Dist: requests>=2.31.0
33
+ Requires-Dist: beautifulsoup4>=4.12.2
34
+ Requires-Dist: webdriver-manager>=4.0.1
35
+ Requires-Dist: lxml>=4.9.3
36
+ Requires-Dist: urllib3>=2.0.7
37
+ Requires-Dist: certifi>=2023.7.22
38
+ Requires-Dist: tqdm>=4.66.1
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest>=7.0; extra == "dev"
41
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
42
+ Requires-Dist: black>=22.0; extra == "dev"
43
+ Requires-Dist: flake8>=5.0; extra == "dev"
44
+ Requires-Dist: mypy>=1.0; extra == "dev"
45
+ Dynamic: author
46
+ Dynamic: home-page
47
+ Dynamic: license-file
48
+ Dynamic: requires-python
49
+
50
+ # 🎓 Open Sourse UM PastYear Paper Downloader
51
+
52
+ **One-click bulk download solution for University Malaya (UM) past year exam papers**
53
+
54
+ Automate the tedious process of manually downloading past year papers one by one. Simply provide your UM credentials and subject code, and get all available papers in a single organized ZIP file.
55
+
56
+ [![PyPI version](https://badge.fury.io/py/umpaper-fetch.svg)](https://badge.fury.io/py/umpaper-fetch)
57
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
58
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
59
+
60
+ ---
61
+
62
+ ## 🚀 Quick Start (For Regular Users)
63
+
64
+ ### **Installation**
65
+ ```bash
66
+ # Install from PyPI
67
+ pip install umpaper-fetch
68
+
69
+ # Upgrade to latest version
70
+ pip install --upgrade umpaper-fetch
71
+ ```
72
+
73
+ ### **Basic Usage**
74
+ ```bash
75
+ # Run the downloader
76
+ python -m umpaper_fetch.cli
77
+
78
+ # Or with command-line shortcut (if available)
79
+ um-papers
80
+ ```
81
+
82
+ ### **First Run**
83
+ Follow the interactive prompts:
84
+ 1. Enter your UM username (without @siswa.um.edu.my)
85
+ 2. Enter your password securely
86
+ 3. Enter subject code (e.g., WIA1005)
87
+ 4. Choose download location
88
+ 5. Confirm download of found papers
89
+
90
+ ---
91
+
92
+ ## ✨ Key Features
93
+
94
+ ### 🚀 **Core Functionality**
95
+ - **🔄 One-Click Bulk Download**: Download all past year papers for any subject code automatically
96
+ - **📦 Smart ZIP Organization**: Automatically organizes papers by year and creates a structured ZIP archive
97
+ - **🔐 Secure Authentication**: Handles complex UM OpenAthens authentication flow seamlessly
98
+ - **⚡ Concurrent Downloads**: Multi-threaded downloading for faster performance
99
+ - **🔄 Auto-Retry Logic**: Robust error handling with configurable retry attempts
100
+ - **📊 Real-time Progress**: Live progress bars and detailed status updates
101
+
102
+ ### 📁 **File Organization**
103
+ - **📂 Hierarchical Structure**: Papers organized by subject → year → semester
104
+ - **🏷️ Smart File Naming**: Automatically detects and preserves meaningful filenames
105
+ - **📋 Auto-Generated README**: Includes download summary and paper inventory in ZIP
106
+ - **🗂️ Organized Output**: Individual PDFs + consolidated ZIP file
107
+ - **🧹 Optional Cleanup**: Choice to keep individual files or ZIP only
108
+
109
+ ### 🖥️ **User Experience**
110
+ - **📱 Terminal-Based Interface**: Clean, intuitive command-line interface
111
+ - **🎯 Interactive Mode**: Prompts for credentials and settings when needed
112
+ - **⚙️ Command-Line Mode**: Full automation with command-line arguments
113
+ - **📍 Custom Download Locations**: Choose where to save your papers
114
+ - **🔍 Browser Options**: Support for Edge, Chrome with auto-detection
115
+ - **📝 Comprehensive Logging**: Detailed logs for troubleshooting
116
+
117
+ ---
118
+
119
+ ## 📋 Complete Command Reference
120
+
121
+ ### **For Regular Users**
122
+
123
+ #### **Interactive Mode (Recommended for beginners)**
124
+ ```bash
125
+ python -m umpaper_fetch.cli
126
+ ```
127
+ *Prompts for all required information*
128
+
129
+ #### **Quick Commands**
130
+ ```bash
131
+ # With username and subject code
132
+ python -m umpaper_fetch.cli --username john_doe --subject-code WIA1005
133
+
134
+ # With custom output directory
135
+ python -m umpaper_fetch.cli -u student123 -s WXES1116 -o "C:/Downloads/Papers"
136
+
137
+ # Skip location prompt for automation
138
+ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt
139
+ ```
140
+
141
+ #### **Available Options**
142
+ | Command | Short | Description | Default |
143
+ |---------|-------|-------------|---------|
144
+ | `--username` | `-u` | UM username (without @siswa.um.edu.my) | *prompted* |
145
+ | `--subject-code` | `-s` | Subject code to search for (e.g., WIA1005) | *prompted* |
146
+ | `--output-dir` | `-o` | Custom download directory | `./downloads` |
147
+ | `--browser` | `-b` | Browser choice: `auto`, `chrome`, `edge` | `edge` |
148
+ | `--timeout` | | Session timeout in seconds | `30` |
149
+ | `--max-retries` | | Maximum retry attempts for failed downloads | `3` |
150
+ | `--no-location-prompt` | | Skip interactive location selection | `false` |
151
+ | `--verbose` | `-v` | Enable detailed debug logging | `false` |
152
+
153
+ ### **For Developers & Advanced Users**
154
+
155
+ #### **Development Installation**
156
+ ```bash
157
+ # Clone repository
158
+ git clone https://github.com/MarcusMQF/umpaper-fetch.git
159
+ cd umpaper-fetch
160
+
161
+ # Install in development mode
162
+ pip install -e .
163
+
164
+ # Install development dependencies
165
+ pip install -e .[dev]
166
+ ```
167
+
168
+ #### **Debug Commands**
169
+ ```bash
170
+ # Show browser window for debugging
171
+ python -m umpaper_fetch.cli --show-browser --verbose --subject-code WIA1005
172
+
173
+ # High-performance mode with extended timeouts
174
+ python -m umpaper_fetch.cli -s WIA1005 --max-retries 5 --timeout 60
175
+
176
+ # Force specific browser
177
+ python -m umpaper_fetch.cli --browser chrome --subject-code CSC1025
178
+ ```
179
+
180
+ #### **Developer Options**
181
+ | Command | Description | Use Case |
182
+ |---------|-------------|----------|
183
+ | `--show-browser` | Show browser window (disable headless mode) | Debugging authentication |
184
+ | `--verbose` | Enable detailed debug logging | Troubleshooting issues |
185
+ | `--timeout 60` | Extended session timeout | Slow connections |
186
+ | `--max-retries 5` | More retry attempts | Unstable connections |
187
+
188
+ ---
189
+
190
+ ## 💡 Tips for Best Experience
191
+
192
+ ### **Choose the Right Browser**
193
+ ```bash
194
+ # Windows users (recommended)
195
+ python -m umpaper_fetch.cli --browser edge --subject-code WIA1005
196
+
197
+ # Mac/Linux users
198
+ python -m umpaper_fetch.cli --browser chrome --subject-code WIA1005
199
+
200
+ # Auto-detect (fallback)
201
+ python -m umpaper_fetch.cli --browser auto --subject-code WIA1005
202
+ ```
203
+
204
+ ### **Optimize for Your Connection**
205
+ ```bash
206
+ # For slow/unstable connections
207
+ python -m umpaper_fetch.cli --timeout 90 --max-retries 5 --subject-code WIA1005
208
+
209
+ # For fast connections
210
+ python -m umpaper_fetch.cli --timeout 15 --max-retries 2 --subject-code WIA1005
211
+ ```
212
+
213
+ ### **Batch Processing Multiple Subjects**
214
+ ```bash
215
+ # Process multiple subjects
216
+ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt -o "./Papers/WIA1005"
217
+ python -m umpaper_fetch.cli -s WIX1116 --no-location-prompt -o "./Papers/WXES1116"
218
+ python -m umpaper_fetch.cli -s CSC1025 --no-location-prompt -o "./Papers/CSC1025"
219
+ ```
220
+
221
+ ### **Automation-Friendly Commands**
222
+ ```bash
223
+ # Fully automated (only prompts for password)
224
+ python -m umpaper_fetch.cli -u your_username -s WIA1005 --no-location-prompt -o "./Papers"
225
+
226
+ # Silent mode with custom browser
227
+ python -m umpaper_fetch.cli -u your-username -s WXES1116 --browser edge --no-location-prompt
228
+ ```
229
+
230
+ ---
231
+
232
+ ## 📊 What You Get
233
+
234
+ ### **Organized File Structure**
235
+ ```
236
+ 📁 downloads/
237
+ ├── 📁 WIA1005/
238
+ │ ├── 📁 Year_2023/
239
+ │ │ ├── WIA1005_Final_2023_S1.pdf
240
+ │ │ └── WIA1005_Final_2023_S2.pdf
241
+ │ ├── 📁 Year_2022/
242
+ │ │ ├── WIA1005_Final_2022_S1.pdf
243
+ │ │ └── WIA1005_Final_2022_S2.pdf
244
+ │ └── 📁 Unsorted/
245
+ │ └── WIA1005_Additional_Papers.pdf
246
+ ├── 📦 WIA1005_past_years.zip
247
+ └── 📄 WIA1005_README.txt
248
+ ```
249
+
250
+ ### **ZIP Archive Contents**
251
+ - **Hierarchical Organization**: Subject → Year → Files
252
+ - **Automatic README**: Download summary and file inventory
253
+ - **Optimized Compression**: Balanced compression for size/speed
254
+ - **Preserve Metadata**: Original filenames and dates maintained
255
+
256
+ ---
257
+
258
+ ## 🔧 Prerequisites & Setup
259
+
260
+ ### **System Requirements**
261
+ - **Python 3.8+** installed
262
+ - **Internet connection** (stable recommended)
263
+ - **UM student account** with active credentials
264
+ - **Browser**: Microsoft Edge (Windows) or Google Chrome (Mac/Linux)
265
+
266
+ ### **Browser Setup**
267
+ - **Windows**: Microsoft Edge (pre-installed, recommended)
268
+ - **Mac/Linux**: Google Chrome (install from google.com/chrome)
269
+ - **Auto-detection**: Tool will find the best available browser
270
+
271
+ ### **Firewall/Network**
272
+ - Tool connects to `exampaper.um.edu.my` via HTTPS
273
+ - No special firewall configuration needed
274
+ - Works on UM campus network and external networks
275
+
276
+ ---
277
+
278
+ ## 🎯 Quick Command Cheat Sheet
279
+
280
+ ### **For Regular Users**
281
+ ```bash
282
+ # Install and run
283
+ pip install umpaper-fetch
284
+ python -m umpaper_fetch.cli
285
+
286
+ # Quick download with subject code
287
+ python -m umpaper_fetch.cli -s WIA1005
288
+
289
+ # Custom download location
290
+ python -m umpaper_fetch.cli -s WIA1005 -o "C:/MyPapers"
291
+
292
+ # Batch mode (no prompts except password)
293
+ python -m umpaper_fetch.cli -u your_username -s WIA1005 --no-location-prompt
294
+ ```
295
+
296
+ ### **For Developers**
297
+ ```bash
298
+ # Development setup
299
+ git clone https://github.com/MarcusMQF/umpaper-fetch.git
300
+ cd umpaper-fetch
301
+ pip install -e .[dev]
302
+
303
+ # Debug mode
304
+ python -m umpaper_fetch.cli --show-browser --verbose -s WIA1005
305
+
306
+ # Performance testing
307
+ python -m umpaper_fetch.cli --max-retries 5 --timeout 60 -s WXES1116
308
+ ```
309
+
310
+ ---
311
+
312
+ ## 🔒 Security & Privacy
313
+
314
+ ### **What We Do**
315
+ - ✅ Use secure HTTPS connections only
316
+ - ✅ Handle UM authentication through official channels
317
+ - ✅ Clean up browser data after each session
318
+ - ✅ Never store or log passwords
319
+ - ✅ Respect server rate limits
320
+
321
+ ### **What We Don't Do**
322
+ - ❌ Store credentials anywhere
323
+ - ❌ Bypass security measures
324
+ - ❌ Access unauthorized content
325
+ - ❌ Share or transmit personal data
326
+ - ❌ Violate UM terms of service
327
+
328
+ ---
329
+
330
+ ## ⚖️ Legal & Academic Use
331
+
332
+ **Educational Purpose Only**: This tool is designed for UM students to efficiently access past year papers for their studies. Users must:
333
+ - Have valid UM credentials
334
+ - Comply with UM's terms of service
335
+ - Use papers for academic purposes only
336
+ - Respect copyright and intellectual property rights
337
+
338
+ **Disclaimer**: This is an unofficial tool not affiliated with University Malaya.
339
+
340
+ ---
341
+
342
+ ## 🤝 Support & Contributing
343
+
344
+ ### **Get Help**
345
+ - 📖 Check this README for common usage patterns
346
+ - 🐛 Report issues on [GitHub Issues](https://github.com/MarcusMQF/umpaper-fetch/issues)
347
+ - 💡 Request features via GitHub Issues
348
+
349
+ ### **Contributing**
350
+ Contributions welcome! Please:
351
+ 1. Fork the repository
352
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
353
+ 3. Make your changes with tests
354
+ 4. Submit a pull request
355
+ 5. Follow existing code style
356
+
357
+ ### **Development Setup**
358
+ ```bash
359
+ git clone https://github.com/MarcusMQF/umpaper-fetch.git
360
+ cd umpaper-fetch
361
+ pip install -e .[dev]
362
+ pytest # Run tests
363
+ ```
@@ -0,0 +1,314 @@
1
+ # 🎓 Open Sourse UM PastYear Paper Downloader
2
+
3
+ **One-click bulk download solution for University Malaya (UM) past year exam papers**
4
+
5
+ Automate the tedious process of manually downloading past year papers one by one. Simply provide your UM credentials and subject code, and get all available papers in a single organized ZIP file.
6
+
7
+ [![PyPI version](https://badge.fury.io/py/umpaper-fetch.svg)](https://badge.fury.io/py/umpaper-fetch)
8
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
+
11
+ ---
12
+
13
+ ## 🚀 Quick Start (For Regular Users)
14
+
15
+ ### **Installation**
16
+ ```bash
17
+ # Install from PyPI
18
+ pip install umpaper-fetch
19
+
20
+ # Upgrade to latest version
21
+ pip install --upgrade umpaper-fetch
22
+ ```
23
+
24
+ ### **Basic Usage**
25
+ ```bash
26
+ # Run the downloader
27
+ python -m umpaper_fetch.cli
28
+
29
+ # Or with command-line shortcut (if available)
30
+ um-papers
31
+ ```
32
+
33
+ ### **First Run**
34
+ Follow the interactive prompts:
35
+ 1. Enter your UM username (without @siswa.um.edu.my)
36
+ 2. Enter your password securely
37
+ 3. Enter subject code (e.g., WIA1005)
38
+ 4. Choose download location
39
+ 5. Confirm download of found papers
40
+
41
+ ---
42
+
43
+ ## ✨ Key Features
44
+
45
+ ### 🚀 **Core Functionality**
46
+ - **🔄 One-Click Bulk Download**: Download all past year papers for any subject code automatically
47
+ - **📦 Smart ZIP Organization**: Automatically organizes papers by year and creates a structured ZIP archive
48
+ - **🔐 Secure Authentication**: Handles complex UM OpenAthens authentication flow seamlessly
49
+ - **⚡ Concurrent Downloads**: Multi-threaded downloading for faster performance
50
+ - **🔄 Auto-Retry Logic**: Robust error handling with configurable retry attempts
51
+ - **📊 Real-time Progress**: Live progress bars and detailed status updates
52
+
53
+ ### 📁 **File Organization**
54
+ - **📂 Hierarchical Structure**: Papers organized by subject → year → semester
55
+ - **🏷️ Smart File Naming**: Automatically detects and preserves meaningful filenames
56
+ - **📋 Auto-Generated README**: Includes download summary and paper inventory in ZIP
57
+ - **🗂️ Organized Output**: Individual PDFs + consolidated ZIP file
58
+ - **🧹 Optional Cleanup**: Choice to keep individual files or ZIP only
59
+
60
+ ### 🖥️ **User Experience**
61
+ - **📱 Terminal-Based Interface**: Clean, intuitive command-line interface
62
+ - **🎯 Interactive Mode**: Prompts for credentials and settings when needed
63
+ - **⚙️ Command-Line Mode**: Full automation with command-line arguments
64
+ - **📍 Custom Download Locations**: Choose where to save your papers
65
+ - **🔍 Browser Options**: Support for Edge, Chrome with auto-detection
66
+ - **📝 Comprehensive Logging**: Detailed logs for troubleshooting
67
+
68
+ ---
69
+
70
+ ## 📋 Complete Command Reference
71
+
72
+ ### **For Regular Users**
73
+
74
+ #### **Interactive Mode (Recommended for beginners)**
75
+ ```bash
76
+ python -m umpaper_fetch.cli
77
+ ```
78
+ *Prompts for all required information*
79
+
80
+ #### **Quick Commands**
81
+ ```bash
82
+ # With username and subject code
83
+ python -m umpaper_fetch.cli --username john_doe --subject-code WIA1005
84
+
85
+ # With custom output directory
86
+ python -m umpaper_fetch.cli -u student123 -s WXES1116 -o "C:/Downloads/Papers"
87
+
88
+ # Skip location prompt for automation
89
+ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt
90
+ ```
91
+
92
+ #### **Available Options**
93
+ | Command | Short | Description | Default |
94
+ |---------|-------|-------------|---------|
95
+ | `--username` | `-u` | UM username (without @siswa.um.edu.my) | *prompted* |
96
+ | `--subject-code` | `-s` | Subject code to search for (e.g., WIA1005) | *prompted* |
97
+ | `--output-dir` | `-o` | Custom download directory | `./downloads` |
98
+ | `--browser` | `-b` | Browser choice: `auto`, `chrome`, `edge` | `edge` |
99
+ | `--timeout` | | Session timeout in seconds | `30` |
100
+ | `--max-retries` | | Maximum retry attempts for failed downloads | `3` |
101
+ | `--no-location-prompt` | | Skip interactive location selection | `false` |
102
+ | `--verbose` | `-v` | Enable detailed debug logging | `false` |
103
+
104
+ ### **For Developers & Advanced Users**
105
+
106
+ #### **Development Installation**
107
+ ```bash
108
+ # Clone repository
109
+ git clone https://github.com/MarcusMQF/umpaper-fetch.git
110
+ cd umpaper-fetch
111
+
112
+ # Install in development mode
113
+ pip install -e .
114
+
115
+ # Install development dependencies
116
+ pip install -e .[dev]
117
+ ```
118
+
119
+ #### **Debug Commands**
120
+ ```bash
121
+ # Show browser window for debugging
122
+ python -m umpaper_fetch.cli --show-browser --verbose --subject-code WIA1005
123
+
124
+ # High-performance mode with extended timeouts
125
+ python -m umpaper_fetch.cli -s WIA1005 --max-retries 5 --timeout 60
126
+
127
+ # Force specific browser
128
+ python -m umpaper_fetch.cli --browser chrome --subject-code CSC1025
129
+ ```
130
+
131
+ #### **Developer Options**
132
+ | Command | Description | Use Case |
133
+ |---------|-------------|----------|
134
+ | `--show-browser` | Show browser window (disable headless mode) | Debugging authentication |
135
+ | `--verbose` | Enable detailed debug logging | Troubleshooting issues |
136
+ | `--timeout 60` | Extended session timeout | Slow connections |
137
+ | `--max-retries 5` | More retry attempts | Unstable connections |
138
+
139
+ ---
140
+
141
+ ## 💡 Tips for Best Experience
142
+
143
+ ### **Choose the Right Browser**
144
+ ```bash
145
+ # Windows users (recommended)
146
+ python -m umpaper_fetch.cli --browser edge --subject-code WIA1005
147
+
148
+ # Mac/Linux users
149
+ python -m umpaper_fetch.cli --browser chrome --subject-code WIA1005
150
+
151
+ # Auto-detect (fallback)
152
+ python -m umpaper_fetch.cli --browser auto --subject-code WIA1005
153
+ ```
154
+
155
+ ### **Optimize for Your Connection**
156
+ ```bash
157
+ # For slow/unstable connections
158
+ python -m umpaper_fetch.cli --timeout 90 --max-retries 5 --subject-code WIA1005
159
+
160
+ # For fast connections
161
+ python -m umpaper_fetch.cli --timeout 15 --max-retries 2 --subject-code WIA1005
162
+ ```
163
+
164
+ ### **Batch Processing Multiple Subjects**
165
+ ```bash
166
+ # Process multiple subjects
167
+ python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt -o "./Papers/WIA1005"
168
+ python -m umpaper_fetch.cli -s WIX1116 --no-location-prompt -o "./Papers/WXES1116"
169
+ python -m umpaper_fetch.cli -s CSC1025 --no-location-prompt -o "./Papers/CSC1025"
170
+ ```
171
+
172
+ ### **Automation-Friendly Commands**
173
+ ```bash
174
+ # Fully automated (only prompts for password)
175
+ python -m umpaper_fetch.cli -u your_username -s WIA1005 --no-location-prompt -o "./Papers"
176
+
177
+ # Silent mode with custom browser
178
+ python -m umpaper_fetch.cli -u your-username -s WXES1116 --browser edge --no-location-prompt
179
+ ```
180
+
181
+ ---
182
+
183
+ ## 📊 What You Get
184
+
185
+ ### **Organized File Structure**
186
+ ```
187
+ 📁 downloads/
188
+ ├── 📁 WIA1005/
189
+ │ ├── 📁 Year_2023/
190
+ │ │ ├── WIA1005_Final_2023_S1.pdf
191
+ │ │ └── WIA1005_Final_2023_S2.pdf
192
+ │ ├── 📁 Year_2022/
193
+ │ │ ├── WIA1005_Final_2022_S1.pdf
194
+ │ │ └── WIA1005_Final_2022_S2.pdf
195
+ │ └── 📁 Unsorted/
196
+ │ └── WIA1005_Additional_Papers.pdf
197
+ ├── 📦 WIA1005_past_years.zip
198
+ └── 📄 WIA1005_README.txt
199
+ ```
200
+
201
+ ### **ZIP Archive Contents**
202
+ - **Hierarchical Organization**: Subject → Year → Files
203
+ - **Automatic README**: Download summary and file inventory
204
+ - **Optimized Compression**: Balanced compression for size/speed
205
+ - **Preserve Metadata**: Original filenames and dates maintained
206
+
207
+ ---
208
+
209
+ ## 🔧 Prerequisites & Setup
210
+
211
+ ### **System Requirements**
212
+ - **Python 3.8+** installed
213
+ - **Internet connection** (stable recommended)
214
+ - **UM student account** with active credentials
215
+ - **Browser**: Microsoft Edge (Windows) or Google Chrome (Mac/Linux)
216
+
217
+ ### **Browser Setup**
218
+ - **Windows**: Microsoft Edge (pre-installed, recommended)
219
+ - **Mac/Linux**: Google Chrome (install from google.com/chrome)
220
+ - **Auto-detection**: Tool will find the best available browser
221
+
222
+ ### **Firewall/Network**
223
+ - Tool connects to `exampaper.um.edu.my` via HTTPS
224
+ - No special firewall configuration needed
225
+ - Works on UM campus network and external networks
226
+
227
+ ---
228
+
229
+ ## 🎯 Quick Command Cheat Sheet
230
+
231
+ ### **For Regular Users**
232
+ ```bash
233
+ # Install and run
234
+ pip install umpaper-fetch
235
+ python -m umpaper_fetch.cli
236
+
237
+ # Quick download with subject code
238
+ python -m umpaper_fetch.cli -s WIA1005
239
+
240
+ # Custom download location
241
+ python -m umpaper_fetch.cli -s WIA1005 -o "C:/MyPapers"
242
+
243
+ # Batch mode (no prompts except password)
244
+ python -m umpaper_fetch.cli -u your_username -s WIA1005 --no-location-prompt
245
+ ```
246
+
247
+ ### **For Developers**
248
+ ```bash
249
+ # Development setup
250
+ git clone https://github.com/MarcusMQF/umpaper-fetch.git
251
+ cd umpaper-fetch
252
+ pip install -e .[dev]
253
+
254
+ # Debug mode
255
+ python -m umpaper_fetch.cli --show-browser --verbose -s WIA1005
256
+
257
+ # Performance testing
258
+ python -m umpaper_fetch.cli --max-retries 5 --timeout 60 -s WXES1116
259
+ ```
260
+
261
+ ---
262
+
263
+ ## 🔒 Security & Privacy
264
+
265
+ ### **What We Do**
266
+ - ✅ Use secure HTTPS connections only
267
+ - ✅ Handle UM authentication through official channels
268
+ - ✅ Clean up browser data after each session
269
+ - ✅ Never store or log passwords
270
+ - ✅ Respect server rate limits
271
+
272
+ ### **What We Don't Do**
273
+ - ❌ Store credentials anywhere
274
+ - ❌ Bypass security measures
275
+ - ❌ Access unauthorized content
276
+ - ❌ Share or transmit personal data
277
+ - ❌ Violate UM terms of service
278
+
279
+ ---
280
+
281
+ ## ⚖️ Legal & Academic Use
282
+
283
+ **Educational Purpose Only**: This tool is designed for UM students to efficiently access past year papers for their studies. Users must:
284
+ - Have valid UM credentials
285
+ - Comply with UM's terms of service
286
+ - Use papers for academic purposes only
287
+ - Respect copyright and intellectual property rights
288
+
289
+ **Disclaimer**: This is an unofficial tool not affiliated with University Malaya.
290
+
291
+ ---
292
+
293
+ ## 🤝 Support & Contributing
294
+
295
+ ### **Get Help**
296
+ - 📖 Check this README for common usage patterns
297
+ - 🐛 Report issues on [GitHub Issues](https://github.com/MarcusMQF/umpaper-fetch/issues)
298
+ - 💡 Request features via GitHub Issues
299
+
300
+ ### **Contributing**
301
+ Contributions welcome! Please:
302
+ 1. Fork the repository
303
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
304
+ 3. Make your changes with tests
305
+ 4. Submit a pull request
306
+ 5. Follow existing code style
307
+
308
+ ### **Development Setup**
309
+ ```bash
310
+ git clone https://github.com/MarcusMQF/umpaper-fetch.git
311
+ cd umpaper-fetch
312
+ pip install -e .[dev]
313
+ pytest # Run tests
314
+ ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "umpaper-fetch"
7
- version = "1.0.2"
7
+ version = "1.0.4"
8
8
  description = "Automated downloader for University Malaya past year exam papers"
9
9
  authors = [
10
10
  {name = "Marcus Mah", email = "marcusmah6969@gmail.com"}