Python Assignment
Python Assignment
Objective:
This assignment aims to test your skills in web scraping, automation, and data handling using
Python. You will complete three distinct tasks that involve building a web scraping tool, automating a
Task:
Create a Python script that scrapes data from a specified website and stores it in a structured format
(CSV or JSON).
Requirements:
1. Website Selection:
- Choose a publicly accessible website that lists products, articles, or any structured data (e.g.,
- Select at least five data points to scrape for each item (e.g., title, price, date, URL, description).
3. Pagination Handling:
- The script should handle pagination if the website displays data across multiple pages.
4. Error Handling:
- Implement basic error handling for cases like connection issues or missing data.
5. Data Storage:
Deliverables:
Task:
Develop a Python script that automates the creation of a Key Performance Indicator (KPI)
dashboard using a given dataset.
Requirements:
1. Dataset:
2. KPIs to Calculate:
3. Data Visualization:
- Use a Python library like `matplotlib` or `plotly` to create visual representations (bar charts, line
4. Dashboard Output:
- The script should generate a PDF or HTML file that includes the visualized KPIs, along with the
5. Automation:
- Set up the script to run automatically at specified intervals (e.g., daily, weekly) and save the
Deliverables:
A brief description of how to schedule the script using a task scheduler (like `cron` on Linux or Task
Scheduler on Windows).
Task:
Create a Python script that automates the downloading of a report from a given URL, extracts data
from the report, and uploads the processed data to a Google Sheet.
Requirements:
1. Report Download:
- Use Python to download a report (e.g., an Excel or CSV file) from a specified URL.
2. Data Extraction:
- Extract specific data points from the downloaded report (e.g., total sales, top products, etc.).
3. Data Processing:
- Process the extracted data (e.g., calculate totals, filter by a certain criteria).
- Use the Google Sheets API to create a new sheet (or update an existing one) with the processed
data.
5. Automation:
- Automate the entire process, so the script runs at regular intervals (e.g., daily or weekly) to
Deliverables:
Instructions for setting up Google Sheets API access, including how to create credentials and share
the sheet.
Evaluation Criteria:
1. Correctness and Efficiency: Scripts should perform the tasks as expected with efficient use of
resources.
2. Code Quality: Clean, readable code with proper documentation and comments.
3. Error Handling: Adequate handling of exceptions and potential issues (e.g., network errors,
missing data).
4. Automation Setup: Proper setup and explanation of how to automate the scripts.