pytill package

Submodules

pytill.pytill module

Main module.

pytill.pytill.get_result(result_guid)[source]

Get single result from result guid retreived in a get_results call

pytill.pytill.get_results(question_tag=None, project_tag=None, project_launch_guid=None, participant_guid=None)[source]

Get results for questions asked

Args:
question_tag (str, optional): Tag from question to retreive on. Defaults to None. project_tag (str, optional): Tag from project (ie. list of questions to retreive on. Defaults to None. project_launch_guid (str, optional): Project guid to retreive on. Defaults to None. participant_guid (str, optional): Participant guid (ie. person/number) to retreive on. Defaults to None.
Example:
>>> pytill.get_results(question_tag='my-question')
{'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'}]}
pytill.pytill.get_stat(project_launch_guid)[source]

Get particulat status for a project_launch_guid

pytill.pytill.get_stats(project_tag=None)[source]

Get status of your Till usage. This can be broken down by project_tag.

pytill.pytill.make_question(text, tag, webhook, responses=None, conclude_on=None)[source]

Make a question to ask.

Args:
text (str): Question to ask. tag (str): Question tag for retrieving results. webhook (str): Webhook to listen for results on. responses (list, optional): List of responses to provide. Defaults to None. conclude_on (str, optional): Response the question should conclude on. Defaults to None.
Returns:
dict: Question to be asked
Examples:
>>> question = pytill.make_question(
    "This is my cool question?", "cool-q-1", "sweet-web-hook-bro",
    responses=["yes", "no"], conclude_on="Thanks for answering."
)
pytill.pytill.send_message(numbers, text, tag=None, voice=False)[source]

Send a message with till.

Args:
numbers (list): List of numbers to send message to. text (str): Message to send. tag (str, optional): Tag to tag the project with. Defaults to None. voice (bool, optional): Whether or not to send message as boice. Defaults to None.
Returns:

dict: Data relating to monitoring the message sent: .. codeblock:: python

{
‘stats_url’: param1, ‘results_url’: param2, ‘project_launch_guid’: param3

}

Raises:
HTTPError: For various reasons due to misconfiguration or insuffecient plan.
Examples:

Send a voice message with tag greeting to multiple people.

>>> resp = pytill.send_message(
    ['19021231234', '19024564567'],
    text='Hi!', tag='Greeting', voice=True)
{'stats_url': param1, 'results_url': param2, 'project_launch_guid': param3}
pytill.pytill.send_question(numbers, questions, tag, introduction=None, conclusion=None, voice=False)[source]

Send questions to ask

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

Args:
numbers (list): List of numbers to send questions to. questions (list): List of questions to send. tag (str): Project tag for retrieving results for various questions. introduction (str, optional): Optional introduction to question(s). Defaults to None. conclusion (str, optional): Optional conclusion to question(s). Defaults to None. voice (bool, optional): Whether or not to ask the questions via voice. Defaults to None.
Returns:
dict: Data relating to monitoring the question sent:
{
‘stats_url’: param1, ‘results_url’: param2, ‘project_launch_guid’: param3

}

Example:
>>> question = pytill.make_question('How cool is Till mobile?', 'my-question', 'my.webhook/listens/here')
>>> pytill.send_question(['19024441111', '16139094888'], [question],  'my-project')

Module contents

Top-level package for pytill.