Beginner Project: This week's beginner project is to create a simple program that reads and writes data to a CSV file. You'll need to use Python's built-in csv
module to accomplish this task. Start by creating a script that reads a given CSV file and prints its content to the console.
Beginner Stretch Goal: Enhance your script to take user input and add new rows to the CSV file. You can use the input()
function to collect user input and then append it to the CSV file.
Intermediate Project: Moving up a level, your intermediate project is to create a basic file organizer. Your program should accept a directory path as an argument and organize the files within it into subfolders based on their file extensions. For example, all .txt
files should be moved into a folder named "txt," and all .jpg
files should be moved into a folder named "jpg."
Intermediate Stretch Goal: Add an option to your file organizer to also rename the files according to a specified naming convention (e.g., adding a prefix or suffix, or using a date-based naming system).
Advanced Project: For the advanced project, you will create a simple web scraper using Python's requests
library and BeautifulSoup
. Your scraper should be able to fetch a webpage, extract specific information (e.g., headings, links, or images), and store that data in a structured format (such as JSON, CSV, or XML).
Advanced Stretch Goal: Improve your web scraper by implementing pagination support to scrape multiple pages on a website. Additionally, consider adding error handling and rate limiting to ensure your scraper runs smoothly and respects the target site's rules.
P.S. I’m back! I had to take a long break for health reasons but I am back and have several months of weekly newsletters queued up and ready to go. If you have ideas for more challenges reach out and let me know!