woob.capabilities.contact
¶
- class ProfileNode(name, label, value, sufix=None, flags=0)[source]¶
Bases:
object
Node of a
Contact
profile.- HEAD = 1¶
- SECTION = 2¶
- class ContactPhoto(name, url=None)[source]¶
Bases:
BaseObject
Photo of a contact.
- class Contact(id, name, status, url=None)[source]¶
Bases:
BaseContact
A contact.
- Variables:
url – (
str
) urlname – (
str
) Name of contactphone – (
str
) Phone numberemail – (
str
) Contact emailwebsite – (
str
) Website URL of the contactstatus – (
int
) Status of contact (STATUS_* constants)status_msg – (
str
) Message of statussummary – (
str
) Description of contactphotos – (
dict
) List of photos (default: OrderedDict())profile – (
dict
) Contact profile (default: OrderedDict())
- STATUS_ONLINE = 1¶
- STATUS_AWAY = 2¶
- STATUS_OFFLINE = 4¶
- STATUS_ALL = 4095¶
- set_photo(name, **kwargs)[source]¶
Set photo of contact.
- Parameters:
name (str) – name of photo
kwargs – See
ContactPhoto
to know what other parameters you can use
- class Query(id, message, url=None)[source]¶
Bases:
BaseObject
Query to send to a contact.
- class CapContact[source]¶
Bases:
Capability
- iter_contacts(status=Contact.STATUS_ALL, ids=None)[source]¶
Iter contacts
- Parameters:
status (Contact.STATUS_*) – get only contacts with the specified status (default:
Contact.STATUS_ALL
)ids (list[str]) – if set, get the specified contacts (default:
None
)
- Return type:
iter[
Contact
]
- get_contact(id)[source]¶
Get a contact from his id.
The default implementation only calls iter_contacts() with the proper values, but it might be overloaded by backends.
- send_query(id)[source]¶
Send a query to a contact
- Parameters:
id (str) – the ID of contact
- Return type:
- Raises:
- class BaseContact(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
This is the blase class for a contact.
- class PhysicalEntity(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseContact
Contact which has a physical address.
- Variables:
- property country¶
- property postcode¶
- property city¶
- property address¶
- class Person(id='', url=NotLoaded, backend=None)[source]¶
Bases:
PhysicalEntity
- class Place(id='', url=NotLoaded, backend=None)[source]¶
Bases:
PhysicalEntity
- class OpeningHours(id='', url=NotLoaded, backend=None)[source]¶
Bases:
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.- property is_open_now¶
- class OpeningRule(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
Single rule defining a (recurrent) time interval when a place is open or closed.
- class CapDirectory[source]¶
Bases:
Capability
- search_contacts(query, sortby)[source]¶
Search contacts matching a query.
- Parameters:
query (
SearchQuery
) – search parameters- Return type:
iter[
PhysicalEntity
]