How silent-this-sonder/sb3-bulk-downloader works
1. Repository shape
- This is a small Python tool with two top-level entry points: main.py and gui.py.
- The rest of the repo is mostly support files: downloads/ for generated output, and GitHub Actions workflows for CI.
2. Primary purpose
- The tool automates downloading Scratch projects from a user’s own Scratch account.
- The core domain boundary is between the local client and the external Scratch service, which provides project identity, sharing status, and downloadable project files.
3. User-facing modes
- The README describes two interfaces: a CLI and a GUI.
- The CLI is the operationally complete path today; the GUI exists as an alternate front end but is not yet the main supported workflow.
4. Likely architecture split
- main.py appears to be the command-line orchestration layer: login, project selection/filtering, and triggering downloads.
- gui.py is a separate presentation layer that likely reuses the same underlying download logic or mirrors the CLI flow with UI controls.
- The repository layout suggests there is not a deep package hierarchy; instead, the app is organized as a lightweight script-based utility.
5. External dependency boundary
- Scratch is the critical external system. The app needs to authenticate as the user, enumerate projects, and retrieve project data.
- The README explicitly notes that logging in enables downloading unshared projects too, so authentication is not just optional convenience; it changes what data the client can access.
6. Data flow
- User starts the program.
- The app authenticates against Scratch.
- The app retrieves the project list and applies a user-selected filter: all, shared only, or unshared only.
- The app downloads each selected project to local storage, presumably as .sb3 files or equivalent Scratch project archives.
- Output is written under downloads/, which is treated as generated content rather than source code.
7. Local output boundary
- downloads/.gitignore indicates the downloaded project files are intentionally excluded from version control.
- This directory is the main persistence boundary inside the repo: source code stays in the root, generated artifacts accumulate under downloads/.
8. Operational constraints
- The README warns that the process must remain running and connected; interruption can corrupt or abort the batch download.
- That implies the application is a batch-oriented client rather than a background sync service or resumable queue.
9. CI / quality gates
- .github/workflows/pylint.yml suggests static analysis is enforced in CI.
- .github/workflows/prtest.yml suggests pull requests get automated checks, likely basic validation and lint/test gating.
- This repo therefore has lightweight automation around code quality, even if the app itself is minimal.
10. Architecture summary for a diagram
- The best diagram is a simple client-centric one: user interacts with either CLI or GUI, which both drive the same Scratch-auth-and-download workflow, and the resulting files are stored locally in downloads/.
- The only major external integration is Scratch; there are no visible databases, message queues, or backend services in the repository tree.
Main entry points: main.py CLI · gui.py GUI · prtest.yml PR checks · pylint.yml Lint
Components 10
Application
User-facing script entry points and batch download flow
External
Remote service boundary
- Scratch · Source of project identity, sharing status, and project files
CI
Automated checks in GitHub Actions
Output
Generated local download artifacts
- Downloads · Generated project archives written under downloads/
downloads/.gitignore
Other components
- User · Starts the downloader and chooses a mode
Connections 14
- User → CLI: uses · Primary operational path
- User → GUI: uses · Alternative interface
- CLI → Login: starts · Begins the authenticated batch flow
- GUI → Login: starts · Triggers the same login-driven workflow
- Login → Scratch: authenticates · Establishes access to the Scratch account
- Login → Project list: enables · Unlocked account can enumerate projects
- Project list → Scratch: queries · Reads project identity and shared state
- Project list → Downloader: selects · Applies all/shared/unshared filtering
- Downloader → Scratch: fetches · Downloads project archives from Scratch
- Downloader → Downloads: writes · Stores generated files locally
- PR checks → CLI: checks · Validates the script-based app
- PR checks → GUI: checks · Validates the alternate front end
- Lint → CLI: analyzes · Lint gate for core orchestration
- Lint → GUI: analyzes · Lint gate for UI entry point