How rishabhvaibhav/assessment_priceeasy works
Repository Scope
This repository contains two independent Python web-scraping projects: a Books to Scrape exporter and a Casey’s store-location scraper. There is no shared package or unified runtime; each project owns its own entry point, scraping target, and CSV outputs.
Books to Scrape Script
Project 1/Book_to_scrape/Scrape_books.py is a standalone scraper for the Books to Scrape site. It produces the checked-in dataset at Project 1/Book_to_scrape/books.csv. Its architecture is a direct fetch/parse/export pipeline rather than a reusable application.
Casey’s Modular Application
The primary structured application is under Project 2/caseys_scraper/Prod_debug. Its executable entry point is Project 2/caseys_scraper/Prod_debug/main.py, which coordinates configuration, request execution, extraction, persistence, and run reporting.
Key runtime inputs are Project 2/caseys_scraper/Prod_debug/config.json and Project 2/caseys_scraper/Prod_debug/requirements.txt.
Configuration and Request Boundary
Project 2/caseys_scraper/Prod_debug/core/config.py loads and exposes scraper settings from Project 2/caseys_scraper/Prod_debug/config.json. Proxy material is maintained separately in Project 2/caseys_scraper/Prod_debug/proxies/proxies.txt.
Project 2/caseys_scraper/Prod_debug/core/scraper.py forms the network boundary: it is responsible for obtaining Casey’s source content, likely applying configured request behavior and proxy selection. The external service is Casey’s store-location/web data source; access reliability is an architectural concern because proxy support is explicitly present.
Extraction Stage
Project 2/caseys_scraper/Prod_debug/core/extractor.py separates parsing and normalization of store records from HTTP retrieval. This boundary lets scraper behavior change independently from the expected store-data schema and makes extracted records suitable for multiple output formats.
Storage, State, and Outputs
Project 2/caseys_scraper/Prod_debug/core/storage.py persists extracted data and scraper state. The application produces:
• Project 2/caseys_scraper/Prod_debug/output/caseys_stores_data.csv
• Project 2/caseys_scraper/Prod_debug/output/caseys_stores_data.json
• Project 2/caseys_scraper/Prod_debug/output/scraped_state.json
• Project 2/caseys_scraper/Prod_debug/output/run_summary.json
The state file indicates the scraper supports progress tracking, resumption, deduplication, or incremental execution. The run summary is a separate operational-reporting artifact rather than primary domain data.
Alternate Casey’s Implementation
Project 2/caseys_scraper/Single Script/caseys_scraper.py is a separate monolithic implementation of the same Casey’s scraping concern. It writes Project 2/caseys_scraper/Single Script/caseys_stores_data.csv and should be treated as an alternative execution path, not a module imported by the modular application.
Primary Control Flow
For the modular Casey’s scraper, control flows from main.py through configuration loading, optional proxy/input setup, network scraping, record extraction, and storage/reporting. Data crosses three important boundaries: remote Casey’s content into core/scraper.py, unstructured response data into normalized records in core/extractor.py, and normalized records/state into durable CSV, JSON, and status artifacts via core/storage.py.
Main entry points: storage.py Storage and state · scraper.py Request executor · main.py Run coordinator · config.py Configuration loader
Components 18
Books Exporter
Standalone fetch/parse/export script.
- Books to Scrape
- Books scraper
Project 1/Book_to_scrape/Scrape_books.py - Books dataset
Project 1/Book_to_scrape/books.csv
Casey's Modular Scraper
Primary structured scraping application.
- Python dependencies
Project 2/caseys_scraper/Prod_debug/requirements.txt - Run coordinator · Coordinates the modular scraping run.
Project 2/caseys_scraper/Prod_debug/main.py - Scraper settings
Project 2/caseys_scraper/Prod_debug/config.json - Configuration loader
Project 2/caseys_scraper/Prod_debug/core/config.py - Proxy list
Project 2/caseys_scraper/Prod_debug/proxies/proxies.txt - Casey's store source
- Request executor · Network boundary for Casey's source content.
Project 2/caseys_scraper/Prod_debug/core/scraper.py - Store extractor · Parses and normalizes store records.
Project 2/caseys_scraper/Prod_debug/core/extractor.py - Storage and state · Persists records, progress state, and run reporting.
Project 2/caseys_scraper/Prod_debug/core/storage.py - Store CSV
Project 2/caseys_scraper/Prod_debug/output/caseys_stores_data.csv - Store JSON
Project 2/caseys_scraper/Prod_debug/output/caseys_stores_data.json - Scrape state · Supports incremental or resumable execution.
Project 2/caseys_scraper/Prod_debug/output/scraped_state.json - Run summary
Project 2/caseys_scraper/Prod_debug/output/run_summary.json
Casey's Single Script
Alternative monolithic execution path.
- Casey's single scraper · Independent alternative to the modular application.
Project 2/caseys_scraper/Single Script/caseys_scraper.py - Store CSV
Project 2/caseys_scraper/Single Script/caseys_stores_data.csv
Connections 17
- Books to Scrape → Books scraper: pages
- Books scraper → Books dataset: exports
- Python dependencies → Run coordinator: environment
- Run coordinator → Configuration loader: loads settings
- Scraper settings → Configuration loader: read by
- Configuration loader → Request executor: request settings
- Proxy list → Request executor: proxy material
- Run coordinator → Request executor: runs
- Casey's store source → Request executor: source content
- Request executor → Store extractor: responses
- Store extractor → Storage and state: normalized records
- Storage and state → Store CSV: writes
- Storage and state → Store JSON: writes
- Storage and state → Scrape state: updates
- Storage and state → Run summary: reports
- Casey's store source → Casey's single scraper: source content
- Casey's single scraper → Store CSV: exports