Abstract

This is API documentation for Panegyric.

panegyric package

panegyric package

Submodules

digraph inheritancec5ec4d45e5 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "panegyric.text.Text" [URL="#panegyric.text.Text",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines and constructs Text objects."]; }

panegyric.text module

This module contains the Text class.

class panegyric.text.Text(message_file_path)[source]

Defines and constructs Text objects.

Parameters:

message_file_path (str) – Path to the file containing messages.

Attributes

api_key = 'textbelt'[source]

The API key to use for sending texts.

current_date = None[source]

The date of execution.

message = None[source]

The message to send.

messages = [][source]

All of the messages that can be sent.

message_file_path = None[source]

Path to a yaml file containing messages.

phone = '0000000000'[source]

Phone number to send to.

url = 'https://textbelt.com/text'[source]

The url for the text sending service.

Methods

__init__(message_file_path)[source]

Initialize a Text instance.

Parameters:

message_file_path (str) – Path to the file containing messages.

import os # import sentry_sdk # sentry_sdk.init(os.environ.get(‘SENTRY_DSN’))

get_message()[source]

Get a message to send.

Variables:
  • all_messages (dict) – All of the messages.

  • least_recent_date (datetime.datetime) – Oldest message send.

  • message (str) – Message to send.

check_send_date(message, least_recent_date)[source]

Check that this is least recently sent message.

Parameters:
  • message (str) – Message to check the date of.

  • least_recent_date (datetime.datetime) – Oldest sned for a message.

get_all_messages()[source]

Get all messages.

Variables:

yml (ruamel.yaml.YAML) – A YAML object to parse messages.

send_message()[source]

Send the selected message.

Variables:
  • text_from (str) – Message from.

  • text_text (str) – Message text.

  • message_dict (dict) – Dictionary with payload.

  • resp (requests.Response) – Response from API.

write_messages()[source]

Write updated messages message list.

Variables:

yml (ruamel.yaml.YAML) – A yaml object to write messages.

panegyric.text.main()[source]

Execute main program.

Variables:
  • text (Text) – The Text object.

  • result (requests.Response) – Response object.

Module contents

This module contains the Text class.

class panegyric.text.Text(message_file_path)[source]

Bases: object

Defines and constructs Text objects.

Parameters:

message_file_path (str) – Path to the file containing messages.

api_key = 'textbelt'[source]

The API key to use for sending texts.

check_send_date(message, least_recent_date)[source]

Check that this is least recently sent message.

Parameters:
  • message (str) – Message to check the date of.

  • least_recent_date (datetime.datetime) – Oldest sned for a message.

current_date = None[source]

The date of execution.

get_all_messages()[source]

Get all messages.

Variables:

yml (ruamel.yaml.YAML) – A YAML object to parse messages.

get_message()[source]

Get a message to send.

Variables:
  • all_messages (dict) – All of the messages.

  • least_recent_date (datetime.datetime) – Oldest message send.

  • message (str) – Message to send.

message = None[source]

The message to send.

message_file_path = None[source]

Path to a yaml file containing messages.

messages = [][source]

All of the messages that can be sent.

phone = '0000000000'[source]

Phone number to send to.

send_message()[source]

Send the selected message.

Variables:
  • text_from (str) – Message from.

  • text_text (str) – Message text.

  • message_dict (dict) – Dictionary with payload.

  • resp (requests.Response) – Response from API.

url = 'https://textbelt.com/text'[source]

The url for the text sending service.

write_messages()[source]

Write updated messages message list.

Variables:

yml (ruamel.yaml.YAML) – A yaml object to write messages.

panegyric.text.main()[source]

Execute main program.

Variables:
  • text (Text) – The Text object.

  • result (requests.Response) – Response object.