A Pythonic interface for building IFTTT plugins routed over email.
Project description
# ifttt (If That Then This)
`ifttt` is a simple package for connecting [IFTTT](http://ifttt.com)
channels with your service via and email inbox.
## what?
[IFTTT](http://ifttt.com) provides an interface to an amazing number of services, but since they
lack their own API and have a closed submission process, it's difficult to integrate it into
your applications.
By creating a set of transformations for routing IFTTT channels to email,
we can pass structured data to custom email-listener functions – `ifthat`
which can be routed to an arbitrary `thenthis` function that a user defines.
## installation / dependencies
```
pip install ifttt
```
Our implementation is written and native python 2.7 and has no dependencies.
## examples
### If That Then Say Tweet ...
```python
from ifttt import ifthat
@ifthat('twitter', pattern = "{{UserName}}|||||{{LinkToTweet}}|||||{{Text}}|||||")
def twitter(msg):
import os
os.system('tweet from {text}'.format(**msg['body']))
for msg in twitter():
print msg
```
### If This Then Say YO
```python
from ifttt import ifthat
@ifthat('yo', pattern="{{ReceivedAt}}|||||{{From}}|||||")
def then_yo(msg):
import os
os.system('say yo from {from} &'.format(**msg['body']))
return msg
for msg in yo():
print msg
```
## Configuration
export these environmental variables:
```bash
export IFTTT_USERNAME='username@domain.com'
export IFTTT_PASSWORD='password'
export IFTTT_IMAP_SERVER='mail.domain.com'
export IFTTT_IMAP_PORT=993
```
## TODO
- [ ] Delete Messages
`ifttt` is a simple package for connecting [IFTTT](http://ifttt.com)
channels with your service via and email inbox.
## what?
[IFTTT](http://ifttt.com) provides an interface to an amazing number of services, but since they
lack their own API and have a closed submission process, it's difficult to integrate it into
your applications.
By creating a set of transformations for routing IFTTT channels to email,
we can pass structured data to custom email-listener functions – `ifthat`
which can be routed to an arbitrary `thenthis` function that a user defines.
## installation / dependencies
```
pip install ifttt
```
Our implementation is written and native python 2.7 and has no dependencies.
## examples
### If That Then Say Tweet ...
```python
from ifttt import ifthat
@ifthat('twitter', pattern = "{{UserName}}|||||{{LinkToTweet}}|||||{{Text}}|||||")
def twitter(msg):
import os
os.system('tweet from {text}'.format(**msg['body']))
for msg in twitter():
print msg
```
### If This Then Say YO
```python
from ifttt import ifthat
@ifthat('yo', pattern="{{ReceivedAt}}|||||{{From}}|||||")
def then_yo(msg):
import os
os.system('say yo from {from} &'.format(**msg['body']))
return msg
for msg in yo():
print msg
```
## Configuration
export these environmental variables:
```bash
export IFTTT_USERNAME='username@domain.com'
export IFTTT_PASSWORD='password'
export IFTTT_IMAP_SERVER='mail.domain.com'
export IFTTT_IMAP_PORT=993
```
## TODO
- [ ] Delete Messages
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ifttt-0.1.1.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file ifttt-0.1.1.tar.gz
.
File metadata
- Download URL: ifttt-0.1.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1cc19bbb3e6cbf6575c675ffb0acb48c28395f41353cc286bb9d9361a28183c |
|
MD5 | 1b2b82b89b9776fc0e26ab4e1024c030 |
|
BLAKE2b-256 | e25f4b364f1ef54232794954d5fb148c93105742f5975163bd569e78cf4c71a2 |
File details
Details for the file ifttt-0.1.1.macosx-10.10-intel.exe
.
File metadata
- Download URL: ifttt-0.1.1.macosx-10.10-intel.exe
- Upload date:
- Size: 70.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff450e93ea1f211fbfde85d8d480c236ded62bdfded6cb62d41c4cbce390e836 |
|
MD5 | 9da7abfb5c9e095a18f9c42c8bbdad88 |
|
BLAKE2b-256 | 56907e7dccb917b815d8acf42f5419fce3cb847aa55bb726f9b59bf157c85c71 |