Skip to main content

scrapy-mailgun: Hook emails with scrapy.

Project description

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description: # Scrapy-mailgun: Mailgun integration for Scrapy

A [mailgun](https://mailgun.com) integration for scrapy.

## Quick Start

Install via `pip`:

```
$ pip install scrapy-mailgun
```

What's available right now is an `EmailReport` extension, that allows you to send a report once a spider is done through mailgun.

Configure:

```python
EXTENSIONS = {
'scrapymailgun.extensions.EmailReport': True,
}

SM_DOMAIN = 'api.mailgun.net/v3/XXXXXXXXXXXXXXXX.mailgun.org'
SM_KEY = 'key-XXXXXXXXXXXXXXXXX'
SM_FROM = 'from-email@acme.org'
SM_TO = 'to-email@acme.org' # comma sparated

SM_EMAIL_REPORT_TMPL_SUBJECT = 'Your spider [{{spider.name}}] is done: {{reason}}'
SM_EMAIL_REPORT_TMPL_BODY = 'job stats: {{ spider.crawler.stats._stats }}'
```

### Templates

Currently verbatim template strings are supported for flexible scraper configuration (you can change these remotely with no deploy).

As for template variables, what's available to you is your `spider` and `reason` instances directly. Do what ever you want with those in the templates.


## Developers

Set up a development environment
```
$ pip install -r requirements.txt
```

### Development

* Dependencies: list them in `requirements.txt`

### Release

* Dependencies: list them in `setup.py` under `install_requires`:

```python
install_requires=['peppercorn'],
```

Then:

```
$ make dist && make release
```

# Contributing

Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).


### Thanks:

To all [Contributors](https://github.com/jondot/scrapy-mailgun/graphs/contributors) - you make this happen, thanks!


# Copyright

Copyright (c) 2017 [Dotan Nahum](http://gplus.to/dotan) [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE) for further details.

Platform: UNKNOWN

Project details


Download files

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

Files for scrapy-mailgun, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size scrapy_mailgun-0.3.0-py2-none-any.whl (5.8 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size scrapy-mailgun-0.3.0.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page