woob.capabilities.contact

class woob.capabilities.contact.BaseContact(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.base.BaseObject

This is the blase class for a contact.

Variables
  • name – (str) Name of contact

  • phone – (str) Phone number

  • email – (str) Contact email

  • website – (str) Website URL of the contact

class woob.capabilities.contact.CapContact

Bases: woob.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 woob.capabilities.contact.CapDirectory

Bases: woob.capabilities.base.Capability

search_contacts(query, sortby)

Search contacts matching a query.

Parameters

query (SearchQuery) – search parameters

Return type

iter[PhysicalEntity]

class woob.capabilities.contact.Contact(id, name, status, url=None)

Bases: woob.capabilities.contact.BaseContact

A contact.

Variables
  • status – (int, int) Status of contact (STATUS_* constants)

  • status_msg – (str) Message of status

  • summary – (str) 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

class woob.capabilities.contact.ContactPhoto(name, url=None)

Bases: woob.capabilities.base.BaseObject

Photo of a contact.

Variables
  • name – (str) Name of the photo

  • data – (bytes) Data of photo

  • thumbnail_url – (str) Direct URL to thumbnail

  • thumbnail_data – (bytes) Data of thumbnail

  • hidden – (bool) True if the photo is hidden on website

class woob.capabilities.contact.OpeningHours(id='', url=NotLoaded, backend=None)

Bases: woob.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)
property is_open_now
class woob.capabilities.contact.OpeningRule(id='', url=NotLoaded, backend=None)

Bases: woob.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 woob.capabilities.contact.Person(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.contact.PhysicalEntity

class woob.capabilities.contact.PhysicalEntity(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.contact.BaseContact

Contact which has a physical address.

Variables
  • postal_address – (PostalAddress) Postal address

  • address_notes – (str) Extra address info

property address
property city
property country
property postcode
class woob.capabilities.contact.Place(id='', url=NotLoaded, backend=None)

Bases: woob.capabilities.contact.PhysicalEntity

Variables

opening – (OpeningHours) Opening hours

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

Bases: object

Node of a Contact profile.

HEAD = 1
SECTION = 2
class woob.capabilities.contact.Query(id, message, url=None)

Bases: woob.capabilities.base.BaseObject

Query to send to a contact.

Variables

message – (str) Message received

exception woob.capabilities.contact.QueryError

Bases: woob.capabilities.base.UserError

Raised when unable to send a query to a contact.

class woob.capabilities.contact.RRuleField(doc, **kargs)

Bases: woob.capabilities.base.Field

convert(v)

Convert value to the wanted one.