Skip to main content

Extract and process study data from WBH Online Campus HTML exports

Project description

WBH Campus Scraper

Extract and process study program data from WBH Online Campus HTML exports.

Quick Start

Option 1: Direct Online Extraction (NEW!)

# Extract directly from WBH Online Campus
wbh-scraper --online -u YOUR_USERNAME

# With specific study program (if you have multiple)
wbh-scraper --online -u YOUR_USERNAME --program 0

# Setup secure credential storage (PERSONAL computers only!)
wbh-scraper --setup-credentials

# Reset/delete stored credentials
wbh-scraper --reset-credentials

Option 2: From HTML Export

# 1. Export HTML from WBH Campus:
#    My Studies → Study Programs → [Your Program] (e.g. Computer Science)
#    → Save complete webpage as curriculum.html

# 2. Extract data
wbh-scraper curriculum.html

# With options
wbh-scraper curriculum.html --debug  # Enable debug mode
wbh-scraper curriculum.html -o my_data.json  # Custom output

What Gets Extracted?

A structured JSON file (data.json) containing:

  • Study program information (ID, number, name)
  • All modules with correct credit points
  • All elements (study booklets, exams, seminars)
  • All documents (PDF, EPUB, HTML, MP3, ZIP)
  • Semester assignments automatically calculated
  • Module hierarchy preserved

Features

  • Direct online extraction from WBH Campus (NEW!)
  • Secure credential storage using system keychain (macOS/Windows/Linux)
  • OOP architecture with clean data models
  • Automatic CP extraction from exams
  • Document information for downloads
  • Debug mode for development
  • Statistics and analysis
  • Unit tests for quality assurance
  • Secure password handling with getpass

Project Structure

wbh-campus-scraper/
├── scraper/            # Main package
│   ├── models/         # Data models
│   └── scraper.py      # Main class
├── tests/              # Unit tests
├── main.py            # CLI entry point
└── setup.py           # Package setup

How It Works

  1. Scraping: Extracts JSON data from HTML (WL.DEBUG.iCurriculumJSON)
  2. Parsing: Processes raw data into structured models
  3. Building: Creates complete study program hierarchy
  4. Export: Saves as clean JSON with all relationships

Python API

from scraper import WBHScraper

# Initialize scraper with HTML file
scraper = WBHScraper("curriculum.html")

# Access raw JSON directly (default)
raw_data = scraper.raw_json

# Or get transformed data
study_program = scraper.transform()
print(f"Program: {study_program.study_program.number} {study_program.study_program.name}")
print(f"Total modules: {len(study_program.modules)}")

# Save to file
scraper.save_to_file("output.json")

Installation

# Via PyPI (recommended)
pip install wbh-campus-scraper

# Via Homebrew
brew tap jonaskern-dev/tap
brew install wbh-campus-scraper

# Via pip from GitHub
pip install git+https://github.com/jonaskern-dev/wbh-campus-scraper.git

# For development
git clone https://github.com/jonaskern-dev/wbh-campus-scraper.git
cd wbh-campus-scraper
pip install -e .

# After installation, the command is available:
wbh-scraper --version

# Run tests
python -m unittest discover tests

License

MIT License

Author

Jonas Kern - info@jonaskern.de - https://jonaskern.dev


Version 0.6.0

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

wbh_campus_scraper-0.6.0.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wbh_campus_scraper-0.6.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file wbh_campus_scraper-0.6.0.tar.gz.

File metadata

  • Download URL: wbh_campus_scraper-0.6.0.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for wbh_campus_scraper-0.6.0.tar.gz
Algorithm Hash digest
SHA256 51e8c906aa390937be1a445343476ae1270cf70855ef623ef5e90a0d6612c6a0
MD5 84f087cccf00272d4d1d2b9403765810
BLAKE2b-256 794738de56df1c61806e9884a1d98a8643987381169b1b0aa275b6f8ab28c081

See more details on using hashes here.

File details

Details for the file wbh_campus_scraper-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wbh_campus_scraper-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dac0e078c196e02b642df5742d62dca57294da5c73eb681951d2596db2e0e4bd
MD5 fc23c5b03ce41f8034f828034077aa1e
BLAKE2b-256 b736551ecea1f391650343dd1c2a831503860ac3d1bd21cee99d6c0ab9f0ae46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page