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.
- Variables
url – (
str
) urlname – (
str
) Name of the photodata – (
bytes
) Data of photothumbnail_url – (
str
) Direct URL to thumbnailthumbnail_data – (
bytes
) Data of thumbnailhidden – (
bool
) True if the photo is hidden on website
- 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.
- Variables
url – (
str
) urlmessage – (
str
) Message received
- class CapContact[source]¶
Bases:
Capability
- iter_contacts(status=4095, ids=None)[source]¶
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
]
- 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.
- Parameters
id (str) – the ID requested
- Return type
Contact
or None if not found
- 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.
- Variables
url – (
str
) urlname – (
str
) Name of contactphone – (
str
) Phone numberemail – (
str
) Contact emailwebsite – (
str
) Website URL of the contact
- class PhysicalEntity(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseContact
Contact which has a physical address.
- Variables
url – (
str
) urlname – (
str
) Name of contactphone – (
str
) Phone numberemail – (
str
) Contact emailwebsite – (
str
) Website URL of the contactpostal_address – (
PostalAddress
) Postal addressaddress_notes – (
str
) Extra address info
- property country¶
- property postcode¶
- property city¶
- property address¶
- class Person(id='', url=NotLoaded, backend=None)[source]¶
Bases:
PhysicalEntity
- Variables
url – (
str
) urlname – (
str
) Name of contactphone – (
str
) Phone numberemail – (
str
) Contact emailwebsite – (
str
) Website URL of the contactpostal_address – (
PostalAddress
) Postal addressaddress_notes – (
str
) Extra address info
- class Place(id='', url=NotLoaded, backend=None)[source]¶
Bases:
PhysicalEntity
- Variables
url – (
str
) urlname – (
str
) Name of contactphone – (
str
) Phone numberemail – (
str
) Contact emailwebsite – (
str
) Website URL of the contactpostal_address – (
PostalAddress
) Postal addressaddress_notes – (
str
) Extra address infoopening – (
OpeningHours
) Opening hours
- 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.- Variables
url – (
str
) urlrules – (
list
) Rules of opening/closing
- 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.
- Variables
url – (
str
) urldates – (
rrulebase
) Dates on which this rule appliestimes – (
list
) Times of the day this rule appliesis_open – (
bool
) Is it an opening rule or closing rule?
- class CapDirectory[source]¶
Bases:
Capability
- search_contacts(query, sortby)[source]¶
Search contacts matching a query.
- Parameters
query (
SearchQuery
) – search parameters- Return type
iter[
PhysicalEntity
]