Skip to content

This script automates the process of updating missing product descriptions on a WooCommerce website from a local source.

License

Notifications You must be signed in to change notification settings

OliPassey/BookDescriptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BookDescriptor

  1. Connects to the WooCommerce website using the provided credentials.
  2. Finds the latest CSV file containing product information, such as SKUs and descriptions, in the script's directory.
  3. Loads the CSV file and extracts the necessary product information.
  4. Retrieves a list of products from the website that are missing descriptions.
  5. Goes through each product in the CSV file, checks if it needs a description, and updates the product on the website accordingly.
  6. Logs relevant information for tracking and debugging purposes in a simple, easy-to-read format.

The script helps streamline the process of updating product descriptions on the website, making it more convenient for website administrators to manage product information.

The script is capable of downloading 1000 products per minute, if you have 25k products expect the download to take 25 minutes. Also think about how many API calls you are likely to make. In my first run i had 8k titles to fix and after 4k (many hours) it crashed Apache or SQL (not sure which).

Please test this script on a dev site before letting loose on production, i am not responsible for what this script does to your site, even though i have used and tested it extensively.

Installation & Usage

-Clone the repo locally (run on your PC, not the webserver)
-Create API Key & Secret in WooCommerce (do not share these with anyone)
-Add your site URL & API Credentials to config.json
-Install Python3 if not already installed
-pip install woocommerce
-pip install pandas
-pip install tk
-pip install pillow

Usage
-Place a csv output of ISBN, Synopsis in the same folder as gui.py
-python ./gui.py

Example Output:
PS C:\BookDescriptor> .\script.py
Searching for latest CSV file...
Found CSV file: TitleDataExport_2023041122.csv
Loaded CSV file: TitleDataExport_2023041122.csv
Searching for products without descriptions...
Downloading page 1...
Downloading page 2...
Downloading page 3...
Downloading page 4...
Downloading page 5...
Downloading page 6...
Downloading page 7...
Downloading page 8...
Downloading page 9...
Downloading page 10...
Total products downloaded: 1000
264 products require a description.
Total rows in DataFrame: 1000
Processing SKU 9781905847518
Successfully updated product 407
Processing SKU 9781741047226
Successfully updated product 409
Processing SKU 9780571280421
Successfully updated product 411
Processing SKU 9780007137312
Successfully updated product 413

About

This script automates the process of updating missing product descriptions on a WooCommerce website from a local source.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages