platform Python application designed to automatically fetch public images ("pins") from a specified Pinterest board and set them as your desktop wallpaper, creating a dynamic wallpaper engine experience. The project leverages browser automation, web scraping, and image processing to seamlessly rotate wallpapers based on user-selected Pinterest content. ::update
Order of Operations
-
Startup & Configuration
- The user initiates the application by running
main.py main.pyfirst loads configuration variables fromconfig.pyand sets up logging viautils/logger.py
- The user initiates the application by running
-
System Checks
main.pycalls helper functions fromutils/helpers.pyto validate source/destination paths and ensure the temporary image folder exists
-
User Input (GUI)
main.pylaunches the GUI window fromgui/tkinterWindow.py- The GUI prompts the user for a Pinterest board URL, validates its format, and checks accessibility
-
Fetching Pinterest Board Data
- Once a valid URL is provided,
main.pycalls the board data fetcher incore/fetcher.py core/fetcher.pyuses Selenium and BeautifulSoup to load the Pinterest board, extract pin data, and filter out unwanted content- Pin and board objects are structured using models from
core/pinModel.py
- Once a valid URL is provided,
-
Selecting and Downloading an Image
main.pyusesutils/helpers.pyto randomly select an image from the board’s pins- The selected image is downloaded to the temporary folder via
core/downloader.py
-
Image Validation and Processing
- The downloaded image is validated and processed for screen compatibility using
core/validation.py
- The downloaded image is validated and processed for screen compatibility using
-
Setting the Wallpaper
- The processed image is set as the desktop wallpaper using platform-specific logic in
core/wallpaper.py
- The processed image is set as the desktop wallpaper using platform-specific logic in
-
Cleanup
- Upon completion or shutdown,
main.pytriggers cleanup routines fromcore/cleanup.pyto remove temporary files
- Upon completion or shutdown,
Brief Synopsis
::update
- x ::update
Asahi Linux (Fedora)
- download git ::update
- download python ::update
- using
git --version&python --versionto validate downloads x::update
Windows
- download git ::update
- download python ::update
- using
git --version&python --versionto validate downloads x::update
MacOS
- download homebrew by opening terminal and entering
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - download git by opening terminal and entering
brew install git - using
brew --version&git --versionto validate downloads - download dos2unix by opening terminal and entering
brew install dos2unix - download python3 [https://www.python.org/ftp/python/3.13.2/python-3.13.2-macos11.pkg]
x::update
Asahi Linux (Fedora)
- clone the repo & cd in
x::update
Windows
- Clone the repo & cd into the project directory
- Give the setup script permission via
chmod +x setup.sh(if using Git Bash or WSL) - Run the setup script via
./setup.sh - Activate the virtual environment:
.\venv\Scripts\activate - Run the program:
python main.py
MacOS
- clone the repo & cd in
- give the setup script permission via
chmod +x setup.sh - run the setup script via
./setup.sh - activate virtual environment
source venv/bin/activate - run the program
python3 main.py
Current Project Structure
PinPy\
- core\
- cleanup.py
- downloader.py
- fetcher.py
- pinModel.py
- validation.py
- wallpaper.py
- gui\
- assets\
- colors.py
- logo.png
- tkinterWindow.py
- assets\
- utils\
- helpers.py
- logger.py
- .gitignore
- config.py
- main.py
- ReadMe.md
- requirements.txt
- setup.sh
::update
ToDo
-
Updated CLI
Goal : Enhance the command-line interface for better user experience and debuggingActions : Integrate a CLI framework (e.g., argparse or click) for structured commands and options, Add colorized output using colorama or rich for status, warnings, and errors , Refactor logging to support verbosity levels and colored logs , Add CLI options for headless mode, board URL input, and cleanup
Files Impacted : main.py & logger.py
-
Tkinter GUI Redesign Goal : Modernize the GUI to match Pinterest’s color scheme and improve usability
Actions : Redesign UI elements (buttons, backgrounds, fonts) to use Pinterest’s red, white, and gray palette, Add a logo or favicon for branding Improve input validation feedback (e.g., colored borders, tooltips) , Add progress indicators for fetching and downloading , Modularize GUI logic for easier maintenance
Files Impacted : tkinterWindow.py
New: assets/ (for icons, color constants)
-
PinModel Structure Update Goal: Make pin and board data models more extensible and robust
Actions : Add more attributes to Pin (e.g., title, description, repin count, link) , Add metadata to Board (e.g., owner, category, total pins) , Implement serialization/deserialization for saving/loading boards , Add type hints and validation in constructors
Files Impacted : pinModel.py
-
Optimized Pin Fetching & Collection Goal: Make pin retrieval more reliable and efficient
Actions: Dynamically adjust Selenium scroll depth based on actual pin count and retrieval validation , Add retry logic for failed fetches , Filter out duplicates and ads more robustly , Log pin fetching progress and errors , Modularize fetching logic for easier testing
Files Impacted : fetcher.py (scroll logic, validation, modularization) & pinModel.py (for new attributes)
-
Selenium Optimization (All OS)
Goal : Ensure Selenium runs smoothly on Windows, macOS, and Linux
Actions : Detect OS and configure drivers accordingly (Chrome, Edge, Firefox) , Add headless mode and resource management, Handle browser installation and updates automatically , Document setup steps for each OS in the ReadMe , Add error handling for common Selenium issues (timeouts, missing drivers).
Files Impacted : fetcher.py (driver setup, OS detection) & setup.sh (driver installation) & ReadMe.md (setup documentation)