Automated downloader for University Malaya past year exam papers
Project description
๐ Open Source UM PastYear Paper Downloader
One-click bulk download solution for University Malaya (UM) past year exam papers
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.
๐ Quick Start (For Regular Users)
Installation
# Install from PyPI
pip install umpaper-fetch
# Upgrade to latest version
pip install --upgrade umpaper-fetch
Basic Usage
# See all available commands and options
python -m umpaper_fetch.cli --help
# Run the downloader interactively
python -m umpaper_fetch.cli
# Or with command-line shortcut (if install inside venv and activated)
um-papers --help
um-papers
First Run
Follow the interactive prompts:
- Enter your UM username (without @siswa.um.edu.my)
- Enter your password securely
- Enter subject code (e.g., WIA1005)
- Choose download location
- Confirm download of found papers
โจ Key Features
๐ Core Functionality
- ๐ One-Click Bulk Download: Download all past year papers for any subject code automatically
- ๐ฆ Smart ZIP Organization: Automatically organizes papers by year and creates a structured ZIP archive
- ๐ Secure Authentication: Handles complex UM OpenAthens authentication flow seamlessly
- โก Concurrent Downloads: Multi-threaded downloading for faster performance
- ๐ Auto-Retry Logic: Robust error handling with configurable retry attempts
- ๐ Real-time Progress: Live progress bars and detailed status updates
๐ File Organization
- ๐ Hierarchical Structure: Papers organized by subject โ year โ semester
- ๐ท๏ธ Smart File Naming: Automatically detects and preserves meaningful filenames
- ๐ Auto-Generated README: Includes download summary and paper inventory in ZIP
- ๐๏ธ Organized Output: Individual PDFs + consolidated ZIP file
- ๐งน Optional Cleanup: Choice to keep individual files or ZIP only
๐ฅ๏ธ User Experience
- ๐ฑ Terminal-Based Interface: Clean, intuitive command-line interface
- ๐ฏ Interactive Mode: Prompts for credentials and settings when needed
- โ๏ธ Command-Line Mode: Full automation with command-line arguments
- ๐ Custom Download Locations: Choose where to save your papers
- ๐ Browser Options: Support for Edge, Chrome with auto-detection
- ๐ Comprehensive Logging: Detailed logs for troubleshooting
๐ Complete Command Reference
For Regular Users
Interactive Mode (Recommended for beginners)
# See all available options first
python -m umpaper_fetch.cli --help
# Run interactive mode
python -m umpaper_fetch.cli
Prompts for all required information
Quick Commands
# With username and subject code
python -m umpaper_fetch.cli --username john_doe --subject-code WIA1005
# With custom output directory
python -m umpaper_fetch.cli -u student123 -s WXES1116 -o "C:/Downloads/Papers"
# Skip location prompt for automation
python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt
Available Options
| Command | Short | Description | Default |
|---|---|---|---|
--help |
-h |
Available command to use | |
--username |
-u |
UM username (without @siswa.um.edu.my) | prompted |
--subject-code |
-s |
Subject code to search for (e.g., WIA1005) | prompted |
--output-dir |
-o |
Custom download directory | ./downloads |
--browser |
-b |
Browser choice: auto, chrome, edge |
edge |
--timeout |
Session timeout in seconds | 30 |
|
--max-retries |
Maximum retry attempts for failed downloads | 3 |
|
--no-location-prompt |
Skip interactive location selection | false |
|
--verbose |
-v |
Enable detailed debug logging | false |
For Developers & Advanced Users
Development Installation
# Clone repository
git clone https://github.com/MarcusMQF/umpaper-fetch.git
cd umpaper-fetch
# Install in development mode
pip install -e .
# Install development dependencies
pip install -e .[dev]
Debug Commands
# Show browser window for debugging
python -m umpaper_fetch.cli --show-browser --verbose --subject-code WIA1005
# High-performance mode with extended timeouts
python -m umpaper_fetch.cli -s WIA1005 --max-retries 5 --timeout 60
# Force specific browser
python -m umpaper_fetch.cli --browser chrome --subject-code CSC1025
Developer Options
| Command | Description | Use Case |
|---|---|---|
--show-browser |
Show browser window (disable headless mode) | Debugging authentication |
--verbose |
Enable detailed debug logging | Troubleshooting issues |
--timeout 60 |
Extended session timeout | Slow connections |
--max-retries 5 |
More retry attempts | Unstable connections |
๐ก Tips for Best Experience
Choose the Right Browser
# Windows users (recommended)
python -m umpaper_fetch.cli --browser edge --subject-code WIA1005
# Mac/Linux users
python -m umpaper_fetch.cli --browser chrome --subject-code WIA1005
# Auto-detect (fallback)
python -m umpaper_fetch.cli --browser auto --subject-code WIA1005
Optimize for Your Connection
# For slow/unstable connections
python -m umpaper_fetch.cli --timeout 90 --max-retries 5 --subject-code WIA1005
# For fast connections
python -m umpaper_fetch.cli --timeout 15 --max-retries 2 --subject-code WIA1005
Batch Processing Multiple Subjects
# Process multiple subjects
python -m umpaper_fetch.cli -s WIA1005 --no-location-prompt -o "./Papers/WIA1005"
python -m umpaper_fetch.cli -s WIX1116 --no-location-prompt -o "./Papers/WXES1116"
python -m umpaper_fetch.cli -s CSC1025 --no-location-prompt -o "./Papers/CSC1025"
Automation-Friendly Commands
# Fully automated (only prompts for password)
python -m umpaper_fetch.cli -u your_username -s WIA1005 --no-location-prompt -o "./Papers"
# Silent mode with custom browser
python -m umpaper_fetch.cli -u your-username -s WXES1116 --browser edge --no-location-prompt
๐ What You Get
Organized File Structure
๐ downloads/
โโโ ๐ WIA1005/
โ โโโ ๐ Year_2023/
โ โ โโโ WIA1005_Final_2023_S1.pdf
โ โ โโโ WIA1005_Final_2023_S2.pdf
โ โโโ ๐ Year_2022/
โ โ โโโ WIA1005_Final_2022_S1.pdf
โ โ โโโ WIA1005_Final_2022_S2.pdf
โ โโโ ๐ Unsorted/
โ โโโ WIA1005_Additional_Papers.pdf
โโโ ๐ฆ WIA1005_past_years.zip
โโโ ๐ WIA1005_README.txt
ZIP Archive Contents
- Hierarchical Organization: Subject โ Year โ Files
- Automatic README: Download summary and file inventory
- Optimized Compression: Balanced compression for size/speed
- Preserve Metadata: Original filenames and dates maintained
๐ง Prerequisites & Setup
System Requirements
- Python 3.8+ installed
- Internet connection (stable recommended)
- UM student account with active credentials
- Browser: Microsoft Edge (Windows) or Google Chrome (Mac/Linux)
Browser Setup
- Windows: Microsoft Edge (pre-installed, recommended)
- Mac/Linux: Google Chrome (install from google.com/chrome)
- Auto-detection: Tool will find the best available browser
Firewall/Network
- Tool connects to
exampaper.um.edu.myvia HTTPS - No special firewall configuration needed
- Works on UM campus network and external networks
๐ฏ Quick Command Cheat Sheet
For Regular Users
# Install and run
pip install umpaper-fetch
python -m umpaper_fetch.cli
# Get help and see all options
python -m umpaper_fetch.cli --help
# Quick download with subject code
python -m umpaper_fetch.cli -s WIA1005
# Custom download location
python -m umpaper_fetch.cli -s WIA1005 -o "C:/MyPapers"
# Batch mode (no prompts except password)
python -m umpaper_fetch.cli -u your_username -s WIA1005 --no-location-prompt
For Developers
# Development setup
git clone https://github.com/MarcusMQF/umpaper-fetch.git
cd umpaper-fetch
pip install -e .[dev]
# Debug mode
python -m umpaper_fetch.cli --show-browser --verbose -s WIA1005
# Performance testing
python -m umpaper_fetch.cli --max-retries 5 --timeout 60 -s WXES1116
๐ Security & Privacy
What We Do
- โ Use secure HTTPS connections only
- โ Handle UM authentication through official channels
- โ Clean up browser data after each session
- โ Never store or log passwords
- โ Respect server rate limits
What We Don't Do
- โ Store credentials anywhere
- โ Bypass security measures
- โ Access unauthorized content
- โ Share or transmit personal data
- โ Violate UM terms of service
โ๏ธ Legal & Academic Use
Educational Purpose Only: This tool is designed for UM students to efficiently access past year papers for their studies. Users must:
- Have valid UM credentials
- Comply with UM's terms of service
- Use papers for academic purposes only
- Respect copyright and intellectual property rights
Disclaimer: This is an unofficial tool not affiliated with University Malaya.
๐ค Support & Contributing
Get Help
- ๐ Check this README for common usage patterns
- ๐ Report issues on GitHub Issues
- ๐ก Request features via GitHub Issues
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Submit a pull request
- Follow existing code style
Development Setup
git clone https://github.com/MarcusMQF/umpaper-fetch.git
cd umpaper-fetch
pip install -e .[dev]
pytest # Run tests
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file umpaper_fetch-1.0.6.tar.gz.
File metadata
- Download URL: umpaper_fetch-1.0.6.tar.gz
- Upload date:
- Size: 45.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.66.1 importlib-metadata/6.8.0 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f22035f841b5299cf1cdfc41865a7c41eb1bc174b7ca2388e95a0395f5fd4365
|
|
| MD5 |
b2ccda117e716fb1031b44298ed9b631
|
|
| BLAKE2b-256 |
369bd32411e0f29e3636e5d37119bbcf15bd67880e7d9fd12f8c095cf03aa428
|
File details
Details for the file umpaper_fetch-1.0.6-py3-none-any.whl.
File metadata
- Download URL: umpaper_fetch-1.0.6-py3-none-any.whl
- Upload date:
- Size: 45.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.66.1 importlib-metadata/6.8.0 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67a9de5a3ef54d83cc4d92dab6d66f5297805cd460ef0678caec05e4aa3fd13c
|
|
| MD5 |
98dba27751c67c5b5402772845695f61
|
|
| BLAKE2b-256 |
aa44c93f146e2d28d71eac264912b212210a2d0a6e43381574034bacb7c54f9a
|