Skip to content

Technical design documentation

Kiril Murschel edited this page Feb 7, 2023 · 5 revisions

Backend

Core.py

This is the main class of this application. Core.py handles logging, DB-Connection and overall scraping for the 25 given Vendors. It does so by using the following Methods …

Initialize Vendors

core = Core( vendor_list=vendor_list, logger=logger )

Initializes Vendors-to-run. Not for every run we want to scrape every 25 Vendor Websites for information.

Scrape Vendor Website for all available firmwares (Metadata and Download-Link)

Core.get_product_catalog()

The Core-Module initializes the Vendor-specific Scraping Class and extracts all necessary information from given Vendor-specific website. Scraping takes place with Python and the Selenium package. The result includes Firmwares Download-Link, Versionnumber, Product-Line, Product-Name, potentially scraped MD5-checksum as a List[dict].

This firmware's Metadata List of dictionaries is then temporarily saved in the DB as seperate table.

Compare offered firmwares from Vendor-Webite with historized DB firmwares

db.compare_products()

  • Comparison between Vendor's firmware metadata List[dict] with DB's
  • Based on MINUS Operator (LEFT JOIN)
  • Keys are firmware Versionnumber, scraped-MD5_checksum, …
  • returns firmware metadata that is unknown to the DB
  • thus this unknown firmware gets downloaded

Database Table for firmware

Download new firmware

Core.download_firmware()

Triggers download of new firmwares into downloads/ Since some firmware files are several hundred megabytes, we recommend to have sufficient storage.

Frontend

CLI

Backend Workflow

Backend

How to add new Vendors

You can contribute to this project by adding more Vendors.

create a Vendors.py in src/Vendor

touch init.py in that folder (create empty init.py file in same folder)

add your Vendor in src/init.py accordingly

add your Vendor into the src/config.json file