gitmyhub

gsoc-proposal

★ 0 updated 5y ago ⑂ fork

GSoC proposal for scrapy

A Google Summer of Code proposal outlining three planned Scrapy features: filtering scraped items before export, auto-compressing output files, and splitting exports into batches.

PythonScrapysetup: easycomplexity 3/5

What This Repository Is

This is a Google Summer of Code proposal—a detailed plan for a student project—submitted by Siddhartha to improve Scrapy, an open-source tool used for web scraping. The proposal outlines three specific enhancements to how Scrapy handles and exports the data it collects from websites.

What the Enhancements Do

Imagine you're scraping thousands of product listings from websites and saving them to files. Right now, Scrapy exports everything it finds. This proposal adds three features to give you more control: First, you can filter items so only the ones matching certain conditions get exported—for example, only products costing more than $100. Second, you can automatically compress or archive your output files to save storage space, similar to how you'd zip a folder. Third, you can set automatic triggers to split your exports into batches—like creating a new file every time you've collected 1,000 items, or every 10 minutes, or when files reach a certain size.

How It Works

The proposal describes changes to Scrapy's "feed exporter," the component responsible for writing scraped data to output files. When an item is scraped, instead of automatically exporting it, the system would check it against user-defined filters first. If the item passes, it gets exported to a file. As items accumulate, the batch system monitors constraints like item count or file size and automatically creates new files when limits are reached. Finally, the compression and archiving system packages these files efficiently.

Who Would Use This

Web scrapers, data engineers, and anyone automating large-scale data collection would benefit. A researcher scraping scientific papers might filter for only peer-reviewed sources. A price-monitoring service might batch results hourly. Someone scraping millions of records would appreciate automatic compression to manage storage costs. The proposal notes that users can customize behavior through Scrapy's settings file or even write their own filter and batch logic, making it flexible for different needs.

The proposal includes code examples and implementation details, though it's clear this is a high-level plan rather than finished code. The actual development would happen if the proposal is accepted into the Google Summer of Code program.

Where it fits