API reference

class wittyPy.WittyPi(path)[source]

Central instance to run functions on the wittyPy.

Parameters:
  • path (str) – Path to your wittyPi folder (Where “wittyPi.sh”, “utilities.sh”, “daemon.sh” can be found).
  • next_start (WittyTime) – WittyTime object, if a startup is set, else None.
  • next_shutdown (WittyTime) – WittyTime object, if a shutdown is set, else None.
  • available_schedules (list) – List of available schedules.
  • timedelta (float) – Difference between system time and Realtime Clock time. If positive, system time is ahead of the RTC and vice versa.
activate_schedule(index)[source]

Activates a WittyPi schedule, chosen by their index in self.available_schedules.

set_startup(*args)[source]

Set startup for the WittyPi. Takes up to four *args.

Parameters:*args
  1. Day (int or str): Either integer between 1-31 or ”??” for wildcard.
  2. Hour (int or str): Either integer between 0-23 or ”??” for wildcard.
  3. Minute (int): Integer between 0-59.
  4. Second (int): Integer between 0-59.
set_shutdown(*args)[source]

Set shutdown for the WittyPi. Takes up to three *args.

Parameters:*args
  1. Day (int or str): Either integer between 1-31 or ”??” for wildcard.
  2. Hour (int or str): Either integer between 0-23 or ”??” for wildcard.
  3. Minute (int): Integer between 0-59.
reset(option)[source]

Resets the WittyPi according to options

Parameters:option – Options: startup, shutdown, script, all.
class wittyPy.WittyTime(*args, name=None)[source]

WittyTime object to validate and store times for the WittyPi.

Parameters:
  • name (str) – Type of time. Shutdown or Boot.
  • as_date (datetime) – WittyTime as datetime object.
  • day (int or str) –
  • hour (int or str) –
  • minute (int or str) –
  • second (int or str) –
t_left()[source]

Returns time in seconds between WittyTime and system time.