yowsup_celery package

Submodules

yowsup_celery.celery module

class yowsup_celery.celery.YowCelery(*args, **kwargs)[source]

Bases: celery.app.base.Celery

yowsup_celery.exceptions module

exception yowsup_celery.exceptions.AuthenticationError[source]

Bases: yowsup_celery.exceptions.YowsupCeleryError

Raised when YowsupStack cannot authenticate with the whatsapp. This means the password for number is incorrect. Check if registration was correct

exception yowsup_celery.exceptions.ConfigurationError[source]

Bases: yowsup_celery.exceptions.YowsupCeleryError

Raised when YowsupStack detects and error in configurations

exception yowsup_celery.exceptions.ConnectionError[source]

Bases: yowsup_celery.exceptions.YowsupCeleryError

Raised when CeleryLayer tries to perform an action which requires to be connected to WhatsApp

exception yowsup_celery.exceptions.UnexpectedError[source]

Bases: yowsup_celery.exceptions.YowsupCeleryError

Raised for unknown or unexpected errors.

exception yowsup_celery.exceptions.YowsupCeleryError[source]

Bases: exceptions.Exception

yowsup_celery.layer module

class yowsup_celery.layer.CeleryLayer[source]

Bases: yowsup.layers.interface.interface.YowInterfaceLayer

Layer to be on the top of the Yowsup Stack. :ivar bool connected: connected or not connected to whatsapp :ivar YowLayerInterface interface: layer interface

connect()[source]
disconnect(*args, **kwargs)[source]
do_send_audio(file_path, url, to, ip=None, caption=None)[source]
do_send_image(file_path, url, to, ip=None, caption=None)[source]
normalize_jid(number)[source]
on_ack(*args, **kwargs)[source]

Callback function when receiving an ack for a sent message from whatsapp

on_disconnected(*args, **kwargs)[source]

Callback function when receiving a disconnection event

on_failure(entity)[source]

Callback function when there is a failure in a connection to whatsapp server

on_message(*args, **kwargs)[source]

Callback function when receiving message from whatsapp server

on_receipt(*args, **kwargs)[source]

Callback function when receiving receipt message from whatsapp

on_request_upload_result(jid, path, result_request_upload_iq_protocol_entity, request_upload_iq_protocol_entity, caption=None)[source]
on_success(success_protocol_entity)[source]

Callback when there is a successful connection to whatsapp server

on_upload_error(file_path, jid, url)[source]
on_upload_progress(file_path, jid, url, progress)[source]
send_audio(*args, **kwargs)[source]

Send audio message :param str number: phone number with cc (country code) :param str path: audio file path

send_image(*args, **kwargs)[source]

Send image message :param str number: phone number with cc (country code) :param str path: image file path

send_location(*args, **kwargs)[source]

Send location message :param str number: phone number with cc (country code) :param str name: indentifier for the location :param str url: location url :param str longitude: location longitude :param str latitude: location latitude

send_message(*args, **kwargs)[source]

Send message :param str number: phone number with cc (country code) :param str content: body text of the message

send_vcard(*args, **kwargs)[source]

Send location message :param str number: phone number with cc (country code) :param str name: indentifier for the location :param str data: vcard format i.e. BEGIN:VCARD VERSION:3.0 N:;Home;;; FN:Home item1.TEL:+34 911234567 item1.X-ABLabel:Home END:VCARD

yowsup_celery.layer.connection_required(f)[source]

yowsup_celery.layer_interface module

class yowsup_celery.layer_interface.CeleryLayerInterface(layer)[source]

Bases: yowsup.layers.YowLayerInterface

connect()[source]
connected()[source]
disconnect()[source]
send_audio(number, path)[source]
send_image(number, path)[source]
send_location(number, name, url, latitude, longitude)[source]
send_message(number, content)[source]
send_vcard(number, name, data)[source]

yowsup_celery.stack module

class yowsup_celery.stack.YowsupStack(credentials, encryption=False, top_layers=None)[source]

Bases: yowsup.stacks.yowstack.YowStack

Gateway for Yowsup in a client API way

Variables:
  • listening (bool) – asyncore loop task in execution
  • detached_queue (Queue) – Queue with callbacks to execute after

:ivar YowLayerInterface facade:layer interface on top of stack disconnection

asynloop(auto_connect=False, timeout=10, detached_delay=0.2)[source]
Non-blocking event loop consuming messages until connection is lost,
or shutdown is requested.
Parameters:
  • timeout (int) – number of secs for asyncore timeout
  • detached_delay (float) – float secs to sleep when exiting asyncore loop and execution detached queue callbacks
cleanup()[source]
execDetached(fn)[source]

yowsup_celery.steps module

class yowsup_celery.steps.YowsupStep(worker, login, config, unmoxie, **kwargs)[source]

Bases: celery.bootsteps.StartStopStep

name = u'yowsup_celery.steps.YowsupStep'
stop(worker)[source]

yowsup_celery.tasks module

class yowsup_celery.tasks.YowsupTask[source]

Bases: celery.app.task.Task

abstract = True
default_retry_delay = 0.5
facade
stack
yowsup_celery.tasks.listening_required(f)[source]

yowsup_celery.utils module

yowsup_celery.utils.import_string(dotted_path)[source]

Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import failed.

Module contents