weboob.capabilities.contact

class weboob.capabilities.contact.ProfileNode(name, label, value, sufix=None, flags=0)

Bases: object

Node of a Contact profile.

HEAD = 1
SECTION = 2
class weboob.capabilities.contact.ContactPhoto(name, url=None)

Bases: weboob.capabilities.base.BaseObject

Photo of a contact.
Variables:
  • name – (unicode) Name of the photo
  • data – (str) Data of photo
  • thumbnail_url – (unicode) Direct URL to thumbnail
  • thumbnail_data – (str) Data of thumbnail
  • hidden – (bool) True if the photo is hidden on website
class weboob.capabilities.contact.Contact(id, name, status, url=None)

Bases: weboob.capabilities.contact.BaseContact

A contact.
Variables:
  • status – (int, long) Status of contact (STATUS_* constants)
  • status_msg – (unicode) Message of status
  • summary – (unicode) Description of contact
  • photos – (dict) List of photos (default: OrderedDict())
  • profile – (dict) Contact profile (default: OrderedDict())
STATUS_ALL = 4095
STATUS_AWAY = 2
STATUS_OFFLINE = 4
STATUS_ONLINE = 1
get_text()
set_photo(name, **kwargs)

Set photo of contact.

Parameters:
  • name (str) – name of photo
  • kwargs – See ContactPhoto to know what other parameters you can use
exception weboob.capabilities.contact.QueryError

Bases: weboob.capabilities.base.UserError

Raised when unable to send a query to a contact.

class weboob.capabilities.contact.Query(id, message, url=None)

Bases: weboob.capabilities.base.BaseObject

Query to send to a contact.
Variables:message – (unicode) Message received
class weboob.capabilities.contact.CapContact

Bases: weboob.capabilities.base.Capability

get_contact(id)

Get a contact from his id.

The default implementation only calls iter_contacts() with the proper values, but it might be overloaded by backends.

Parameters:id (str) – the ID requested
Return type:Contact or None if not found
get_notes(id)

Get personal notes about a contact

Parameters:id (str) – the ID of the contact
Return type:unicode
iter_contacts(status=4095, ids=None)

Iter contacts

Parameters:
  • status (Contact.STATUS_*) – get only contacts with the specified status
  • ids (list[str]) – if set, get the specified contacts
Return type:

iter[Contact]

save_notes(id, notes)

Set personal notes about a contact

Parameters:id (str) – the ID of the contact
Returns:the unicode object to save as notes
send_query(id)

Send a query to a contact

Parameters:id (str) – the ID of contact
Return type:Query
Raises:QueryError
class weboob.capabilities.contact.BaseContact(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

This is the blase class for a contact.
Variables:
  • name – (unicode) Name of contact
  • phone – (unicode) Phone number
  • email – (unicode) Contact email
  • website – (unicode) Website URL of the contact
class weboob.capabilities.contact.PhysicalEntity(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.contact.BaseContact

Contact which has a physical address.
Variables:
  • postal_address – (PostalAddress) Postal address
  • address_notes – (unicode) Extra address info
address
city
country
postcode
class weboob.capabilities.contact.Person(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.contact.PhysicalEntity

class weboob.capabilities.contact.Place(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.contact.PhysicalEntity

Variables:opening – (OpeningHours) Opening hours
class weboob.capabilities.contact.OpeningHours(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Definition of times when a place is open or closed.

Consists in a list of OpeningRule. Rules should be ordered by priority. If no rule matches the given date, it is considered closed by default.

Variables:rules – (list) Rules of opening/closing
is_open_at(query)
is_open_now
class weboob.capabilities.contact.OpeningRule(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Single rule defining a (recurrent) time interval when a place is open or closed.
Variables:
  • dates – (rrulebase) Dates on which this rule applies
  • times – (list) Times of the day this rule applies
  • is_open – (bool) Is it an opening rule or closing rule?
class weboob.capabilities.contact.RRuleField(doc, **kargs)

Bases: weboob.capabilities.base.Field

convert(v)

Convert value to the wanted one.

class weboob.capabilities.contact.CapDirectory

Bases: weboob.capabilities.base.Capability

search_contacts(query, sortby)

Search contacts matching a query.

Parameters:query (SearchQuery) – search parameters
Return type:iter[PhysicalEntity]