Skip to main content

Scrapy extension for outputting scraped items to an Amazon SQS instance

Project description

Build Status Coveralls Status Requirements Status

scrapy-sqs-exporter

This is an extension to Scrapy to allow exporting of scraped items to an Amazon SQS instance.

Setup

After installing the package, the two classes defined in the library need to be added to the relevant sections of the settings file:

FEED_EXPORTERS = {
  'sqs': 'sqsfeedexport.SQSExporter'
}

FEED_STORAGES = {
  'sqs': 'sqsfeedexport.SQSFeedStorage'
}

The FEED_STORAGES section uses a URL prefixed with sqs to differentiate it from other URI based storage options.

In the environment we also need to define some keys:

AWS_DEFAULT_REGION=eu-central-1
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
FEED_URI=sqs://foo
FEED_FORMAT=sqs

The AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are the AWS credentials to be used, and AWS_DEFAULT_REGION is the region to default to for the SQS instance. FEED_URI is the name of the AWS SQS instance in the AWS_DEFAULT_REGION region for example:

AWS_DEFAULT_REGION=us-east-1
FEED_URI=sqs://bar
FEED_FORMAT=sqs

would refer to a queue name bar in the us-east-1 region.

Finally, the FEED_FORMAT option makes the Scrapy spiders use the SQSExporter class.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapy-sqs-exporter-1.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapy_sqs_exporter-1.1.0-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file scrapy-sqs-exporter-1.1.0.tar.gz.

File metadata

File hashes

Hashes for scrapy-sqs-exporter-1.1.0.tar.gz
Algorithm Hash digest
SHA256 bb4c6a13ef0e1507c7c26618787fd644a5b756ed4d58352c8d5c4678c6ede0ea
MD5 3f0677175ec3591bf8e85740bba13b2e
BLAKE2b-256 8abf42b7412b945a3f7f27bec08ec686a8fd80c6e41f0427804ab528275cf877

See more details on using hashes here.

File details

Details for the file scrapy_sqs_exporter-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for scrapy_sqs_exporter-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57a729fc1852743bf166b3390ca195ef26e29e7cd09fcccfee33449d207112e8
MD5 915e8a399e2f6b36ce962ccd829a944f
BLAKE2b-256 1da3969b94347c5e9dd16c9f18a9e6d1c4a81f5df220f38c5cb9ba31a3855f31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page