Giter VIP home page Giter VIP logo

pytill's Introduction

pytill

Documentation Status

Python package for using Till Mobile brought to you by https://manifold.co

How to use

Set up a plan for till and retrieve till username and api key. This packages expects the username and api key are injected as env vars USERNAME and API_KEY.

You can do this simply through manifold: (see: https://docs.manifold.co/docs/cli-quickstart-6JMEw1CD6wguwIYymUuAQ6)

manifold create -p till-project --product till --plan free # provision a free till resource
manifold run -p till-project -- python # inject vars
import pytill # or from pytill import pytill

# send a message
pytill.send_message(['19024880000'], 'I am sending a till message isnt that cool!')

# ask a question
# note that asking a question is how we open two-way communicate in Till
# so this is also how you intiate listening to responses to a sms number with Till
question = pytill.make_question('How cool is Till mobile?', 'my-question', 'my.webhook/listens/here')
pytill.send_question(['19024441111', '16139094888'], [question],  'my-project')

# retrieve result
print(pytill.get_results(question_tag='my-question'))

# example output

# {'meta': {'limit': 20, 'next': None, 'offset': 0, 'previous': None, 'total_count': 1}, 'objects': [{'created': '2018-08-27T19:07:35.423855', 'guid': '252cd98f-5969-44c9-a955-7bb54e6f0d19', 'origin_phone_number': '+16508668969', 'participant_guid': '883c8f57-74b9-43cb-bb72-c7634b97651a', 'participant_phone_number': '+19024000158', 'project_launch_guid': '80262aea-a77e-4a0c-911f-23b959aea6da', 'project_launch_participant_guid': '8a23ee27-4841-4f2b-83d5-2a59a05825b8', 'project_tag': 'my-project', 'question_display_order': '0', 'question_guid': '8c8c168f-87d5-454d-8bae-09781312c097', 'question_tag': 'my-question', 'question_text': 'How cool is Till mobile?', 'result_answer': 'really cool!', 'result_guid': '252cd98f-5969-44c9-a955-7bb54e6f0d19', 'result_response': 'really cool!', 'result_timestamp': '2018-08-27T19:07:35.423855', 'updated': '2018-08-27T19:07:35.423884'}]}

# retrive stats about till usage
print(pytill.get_stats())

pytill's People

Contributors

domenicrosati avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.