How yuzo-ai/ebay_auto_listing works
Project type and purpose
• This is a Python‐based command-line automation tool (“open-source tool” category) that reads product data from Google Sheets and uses the eBay API to create listings in either sandbox or production environments.
File structure
• Top-level scripts:
• main.py (CLI entry point)
• check_*.py and test_*.py (health checks & unit tests)
• Core modules:
• config.py (default listing settings)
• ebay_env.py (environment switcher: sandbox vs. production)
• ebay_lister.py (wrappers around ebaysdk to create listings)
• google_sheets_reader.py / google_sheets_mock.py (fetch data from Sheets API / mock for testing)
• utils.py (helper functions: image download, retry logic, logging)
• Support files:
• .env.example (environment variable template)
• requirements.txt (.env .gitignore etc.)
README for additional insights
• Confirms two external dependencies (Google Sheets API & eBay API)
• Describes environment configuration, data column schema, retry & logging features, per-row and bulk processing
a. Main components (group these as modules or services):
1. User (CLI)
2. Config/Env Loader (.env via python-dotenv + config.py)
3. Google Sheets Reader (google_sheets_reader.py)
4. Data Processor (utils.py – image handling, retries, Item Specifics)
5. eBay Lister (ebay_lister.py + ebaysdk)
6. Environment Switcher (ebay_env.py)
7. Logging Subsystem (built-in logging to console & ebay_listing.log)
8. External Services:
• Google Sheets API
• eBay API (Sandbox & Production endpoints)
b. Relationships and interactions:
• CLI loads Config/Env Loader ➔ populates credentials & defaults
• CLI calls Google Sheets Reader ➔ fetches raw rows
• Raw rows ➔ Data Processor ➔ handles images & builds “Item” payload
• Payload ➔ Environment Switcher determines endpoint ➔ eBay Lister ➔ invokes eBay API
• eBay API response ➔ Logging Subsystem ➔ console & log file
• Retry logic in Data Processor / eBay Lister on failures
c. Architectural patterns & design principles:
• Clear separation of concerns: reader / processor / lister
• Environment-based routing (sandbox vs. production) via strategy pattern
• Pluggable mocks for testing (google_sheets_mock.py)
• Single responsibility modules for credentials, I/O, business logic
• Layered flow: Input ➔ Transform ➔ Output
d. Key technologies and libraries:
• Python 3.8+
• python-dotenv (config loader)
• google-api-python-client, google-auth-* (Sheets integration)
• ebaysdk (eBay API)
• requests (image retrieval)
• built-in logging