umpaper-fetch 1.0.0__tar.gz → 1.0.1__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.
- umpaper_fetch-1.0.1/.gitignore +53 -0
- umpaper_fetch-1.0.1/DEMO.md +170 -0
- {umpaper_fetch-1.0.0/umpaper_fetch.egg-info → umpaper_fetch-1.0.1}/PKG-INFO +1 -1
- umpaper_fetch-1.0.1/PUBLISHING_GUIDE.md +253 -0
- umpaper_fetch-1.0.1/PYPI_README.md +120 -0
- umpaper_fetch-1.0.1/TESTING_GUIDE.md +266 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/pyproject.toml +1 -1
- umpaper_fetch-1.0.1/search_response.html +603 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/setup.py +1 -1
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/__init__.py +1 -1
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/cli.py +36 -2
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1/umpaper_fetch}/utils/zip_creator.py +2 -2
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1/umpaper_fetch.egg-info}/PKG-INFO +1 -1
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch.egg-info/SOURCES.txt +6 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/LICENSE +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/MANIFEST.in +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/README.md +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/TROUBLESHOOTING.md +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/auth/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/auth/chrome_fix.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/auth/um_authenticator.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/downloader/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/downloader/pdf_downloader.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/requirements.txt +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/scraper/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/scraper/paper_scraper.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/setup.cfg +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/auth/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/auth/chrome_fix.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/auth/um_authenticator.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/downloader/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/downloader/pdf_downloader.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/scraper/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/scraper/paper_scraper.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/utils/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch/utils/logger.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch.egg-info/dependency_links.txt +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch.egg-info/entry_points.txt +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch.egg-info/not-zip-safe +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch.egg-info/requires.txt +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/umpaper_fetch.egg-info/top_level.txt +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/utils/__init__.py +0 -0
- {umpaper_fetch-1.0.0 → umpaper_fetch-1.0.1}/utils/logger.py +0 -0
- {umpaper_fetch-1.0.0/umpaper_fetch → umpaper_fetch-1.0.1}/utils/zip_creator.py +0 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
# Python
|
2
|
+
__pycache__/
|
3
|
+
*.py[cod]
|
4
|
+
*$py.class
|
5
|
+
*.so
|
6
|
+
.Python
|
7
|
+
build/
|
8
|
+
develop-eggs/
|
9
|
+
dist/
|
10
|
+
downloads/
|
11
|
+
eggs/
|
12
|
+
.eggs/
|
13
|
+
lib/
|
14
|
+
lib64/
|
15
|
+
parts/
|
16
|
+
sdist/
|
17
|
+
var/
|
18
|
+
wheels/
|
19
|
+
*.egg-info/
|
20
|
+
.installed.cfg
|
21
|
+
*.egg
|
22
|
+
MANIFEST
|
23
|
+
|
24
|
+
# Virtual environments
|
25
|
+
.env
|
26
|
+
.venv
|
27
|
+
env/
|
28
|
+
venv/
|
29
|
+
ENV/
|
30
|
+
env.bak/
|
31
|
+
venv.bak/
|
32
|
+
|
33
|
+
# IDE
|
34
|
+
.vscode/
|
35
|
+
.idea/
|
36
|
+
*.swp
|
37
|
+
*.swo
|
38
|
+
*~
|
39
|
+
|
40
|
+
# Project specific
|
41
|
+
downloads/
|
42
|
+
logs/
|
43
|
+
*.zip
|
44
|
+
*.pdf
|
45
|
+
*.tmp
|
46
|
+
|
47
|
+
# OS
|
48
|
+
.DS_Store
|
49
|
+
Thumbs.db
|
50
|
+
|
51
|
+
# Credentials (never commit these)
|
52
|
+
credentials.txt
|
53
|
+
config.ini
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# UM Paper Fetch - Live Demo
|
2
|
+
|
3
|
+
This document shows how to use the `umpaper-fetch` package after installation.
|
4
|
+
|
5
|
+
## 🚀 Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
pip install umpaper-fetch
|
9
|
+
```
|
10
|
+
|
11
|
+
## 📋 Quick Start
|
12
|
+
|
13
|
+
### Basic Usage (Interactive Mode)
|
14
|
+
|
15
|
+
```bash
|
16
|
+
um-papers
|
17
|
+
```
|
18
|
+
|
19
|
+
This will prompt you for:
|
20
|
+
1. Username (your UM student/staff ID without @siswa.um.edu.my)
|
21
|
+
2. Password (entered securely, no echo)
|
22
|
+
3. Subject code (e.g., WIA1005, WXES1116)
|
23
|
+
4. Download location (option to use default or custom path)
|
24
|
+
|
25
|
+
### Advanced Usage
|
26
|
+
|
27
|
+
```bash
|
28
|
+
# Specify username and subject code upfront
|
29
|
+
um-papers --username your_username --subject-code WIA1005
|
30
|
+
|
31
|
+
# Use custom output directory
|
32
|
+
um-papers --output-dir "C:/My Downloads/UM Papers"
|
33
|
+
|
34
|
+
# Non-interactive mode (good for automation)
|
35
|
+
um-papers --username your_username --subject-code WXES1116 --no-location-prompt
|
36
|
+
|
37
|
+
# Show browser for debugging/monitoring
|
38
|
+
um-papers --show-browser --verbose
|
39
|
+
|
40
|
+
# Use specific browser
|
41
|
+
um-papers --browser edge --timeout 60
|
42
|
+
|
43
|
+
# Increase retry attempts for unstable connections
|
44
|
+
um-papers --max-retries 5
|
45
|
+
```
|
46
|
+
|
47
|
+
## 🎯 What Happens When You Run It
|
48
|
+
|
49
|
+
1. **Authentication**: Logs into UM OpenAthens system
|
50
|
+
2. **Search**: Finds all papers for your subject code
|
51
|
+
3. **Download**: Downloads each paper with progress tracking
|
52
|
+
4. **Organization**: Creates organized folder structure
|
53
|
+
5. **Archive**: Bundles everything into a ZIP file
|
54
|
+
|
55
|
+
## 📁 Output Structure
|
56
|
+
|
57
|
+
After running `um-papers --subject-code WIA1005`, you'll get:
|
58
|
+
|
59
|
+
```
|
60
|
+
downloads/
|
61
|
+
├── WIA1005/
|
62
|
+
│ ├── Y2023_S1_Final_Exam.pdf
|
63
|
+
│ ├── Y2023_S1_Mid_Term_Test.pdf
|
64
|
+
│ ├── Y2022_S2_Final_Exam.pdf
|
65
|
+
│ ├── Y2022_S1_Final_Exam.pdf
|
66
|
+
│ └── ... (all available papers)
|
67
|
+
└── WIA1005_papers.zip (contains all the above)
|
68
|
+
```
|
69
|
+
|
70
|
+
## 🔧 Common Options
|
71
|
+
|
72
|
+
| Option | Description | Example |
|
73
|
+
|--------|-------------|---------|
|
74
|
+
| `--username` | UM username (without @domain) | `--username 24012345` |
|
75
|
+
| `--subject-code` | Subject to download | `--subject-code WIA1005` |
|
76
|
+
| `--output-dir` | Where to save files | `--output-dir "C:/Downloads"` |
|
77
|
+
| `--no-location-prompt` | Skip location selection | `--no-location-prompt` |
|
78
|
+
| `--show-browser` | Show browser window | `--show-browser` |
|
79
|
+
| `--browser` | Choose browser | `--browser edge` |
|
80
|
+
| `--verbose` | Detailed logging | `--verbose` |
|
81
|
+
|
82
|
+
## 🚨 Troubleshooting
|
83
|
+
|
84
|
+
### Browser Issues
|
85
|
+
```bash
|
86
|
+
# If Chrome fails (common on Windows)
|
87
|
+
um-papers --browser edge
|
88
|
+
|
89
|
+
# Show browser to see what's happening
|
90
|
+
um-papers --show-browser --verbose
|
91
|
+
```
|
92
|
+
|
93
|
+
### Authentication Issues
|
94
|
+
```bash
|
95
|
+
# Increase timeout for slow connections
|
96
|
+
um-papers --timeout 60
|
97
|
+
|
98
|
+
# Check credentials by viewing browser
|
99
|
+
um-papers --show-browser
|
100
|
+
```
|
101
|
+
|
102
|
+
### Download Issues
|
103
|
+
```bash
|
104
|
+
# Increase retries for unstable connections
|
105
|
+
um-papers --max-retries 5
|
106
|
+
|
107
|
+
# Use verbose mode to see detailed progress
|
108
|
+
um-papers --verbose
|
109
|
+
```
|
110
|
+
|
111
|
+
## 💡 Tips
|
112
|
+
|
113
|
+
1. **First-time users**: Use `--show-browser` to see what's happening
|
114
|
+
2. **Windows users**: Edge browser works better than Chrome
|
115
|
+
3. **Slow connections**: Use `--timeout 60` and `--max-retries 5`
|
116
|
+
4. **Automation**: Use `--no-location-prompt` to skip interactive prompts
|
117
|
+
5. **Debugging**: Always use `--verbose` when troubleshooting
|
118
|
+
|
119
|
+
## 🎓 Example Session
|
120
|
+
|
121
|
+
```bash
|
122
|
+
$ um-papers --subject-code WIA1005 --verbose
|
123
|
+
|
124
|
+
=== UM Past Year Paper Downloader ===
|
125
|
+
Enter your UM username (without @siswa.um.edu.my): 24012345
|
126
|
+
Enter your UM password: [hidden]
|
127
|
+
|
128
|
+
📋 Configuration Summary
|
129
|
+
==================================================
|
130
|
+
Username: 24012345
|
131
|
+
Subject Code: WIA1005
|
132
|
+
Output Directory: C:\Users\User\downloads
|
133
|
+
Browser: edge
|
134
|
+
Headless Mode: True
|
135
|
+
Timeout: 30s
|
136
|
+
Max Retries: 3
|
137
|
+
|
138
|
+
🚀 Ready to start downloading papers for WIA1005
|
139
|
+
Continue? (y/N): y
|
140
|
+
|
141
|
+
============================================================
|
142
|
+
🔄 Starting download process...
|
143
|
+
============================================================
|
144
|
+
Step 1: Authenticating with UM portal...
|
145
|
+
✅ Authentication successful
|
146
|
+
Step 2: Searching for papers with subject code: WIA1005
|
147
|
+
✅ Found 12 papers
|
148
|
+
Step 3: Downloading papers...
|
149
|
+
Downloading papers: 100%|████████████| 12/12 [00:45<00:00, 3.78s/file]
|
150
|
+
Step 4: Creating ZIP archive...
|
151
|
+
✅ ZIP archive created: C:\Users\User\downloads\WIA1005_papers.zip
|
152
|
+
|
153
|
+
🎉 Success! All papers downloaded and zipped:
|
154
|
+
📦 ZIP file: C:\Users\User\downloads\WIA1005_papers.zip
|
155
|
+
📁 Individual files: C:\Users\User\downloads\WIA1005
|
156
|
+
|
157
|
+
✅ Download completed successfully!
|
158
|
+
Total papers downloaded: 12
|
159
|
+
```
|
160
|
+
|
161
|
+
## 📞 Support
|
162
|
+
|
163
|
+
If you encounter issues:
|
164
|
+
1. Run with `--verbose` flag for detailed logs
|
165
|
+
2. Try `--browser edge` if Chrome fails
|
166
|
+
3. Check your UM credentials
|
167
|
+
4. Ensure you have internet connectivity
|
168
|
+
5. Report bugs to the package maintainer
|
169
|
+
|
170
|
+
Happy downloading! 🎉
|
@@ -0,0 +1,253 @@
|
|
1
|
+
# Publishing Guide for umpaper-fetch
|
2
|
+
|
3
|
+
This guide will help you build and publish the `umpaper-fetch` package to PyPI so users can install it with `pip install umpaper-fetch`.
|
4
|
+
|
5
|
+
## 📋 Prerequisites
|
6
|
+
|
7
|
+
### 1. Install Build Tools
|
8
|
+
|
9
|
+
```bash
|
10
|
+
pip install --upgrade pip
|
11
|
+
pip install build twine setuptools wheel
|
12
|
+
```
|
13
|
+
|
14
|
+
### 2. Create PyPI Account
|
15
|
+
|
16
|
+
1. Go to [PyPI.org](https://pypi.org) and create an account
|
17
|
+
2. Verify your email address
|
18
|
+
3. (Optional) Go to [TestPyPI.org](https://test.pypi.org) for testing
|
19
|
+
|
20
|
+
### 3. Set Up API Tokens
|
21
|
+
|
22
|
+
1. Go to your PyPI account settings
|
23
|
+
2. Create an API token for uploading packages
|
24
|
+
3. Save the token securely (starts with `pypi-`)
|
25
|
+
|
26
|
+
## 🔧 Pre-Publishing Setup
|
27
|
+
|
28
|
+
### 1. Update Package Information
|
29
|
+
|
30
|
+
Edit these files with your actual information:
|
31
|
+
|
32
|
+
**setup.py**:
|
33
|
+
```python
|
34
|
+
author="Your Actual Name",
|
35
|
+
author_email="your.actual.email@example.com",
|
36
|
+
url="https://github.com/yourusername/umpaper-fetch",
|
37
|
+
```
|
38
|
+
|
39
|
+
**pyproject.toml**:
|
40
|
+
```toml
|
41
|
+
authors = [
|
42
|
+
{name = "Your Actual Name", email = "your.actual.email@example.com"}
|
43
|
+
]
|
44
|
+
[project.urls]
|
45
|
+
Homepage = "https://github.com/yourusername/umpaper-fetch"
|
46
|
+
Repository = "https://github.com/yourusername/umpaper-fetch"
|
47
|
+
"Bug Reports" = "https://github.com/yourusername/umpaper-fetch/issues"
|
48
|
+
```
|
49
|
+
|
50
|
+
### 2. Choose Package Name
|
51
|
+
|
52
|
+
Check if `umpaper-fetch` is available on PyPI:
|
53
|
+
```bash
|
54
|
+
pip install umpaper-fetch
|
55
|
+
# If it fails, the name is available
|
56
|
+
```
|
57
|
+
|
58
|
+
If taken, modify the name in:
|
59
|
+
- `setup.py` → `name="your-chosen-name"`
|
60
|
+
- `pyproject.toml` → `name = "your-chosen-name"`
|
61
|
+
|
62
|
+
### 3. Update README for PyPI
|
63
|
+
|
64
|
+
Replace the current README.md with PYPI_README.md:
|
65
|
+
```bash
|
66
|
+
cp PYPI_README.md README.md
|
67
|
+
```
|
68
|
+
|
69
|
+
## 🚀 Building the Package
|
70
|
+
|
71
|
+
### 1. Clean Previous Builds
|
72
|
+
|
73
|
+
```bash
|
74
|
+
# Remove old build artifacts
|
75
|
+
rm -rf build/ dist/ *.egg-info/
|
76
|
+
```
|
77
|
+
|
78
|
+
### 2. Build the Package
|
79
|
+
|
80
|
+
```bash
|
81
|
+
# Build source distribution and wheel
|
82
|
+
python -m build
|
83
|
+
```
|
84
|
+
|
85
|
+
This creates:
|
86
|
+
- `dist/umpaper-fetch-1.0.0.tar.gz` (source distribution)
|
87
|
+
- `dist/umpaper_fetch-1.0.0-py3-none-any.whl` (wheel)
|
88
|
+
|
89
|
+
### 3. Verify the Build
|
90
|
+
|
91
|
+
```bash
|
92
|
+
# Check package contents
|
93
|
+
tar -tzf dist/umpaper-fetch-1.0.0.tar.gz
|
94
|
+
unzip -l dist/umpaper_fetch-1.0.0-py3-none-any.whl
|
95
|
+
```
|
96
|
+
|
97
|
+
## 🧪 Testing Before Publishing
|
98
|
+
|
99
|
+
### 1. Test Local Installation
|
100
|
+
|
101
|
+
```bash
|
102
|
+
# Install locally in development mode
|
103
|
+
pip install -e .
|
104
|
+
|
105
|
+
# Test the command
|
106
|
+
python -m umpaper_fetch.cli --help
|
107
|
+
```
|
108
|
+
|
109
|
+
### 2. Test with TestPyPI (Recommended)
|
110
|
+
|
111
|
+
```bash
|
112
|
+
# Upload to TestPyPI first
|
113
|
+
twine upload --repository testpypi dist/*
|
114
|
+
|
115
|
+
# Install from TestPyPI
|
116
|
+
pip install --index-url https://test.pypi.org/simple/ umpaper-fetch
|
117
|
+
|
118
|
+
# Test the installation
|
119
|
+
um-papers --version
|
120
|
+
```
|
121
|
+
|
122
|
+
## 📦 Publishing to PyPI
|
123
|
+
|
124
|
+
### 1. Upload to PyPI
|
125
|
+
|
126
|
+
```bash
|
127
|
+
# Upload to real PyPI
|
128
|
+
twine upload dist/*
|
129
|
+
```
|
130
|
+
|
131
|
+
When prompted:
|
132
|
+
- Username: `__token__`
|
133
|
+
- Password: Your PyPI API token (including `pypi-` prefix)
|
134
|
+
|
135
|
+
### 2. Verify Publication
|
136
|
+
|
137
|
+
```bash
|
138
|
+
# Wait a few minutes, then test installation
|
139
|
+
pip install umpaper-fetch
|
140
|
+
|
141
|
+
# Test the command
|
142
|
+
um-papers --help
|
143
|
+
```
|
144
|
+
|
145
|
+
## 🔄 Updating the Package
|
146
|
+
|
147
|
+
### 1. Update Version Number
|
148
|
+
|
149
|
+
Update version in:
|
150
|
+
- `setup.py`: `version="1.0.1"`
|
151
|
+
- `pyproject.toml`: `version = "1.0.1"`
|
152
|
+
- `umpaper_fetch/__init__.py`: `__version__ = "1.0.1"`
|
153
|
+
- `umpaper_fetch/cli.py`: `version='%(prog)s 1.0.1'`
|
154
|
+
|
155
|
+
### 2. Build and Upload New Version
|
156
|
+
|
157
|
+
```bash
|
158
|
+
# Clean and build
|
159
|
+
rm -rf build/ dist/ *.egg-info/
|
160
|
+
python -m build
|
161
|
+
|
162
|
+
# Upload
|
163
|
+
twine upload dist/*
|
164
|
+
```
|
165
|
+
|
166
|
+
## 📁 Project Structure for PyPI
|
167
|
+
|
168
|
+
```
|
169
|
+
PastYear Accessor/
|
170
|
+
├── umpaper_fetch/ # Main package directory
|
171
|
+
│ ├── __init__.py # Package initialization
|
172
|
+
│ ├── cli.py # Command-line interface
|
173
|
+
│ ├── auth/ # Authentication module
|
174
|
+
│ ├── scraper/ # Scraping module
|
175
|
+
│ ├── downloader/ # Download module
|
176
|
+
│ └── utils/ # Utility modules
|
177
|
+
├── setup.py # Setup configuration
|
178
|
+
├── pyproject.toml # Modern Python project config
|
179
|
+
├── requirements.txt # Dependencies
|
180
|
+
├── README.md # PyPI description
|
181
|
+
├── LICENSE # MIT license
|
182
|
+
├── MANIFEST.in # Include/exclude files
|
183
|
+
└── PUBLISHING_GUIDE.md # This guide
|
184
|
+
```
|
185
|
+
|
186
|
+
## 🔒 Security Best Practices
|
187
|
+
|
188
|
+
### 1. Use API Tokens
|
189
|
+
- Never use username/password for uploading
|
190
|
+
- Use scoped API tokens for better security
|
191
|
+
|
192
|
+
### 2. Two-Factor Authentication
|
193
|
+
- Enable 2FA on your PyPI account
|
194
|
+
- Use app-based authentication (not SMS)
|
195
|
+
|
196
|
+
### 3. Environment Variables
|
197
|
+
```bash
|
198
|
+
# Set token as environment variable
|
199
|
+
export TWINE_USERNAME=__token__
|
200
|
+
export TWINE_PASSWORD=pypi-your-api-token-here
|
201
|
+
|
202
|
+
# Upload without entering credentials
|
203
|
+
twine upload dist/*
|
204
|
+
```
|
205
|
+
|
206
|
+
## 🐛 Troubleshooting
|
207
|
+
|
208
|
+
### Build Errors
|
209
|
+
```bash
|
210
|
+
# If build fails, check:
|
211
|
+
python setup.py check
|
212
|
+
python -m build --verbose
|
213
|
+
```
|
214
|
+
|
215
|
+
### Upload Errors
|
216
|
+
```bash
|
217
|
+
# If upload fails:
|
218
|
+
twine check dist/*
|
219
|
+
twine upload --verbose dist/*
|
220
|
+
```
|
221
|
+
|
222
|
+
### Import Errors After Installation
|
223
|
+
```bash
|
224
|
+
# Check if package is properly installed
|
225
|
+
pip show umpaper-fetch
|
226
|
+
pip list | grep umpaper
|
227
|
+
```
|
228
|
+
|
229
|
+
## 📈 After Publishing
|
230
|
+
|
231
|
+
### 1. Monitor Downloads
|
232
|
+
- Check PyPI package page for download statistics
|
233
|
+
- Monitor for issues/feedback
|
234
|
+
|
235
|
+
### 2. Documentation
|
236
|
+
- Update GitHub README with PyPI installation instructions
|
237
|
+
- Create GitHub releases for version tags
|
238
|
+
|
239
|
+
### 3. Maintenance
|
240
|
+
- Respond to user issues
|
241
|
+
- Keep dependencies updated
|
242
|
+
- Regular security updates
|
243
|
+
|
244
|
+
## 🎉 Success!
|
245
|
+
|
246
|
+
Once published, users can install your package with:
|
247
|
+
|
248
|
+
```bash
|
249
|
+
pip install umpaper-fetch
|
250
|
+
um-papers --help
|
251
|
+
```
|
252
|
+
|
253
|
+
Your package will be available at: https://pypi.org/project/umpaper-fetch/
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# UM Paper Fetch
|
2
|
+
|
3
|
+
[](https://www.python.org/downloads/)
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
5
|
+
|
6
|
+
Automated downloader for University Malaya past year exam papers. No more manual navigation through multiple systems - just one command to download all papers for any subject!
|
7
|
+
|
8
|
+
## 🚀 Quick Start
|
9
|
+
|
10
|
+
### Installation
|
11
|
+
|
12
|
+
```bash
|
13
|
+
pip install umpaper-fetch
|
14
|
+
```
|
15
|
+
|
16
|
+
### Usage
|
17
|
+
|
18
|
+
After installation, use the `um-papers` command:
|
19
|
+
|
20
|
+
```bash
|
21
|
+
# Interactive mode (recommended for first-time users)
|
22
|
+
um-papers
|
23
|
+
|
24
|
+
# With subject code
|
25
|
+
um-papers --subject-code WIA1005
|
26
|
+
|
27
|
+
# With username and subject code
|
28
|
+
um-papers --username 24056789 --subject-code WXES1116
|
29
|
+
|
30
|
+
# Non-interactive mode
|
31
|
+
um-papers --username 24012345 --subject-code WIA1005 --no-location-prompt
|
32
|
+
|
33
|
+
# Show browser for debugging
|
34
|
+
um-papers --show-browser --verbose
|
35
|
+
```
|
36
|
+
|
37
|
+
## ✨ Features
|
38
|
+
|
39
|
+
- **One-command download**: Get all past year papers for any UM subject
|
40
|
+
- **Automatic authentication**: Handles complex UM OpenAthens/SAML login
|
41
|
+
- **Smart organization**: Papers organized by subject code with proper naming
|
42
|
+
- **ZIP archive creation**: All papers bundled in a convenient ZIP file
|
43
|
+
- **Progress tracking**: Real-time download progress with retry logic
|
44
|
+
- **Cross-platform**: Works on Windows, macOS, and Linux
|
45
|
+
- **Browser flexibility**: Supports Chrome, Edge, and auto-detection
|
46
|
+
|
47
|
+
## 📋 Requirements
|
48
|
+
|
49
|
+
- Python 3.8 or higher
|
50
|
+
- Valid UM student/staff credentials
|
51
|
+
- Internet connection
|
52
|
+
- Chrome or Edge browser installed
|
53
|
+
|
54
|
+
## 🎯 How it Works
|
55
|
+
|
56
|
+
1. **Authentication**: Automatically logs into UM systems via OpenAthens proxy
|
57
|
+
2. **Search**: Finds all past year papers for the specified subject code
|
58
|
+
3. **Download**: Downloads all papers with proper naming and organization
|
59
|
+
4. **Archive**: Creates a ZIP file containing all downloaded papers
|
60
|
+
|
61
|
+
## 📖 Command Options
|
62
|
+
|
63
|
+
```
|
64
|
+
Options:
|
65
|
+
-u, --username TEXT UM username (without @siswa.um.edu.my)
|
66
|
+
-s, --subject-code TEXT Subject code (e.g., WIA1005, WXES1116)
|
67
|
+
-o, --output-dir TEXT Output directory (default: ./downloads)
|
68
|
+
--no-location-prompt Skip location selection prompt
|
69
|
+
--show-browser Show browser window (default: headless)
|
70
|
+
-b, --browser [auto|chrome|edge] Browser choice (default: edge)
|
71
|
+
--timeout INTEGER Session timeout in seconds (default: 30)
|
72
|
+
--max-retries INTEGER Maximum retry attempts (default: 3)
|
73
|
+
-v, --verbose Enable verbose logging
|
74
|
+
--version Show version information
|
75
|
+
-h, --help Show help message
|
76
|
+
```
|
77
|
+
|
78
|
+
## 📁 Output Structure
|
79
|
+
|
80
|
+
```
|
81
|
+
downloads/
|
82
|
+
└── WIA1005/
|
83
|
+
├── Y2023_S1_Final_Exam.pdf
|
84
|
+
├── Y2023_S1_Mid_Term_Test.pdf
|
85
|
+
├── Y2022_S2_Final_Exam.pdf
|
86
|
+
└── ...
|
87
|
+
└── WIA1005_papers.zip
|
88
|
+
```
|
89
|
+
|
90
|
+
## 🔧 Troubleshooting
|
91
|
+
|
92
|
+
### Browser Issues
|
93
|
+
- **Windows**: Tool prefers Edge browser (better compatibility)
|
94
|
+
- **Chrome driver errors**: Try using `--browser edge`
|
95
|
+
- **Browser not found**: Ensure Chrome or Edge is installed
|
96
|
+
|
97
|
+
### Authentication Issues
|
98
|
+
- **Login failed**: Verify your UM credentials
|
99
|
+
- **Timeout**: Increase timeout with `--timeout 60`
|
100
|
+
- **Network issues**: Check your internet connection
|
101
|
+
|
102
|
+
### Download Issues
|
103
|
+
- **No papers found**: Verify the subject code is correct
|
104
|
+
- **Download failures**: Use `--max-retries 5` for unstable connections
|
105
|
+
|
106
|
+
For detailed troubleshooting, run with `--verbose` flag.
|
107
|
+
|
108
|
+
## 🤝 Support
|
109
|
+
|
110
|
+
- **Issues**: Report bugs or request features
|
111
|
+
- **Documentation**: Full documentation available in the repository
|
112
|
+
- **Contributions**: Pull requests welcome!
|
113
|
+
|
114
|
+
## 📄 License
|
115
|
+
|
116
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
117
|
+
|
118
|
+
## ⚠️ Disclaimer
|
119
|
+
|
120
|
+
This tool is for educational purposes only. Please respect University Malaya's terms of service and use responsibly. Only download papers you have legitimate access to as a registered student or staff member.
|