Skip to content

invictuscapital/nameko-twilio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nameko-twilio

Twilio dependency for nameko services

Installation

pip install nameko-twilio

Usage

from nameko.rpc import rpc
from nameko_twilio import Twilio


class Service:
    name = "service"
    
    twilio = Twilio()
    
    @rpc
    def send_sms(self, number, message):
        msg = self.twilio.messages.create(
            number,
            body=message,
            from_="+1234567890"
        )
        return f"Message {msg.sid}"

Specify your configuration like this:

TWILIO:
  SID: abcd
  TOKEN: efgh

About

Twilio dependency provider for nameko services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages