Contacts Module Reference

New in version 0.0.2.

Control the macOS Contacts application using JXA-like syntax.

Classes:

XAContactsAddress(properties)

An address associated with a contact in Contacts.app.

XAContactsAddressList(properties[, filter])

A wrapper around lists of addresses that employs fast enumeration techniques.

XAContactsApplication(properties)

A class for managing and interacting with Contacts.app.

XAContactsContactInfo(properties)

Contact information associated with a contact in Contacts.app.

XAContactsContactInfoList(properties[, ...])

A wrapper around lists of contact information entries that employs fast enumeration techniques.

XAContactsCustomDate(properties)

A custom date associated with a contact in Contacts.app.

XAContactsCustomDateList(properties[, filter])

A wrapper around lists of contact custom dates that employs fast enumeration techniques.

XAContactsDocument(properties)

A document in Contacts.app.

XAContactsDocumentList(properties[, filter])

A wrapper around lists of documents that employs fast enumeration techniques.

XAContactsEmail(properties)

A document in Contacts.app.

XAContactsEmailList(properties[, filter])

A wrapper around lists of contact email addresses that employs fast enumeration techniques.

XAContactsEntry(properties)

An entry in Contacts.app.

XAContactsEntryList(properties[, filter, ...])

A wrapper around lists of contact entries that employs fast enumeration techniques.

XAContactsGroup(properties)

A group in Contacts.app.

XAContactsGroupList(properties[, filter])

A wrapper around lists of contact groups that employs fast enumeration techniques.

XAContactsInstantMessage(properties)

An instant message (IM) address associated with a contact in Contacts.app.

XAContactsInstantMessageList(properties[, ...])

A wrapper around lists of IM addresses that employs fast enumeration techniques.

XAContactsPerson(properties)

A person in Contacts.app.

XAContactsPersonList(properties[, filter])

A wrapper around lists of people that employs fast enumeration techniques.

XAContactsPhone(properties)

A phone number associated with a contact in Contacts.app.

XAContactsPhoneList(properties[, filter])

A wrapper around lists of contact phone numbers that employs fast enumeration techniques.

XAContactsRelatedName(properties)

A related name of a contact in Contacts.app.

XAContactsRelatedNameList(properties[, filter])

A wrapper around lists of contact related names that employs fast enumeration techniques.

XAContactsSocialProfile(properties)

A social profile associated with a contact in Contacts.app.

XAContactsSocialProfileList(properties[, filter])

A wrapper around lists of contact social profiles that employs fast enumeration techniques.

XAContactsURL(properties)

A URL associated with a contact in Contacts.app.

XAContactsURLList(properties[, filter])

A wrapper around lists of contact URLs that employs fast enumeration techniques.

XAContactsWindow(properties)

A window of Contacts.app.

class PyXA.apps.Contacts.XAContactsAddress(properties)[source]

Bases: XAObject

An address associated with a contact in Contacts.app.

New in version 0.0.7.

Attributes:

city

The city part of the address.

country

The country part of the address.

country_code

The country code part of the address.

formatted_address

The formatted string for the address.

id

The unique identifier for the address.

label

The label associated with the address.

state

The state, province, or region part of the address.

street

The street part of the address.

zip

The zip code or postal code part of the address.

property city: str

The city part of the address.

property country: str

The country part of the address.

property country_code: str

The country code part of the address.

property formatted_address: str

The formatted string for the address.

property id: str

The unique identifier for the address.

property label: str

The label associated with the address.

property state: str

The state, province, or region part of the address.

property street: str

The street part of the address.

property zip: str

The zip code or postal code part of the address.

class PyXA.apps.Contacts.XAContactsAddressList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of addresses that employs fast enumeration techniques.

All properties of addresses can be called as methods on the wrapped list, returning a list containing each address’ value for the property.

New in version 0.0.7.

Methods:

by_city(city)

by_country(country)

by_country_code(country_code)

by_formatted_address(formatted_address)

by_id(id)

by_label(label)

by_state(state)

by_street(street)

by_zip(zip)

city()

country()

country_code()

formatted_address()

id()

label()

state()

street()

zip()

by_city(city: str) XAContactsAddress | None[source]
by_country(country: str) XAContactsAddress | None[source]
by_country_code(country_code: str) XAContactsAddress | None[source]
by_formatted_address(formatted_address: str) XAContactsAddress | None[source]
by_id(id: str) XAContactsAddress | None[source]
by_label(label: str) XAContactsAddress | None[source]
by_state(state: str) XAContactsAddress | None[source]
by_street(street: str) XAContactsAddress | None[source]
by_zip(zip: str) XAContactsAddress | None[source]
city() list[str][source]
country() list[str][source]
country_code() list[str][source]
formatted_address() list[str][source]
id() list[str][source]
label() list[str][source]
state() list[str][source]
street() list[str][source]
zip() list[str][source]
class PyXA.apps.Contacts.XAContactsApplication(properties)[source]

Bases: XASBApplication, XACanOpenPath

A class for managing and interacting with Contacts.app.

New in version 0.0.2.

Classes:

Format(value)

Format options when saving documents.

ObjectType(value)

Object types that can be created using XAContactsApplication.make().

ServiceType(value)

Service types for social media accounts.

Attributes:

default_country_code

The default country code for addresses.

frontmost

Whether Contacts is the frontmost application.

my_card

The user's contact card.

name

The name of the application.

selection

The currently selected entries.

unsaved

Whether there are any unsaved changed.

version

The version of Contacts.app.

Methods:

documents([filter])

Returns a list of documents, as PyXA objects, matching the given filter.

groups([filter])

Returns a list of groups, as PyXA objects, matching the given filter.

make(specifier[, properties, data])

Creates a new element of the given specifier class without adding it to any list.

open(file_path)

Opens a document and prompts whether to import the contact(s) contained in the document.

people([filter])

Returns a list of people, as PyXA objects, matching the given filter.

save()

Saves all changes to the address book.

class Format(value)[source]

Bases: Enum

Format options when saving documents.

Attributes:

ARCHIVE

The native Address Book file format

ARCHIVE = 1633837685

The native Address Book file format

class ObjectType(value)[source]

Bases: Enum

Object types that can be created using XAContactsApplication.make().

Attributes:

DOCUMENT

GROUP

PERSON

URL

DOCUMENT = 'document'
GROUP = 'group'
PERSON = 'person'
URL = 'url'
class ServiceType(value)[source]

Bases: Enum

Service types for social media accounts.

Attributes:

AIM

FACEBOOK

GADU_GADU

GOOGLE_TALK

ICQ

JABBER

MSN

QQ

SKYPE

YAHOO

AIM = 1635399733
FACEBOOK = 1635399988
GADU_GADU = 1635399734
GOOGLE_TALK = 1635399735
ICQ = 1635399736
JABBER = 1635399737
MSN = 1635399984
QQ = 1635399985
SKYPE = 1635399986
YAHOO = 1635399987
property default_country_code: str

The default country code for addresses.

documents(filter: dict | None = None) XAContactsDocumentList[source]

Returns a list of documents, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned documents will have, or None

Returns:

The list of documents

Return type:

XAContactsDocumentList

New in version 0.0.7.

property frontmost: bool

Whether Contacts is the frontmost application.

groups(filter: dict | None = None) XAContactsGroupList[source]

Returns a list of groups, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned groups will have, or None

Returns:

The list of groups

Return type:

XAContactsGroupList

Example:

>>> import PyXA
>>> app = PyXA.Application("Contacts")
>>> print(app.groups())
<<class 'PyXA.apps.Contacts.XAContactsGroupList'>['Example Group 1', 'Example Group 2', ...]>

New in version 0.0.7.

make(specifier: str | ObjectType, properties: dict | None = None, data: Any | None = None)[source]

Creates a new element of the given specifier class without adding it to any list.

Use XABase.XAList.push() to push the element onto a list.

Parameters:
  • specifier (Union[str, XAContactsApplication.ObjectType]) – The classname of the object to create

  • properties (dict) – The properties to give the object

  • data (Any, optional) – The data to initialize the object with. Defaults to None

Returns:

A PyXA wrapped form of the object

Return type:

XABase.XAObject

Example 1:

Add a URL to a contact

>>> import PyXA
>>> app = PyXA.Application("Contacts")
>>> contact = app.people().by_name("Example Contact")
>>> new_url = app.make("url", {"label": "Google", "value": "www.google.com"})
>>> contact.urls().push(new_url)
>>> app.save()

New in version 0.0.7.

property my_card: XAContactsPerson

The user’s contact card.

property name: str

The name of the application.

open(file_path: str)[source]

Opens a document and prompts whether to import the contact(s) contained in the document.

Parameters:

file_path (str) – The path to the file to import

New in version 0.0.7.

people(filter: dict | None = None) XAContactsPersonList[source]

Returns a list of people, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned people will have, or None

Returns:

The list of people

Return type:

XAContactsPersonList

Example:

>>> import PyXA
>>> app = PyXA.Application("Contacts")
>>> print(app.people())
<<class 'PyXA.apps.Contacts.XAContactsPersonList'>['Example Contact 1', 'Example Contact 2', ...]>

New in version 0.0.7.

save()[source]

Saves all changes to the address book.

New in version 0.0.7.

property selection: XAContactsPersonList

The currently selected entries.

property unsaved: bool

Whether there are any unsaved changed.

property version: str

The version of Contacts.app.

class PyXA.apps.Contacts.XAContactsContactInfo(properties)[source]

Bases: XAObject

Contact information associated with a contact in Contacts.app.

New in version 0.0.7.

Attributes:

id

The persistent unique identifier for the information entry.

label

The label associated with the information entry.

value

The value of the information entry.

property id: str

The persistent unique identifier for the information entry.

property label: str

The label associated with the information entry.

property value: str | datetime | None

The value of the information entry.

class PyXA.apps.Contacts.XAContactsContactInfoList(properties: dict, filter: dict | None = None, obj_class=None)[source]

Bases: XAList

A wrapper around lists of contact information entries that employs fast enumeration techniques.

All properties of contact information entries can be called as methods on the wrapped list, returning a list containing each entry’s value for the property.

New in version 0.0.7.

Methods:

by_id(id)

by_label(label)

by_value(value)

id()

label()

value()

by_id(id: str) XAContactsContactInfo | None[source]
by_label(label: str) XAContactsContactInfo | None[source]
by_value(value: Any) XAContactsContactInfo | None[source]
id() list[str][source]
label() list[str][source]
value() list[Any][source]
class PyXA.apps.Contacts.XAContactsCustomDate(properties)[source]

Bases: XAContactsContactInfo

A custom date associated with a contact in Contacts.app.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsCustomDateList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsContactInfoList

A wrapper around lists of contact custom dates that employs fast enumeration techniques.

All properties of contact custom dates can be called as methods on the wrapped list, returning a list containing each custom date’s value for the property.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsDocument(properties)[source]

Bases: XAObject

A document in Contacts.app.

New in version 0.0.7.

Attributes:

file

The location of the document of the disk, if one exists.

modified

Whether the document has been modified since it was last saved.

name

The name of the document.

property file: XAURL

The location of the document of the disk, if one exists.

property modified: bool

Whether the document has been modified since it was last saved.

property name: str

The name of the document.

class PyXA.apps.Contacts.XAContactsDocumentList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of documents that employs fast enumeration techniques.

All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property.

New in version 0.0.7.

Methods:

by_file(file)

by_modified(modified)

by_name(name)

file()

modified()

name()

by_file(file: XAURL) XAContactsDocument | None[source]
by_modified(modified: bool) XAContactsDocument | None[source]
by_name(name: str) XAContactsDocument | None[source]
file() list[XAURL][source]
modified() list[bool][source]
name() list[str][source]
class PyXA.apps.Contacts.XAContactsEmail(properties)[source]

Bases: XAContactsContactInfo

A document in Contacts.app.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsEmailList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsContactInfoList

A wrapper around lists of contact email addresses that employs fast enumeration techniques.

All properties of contact email addresses can be called as methods on the wrapped list, returning a list containing each email address’s value for the property.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsEntry(properties)[source]

Bases: XAObject

An entry in Contacts.app.

New in version 0.0.7.

Methods:

add_to(parent)

Adds a child object to an entry.

delete()

Deletes the entry.

remove_from(elem)

Removes a child object from an entry.

Attributes:

creation_date

The creation date of the contact entry.

id

The unique persistent identifier for the entry.

modification_date

The last modification date of the contact entry.

selected

Whether the entry is selected.

add_to(parent: XAObject) XAContactsPerson[source]

Adds a child object to an entry.

Parameters:

parent (XABase.XAObject) – The entry to add this entry as a child to

Example 1:

Add a contact to a group

>>> import PyXA
>>> app = PyXA.Application("Contacts")
>>> group = app.groups().by_name("Example Group")
>>> app.people()[0].add_to(group)
>>> app.save()

New in version 0.0.7.

property creation_date: datetime

The creation date of the contact entry.

delete()[source]

Deletes the entry. Only entries creates in the current session can be deleted.

New in version 0.0.7.

property id: str

The unique persistent identifier for the entry.

property modification_date: datetime

The last modification date of the contact entry.

remove_from(elem) XAContactsPerson[source]

Removes a child object from an entry.

Parameters:

parent (XABase.XAObject) – The entry to removes this entry as a child from

Example 1:

Remove a contact from a group

>>> import PyXA
>>> app = PyXA.Application("Contacts")
>>> group = app.groups().by_name("Example Group")
>>> app.people()[0].add_to(group)
>>> app.people()[0].remove_from(group)
>>> app.save()

New in version 0.0.7.

property selected: bool

Whether the entry is selected.

class PyXA.apps.Contacts.XAContactsEntryList(properties: dict, filter: dict | None = None, obj_class=None)[source]

Bases: XAList

A wrapper around lists of contact entries that employs fast enumeration techniques.

All properties of contact entries can be called as methods on the wrapped list, returning a list containing each entry’s value for the property.

New in version 0.0.7.

Methods:

by_creation_date(creation_date)

by_id(id)

by_modification_date(modification_date)

by_selected(selected)

creation_date()

id()

modification_date()

selected()

by_creation_date(creation_date: datetime) XAContactsEntry | None[source]
by_id(id: str) XAContactsEntry | None[source]
by_modification_date(modification_date: datetime) XAContactsEntry | None[source]
by_selected(selected: bool) XAContactsEntry | None[source]
creation_date() list[datetime][source]
id() list[str][source]
modification_date() list[datetime][source]
selected() list[bool][source]
class PyXA.apps.Contacts.XAContactsGroup(properties)[source]

Bases: XAContactsEntry

A group in Contacts.app.

New in version 0.0.7.

Methods:

groups([filter])

Returns a list of groups, as PyXA objects, matching the given filter.

people([filter])

Returns a list of people, as PyXA objects, matching the given filter.

Attributes:

name

The name of the group.

groups(filter: dict | None = None) XAContactsGroupList[source]

Returns a list of groups, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned groups will have, or None

Returns:

The list of groups

Return type:

XAContactsGroupList

New in version 0.0.7.

property name: str

The name of the group.

people(filter: dict | None = None) XAContactsPersonList[source]

Returns a list of people, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned people will have, or None

Returns:

The list of people

Return type:

XAContactsPersonList

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsGroupList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsEntryList

A wrapper around lists of contact groups that employs fast enumeration techniques.

All properties of contact groups can be called as methods on the wrapped list, returning a list containing each group’s value for the property.

New in version 0.0.7.

Methods:

by_name(name)

name()

by_name(name: str) XAContactsGroup | None[source]
name() list[str][source]
class PyXA.apps.Contacts.XAContactsInstantMessage(properties)[source]

Bases: XAContactsContactInfo

An instant message (IM) address associated with a contact in Contacts.app.

New in version 0.0.7.

Attributes:

service_name

The service name of the IM address.

service_type

The service type of the IM address.

user_name

The user name of the the IM address.

property service_name: str

The service name of the IM address.

property service_type: ServiceType

The service type of the IM address.

property user_name: str

The user name of the the IM address.

class PyXA.apps.Contacts.XAContactsInstantMessageList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsContactInfoList

A wrapper around lists of IM addresses that employs fast enumeration techniques.

All properties of IM addresses can be called as methods on the wrapped list, returning a list containing each IM address’s value for the property.

New in version 0.0.7.

Methods:

by_service_name(service_name)

by_service_type(service_type)

by_user_name(user_name)

service_name()

service_type()

user_name()

by_service_name(service_name: str) XAContactsInstantMessage | None[source]
by_service_type(service_type: ServiceType) XAContactsInstantMessage | None[source]
by_user_name(user_name: str) XAContactsInstantMessage | None[source]
service_name() list[str][source]
service_type() list[ServiceType][source]
user_name() list[str][source]
class PyXA.apps.Contacts.XAContactsPerson(properties)[source]

Bases: XAContactsEntry

A person in Contacts.app.

New in version 0.0.7.

Methods:

addresses([filter])

Returns a list of addresses, as PyXA objects, matching the given filter.

custom_dates([filter])

Returns a list of groups, as PyXA objects, matching the given filter.

emails([filter])

Returns a list of email addresses, as PyXA objects, matching the given filter.

groups([filter])

Returns a list of groups, as PyXA objects, matching the given filter.

instant_messages([filter])

Returns a list of IM addresses, as PyXA objects, matching the given filter.

phones([filter])

Returns a list of phone numbers, as PyXA objects, matching the given filter.

related_names([filter])

Returns a list of related names, as PyXA objects, matching the given filter.

show()

Shows the contact card for this contact in Contacts.app.

social_profiles([filter])

Returns a list of social profiles, as PyXA objects, matching the given filter.

urls([filter])

Returns a list of URLs, as PyXA objects, matching the given filter.

Attributes:

birth_date

The birthdate of the person.

company

Whether the record is for a company or not (if not, the record is for a person).

department

The department that the person works for.

first_name

The first name of the person.

home_page

The homepage of the person.

image

The image for the person.

job_title

The job title of the person.

last_name

The last name of the person.

maiden_name

The maiden name of the person.

middle_name

The middle name of the person.

name

The first and last name of the person.

nickname

The nickname of the person.

note

The notes for the person.

organization

The organization that employs the person.

phonetic_first_name

The phonetic version of the person's first name.

phonetic_last_name

The phonetic version of the person's last name.

phonetic_middle_name

The phonetic version of the person's middle name.

suffix

The suffix of the person's name.

title

The title of the person.

vcard

The person's information in vCard format.

addresses(filter: dict | None = None) XAContactsAddressList[source]

Returns a list of addresses, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned addresses will have, or None

Returns:

The list of addresses

Return type:

XAContactsAddressList

New in version 0.0.7.

property birth_date: datetime

The birthdate of the person.

property company: bool

Whether the record is for a company or not (if not, the record is for a person).

custom_dates(filter: dict | None = None) XAContactsCustomDateList[source]

Returns a list of groups, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned groups will have, or None

Returns:

The list of groups

Return type:

XAContactsCustomDateList

New in version 0.0.7.

property department: str

The department that the person works for.

emails(filter: dict | None = None) XAContactsEmailList[source]

Returns a list of email addresses, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned email addresses will have, or None

Returns:

The list of email addresses

Return type:

XAContactsEmailList

New in version 0.0.7.

property first_name: str

The first name of the person.

groups(filter: dict | None = None) XAContactsGroupList[source]

Returns a list of groups, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned groups will have, or None

Returns:

The list of groups

Return type:

XAContactsGroupList

New in version 0.0.7.

property home_page: str

The homepage of the person.

property image: XAImage

The image for the person.

instant_messages(filter: dict | None = None) XAContactsInstantMessageList[source]

Returns a list of IM addresses, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned IM addresses will have, or None

Returns:

The list of IM addresses

Return type:

XAContactsInstantMessageList

New in version 0.0.7.

property job_title: str

The job title of the person.

property last_name: str

The last name of the person.

property maiden_name: str

The maiden name of the person.

property middle_name: str

The middle name of the person.

property name: str

The first and last name of the person.

property nickname: str

The nickname of the person.

property note: str

The notes for the person.

property organization: str

The organization that employs the person.

phones(filter: dict | None = None) XAContactsPhoneList[source]

Returns a list of phone numbers, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned phone numbers will have, or None

Returns:

The list of phone numbers

Return type:

XAContactsPhoneList

New in version 0.0.7.

property phonetic_first_name: str

The phonetic version of the person’s first name.

property phonetic_last_name: str

The phonetic version of the person’s last name.

property phonetic_middle_name: str

The phonetic version of the person’s middle name.

related_names(filter: dict | None = None) XAContactsRelatedNameList[source]

Returns a list of related names, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned related names will have, or None

Returns:

The list of related names

Return type:

XAContactsRelatedNameList

New in version 0.0.7.

show() XAContactsPerson[source]

Shows the contact card for this contact in Contacts.app.

Returns:

The contact person object

Return type:

XAContactsPerson

New in version 0.0.7.

social_profiles(filter: dict | None = None) XAContactsSocialProfileList[source]

Returns a list of social profiles, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned social profiles will have, or None

Returns:

The list of social profiles

Return type:

XAContactsSocialProfileList

New in version 0.0.7.

property suffix: str

The suffix of the person’s name.

property title: str

The title of the person.

urls(filter: dict | None = None) XAContactsURLList[source]

Returns a list of URLs, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned URLs will have, or None

Returns:

The list of URLs

Return type:

XAContactsURLList

New in version 0.0.7.

property vcard: str

The person’s information in vCard format.

class PyXA.apps.Contacts.XAContactsPersonList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsEntryList

A wrapper around lists of people that employs fast enumeration techniques.

All properties of people can be called as methods on the wrapped list, returning a list containing each IM person’s value for the property.

New in version 0.0.7.

Methods:

birth_date()

by_birth_date(birth_date)

by_company(company)

by_department(department)

by_first_name(first_name)

by_home_page(home_page)

by_image(image)

by_job_title(job_title)

by_last_name(last_name)

by_maiden_name(maiden_name)

by_middle_name(middle_name)

by_name(name)

by_nickname(nickname)

by_note(note)

by_organization(organization)

by_phonetic_first_name(phonetic_first_name)

by_phonetic_last_name(phonetic_last_name)

by_phonetic_middle_name(phonetic_middle_name)

by_suffix(suffix)

by_title(title)

by_vcard(vcard)

company()

department()

first_name()

home_page()

image()

job_title()

last_name()

maiden_name()

middle_name()

name()

nickname()

note()

organization()

phonetic_first_name()

phonetic_last_name()

phonetic_middle_name()

suffix()

title()

vcard()

birth_date() list[datetime][source]
by_birth_date(birth_date: datetime) XAContactsPerson | None[source]
by_company(company: bool) XAContactsPerson | None[source]
by_department(department: str) XAContactsPerson | None[source]
by_first_name(first_name: str) XAContactsPerson | None[source]
by_home_page(home_page: str) XAContactsPerson | None[source]
by_image(image: XAImage) XAContactsPerson | None[source]
by_job_title(job_title: str) XAContactsPerson | None[source]
by_last_name(last_name: str) XAContactsPerson | None[source]
by_maiden_name(maiden_name: str) XAContactsPerson | None[source]
by_middle_name(middle_name: str) XAContactsPerson | None[source]
by_name(name: str) XAContactsPerson | None[source]
by_nickname(nickname: str) XAContactsPerson | None[source]
by_note(note: str) XAContactsPerson | None[source]
by_organization(organization: str) XAContactsPerson | None[source]
by_phonetic_first_name(phonetic_first_name: str) XAContactsPerson | None[source]
by_phonetic_last_name(phonetic_last_name: str) XAContactsPerson | None[source]
by_phonetic_middle_name(phonetic_middle_name: str) XAContactsPerson | None[source]
by_suffix(suffix: str) XAContactsPerson | None[source]
by_title(title: str) XAContactsPerson | None[source]
by_vcard(vcard: str) XAContactsPerson | None[source]
company() list[bool][source]
department() list[str][source]
first_name() list[str][source]
home_page() list[str][source]
image() list[XAImage][source]
job_title() list[str][source]
last_name() list[str][source]
maiden_name() list[str][source]
middle_name() list[str][source]
name() list[str][source]
nickname() list[str][source]
note() list[str][source]
organization() list[str][source]
phonetic_first_name() list[str][source]
phonetic_last_name() list[str][source]
phonetic_middle_name() list[str][source]
suffix() list[str][source]
title() list[str][source]
vcard() list[str][source]
class PyXA.apps.Contacts.XAContactsPhone(properties)[source]

Bases: XAContactsContactInfo

A phone number associated with a contact in Contacts.app.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsPhoneList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsContactInfoList

A wrapper around lists of contact phone numbers that employs fast enumeration techniques.

All properties of contact phone numbers can be called as methods on the wrapped list, returning a list containing each phone numbers’s value for the property.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsRelatedName(properties)[source]

Bases: XAContactsContactInfo

A related name of a contact in Contacts.app.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsRelatedNameList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsContactInfoList

A wrapper around lists of contact related names that employs fast enumeration techniques.

All properties of contact related names can be called as methods on the wrapped list, returning a list containing each related names’s value for the property.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsSocialProfile(properties)[source]

Bases: XASBWindow

A social profile associated with a contact in Contacts.app.

New in version 0.0.7.

Attributes:

id

A persistent unique identifier for this profile.

service_name

The service name of this social profile.

url

The URL of the social profile.

user_identifier

A service-specific identifier used with this social profile.

user_name

The user name used with this social profile.

property id: str

A persistent unique identifier for this profile.

property service_name: str

The service name of this social profile.

property url: str

The URL of the social profile.

property user_identifier: str

A service-specific identifier used with this social profile.

property user_name: str

The user name used with this social profile.

class PyXA.apps.Contacts.XAContactsSocialProfileList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of contact social profiles that employs fast enumeration techniques.

All properties of contact social profiles can be called as methods on the wrapped list, returning a list containing each social profile’s value for the property.

New in version 0.0.7.

Methods:

by_id(id)

by_service_name(service_name)

by_url(url)

by_user_identifier(user_identifier)

by_user_name(user_name)

id()

service_name()

url()

user_identifier()

user_name()

by_id(id: str) XAContactsSocialProfile | None[source]
by_service_name(service_name: str) XAContactsSocialProfile | None[source]
by_url(url: str) XAContactsSocialProfile | None[source]
by_user_identifier(user_identifier: str) XAContactsSocialProfile | None[source]
by_user_name(user_name: str) XAContactsSocialProfile | None[source]
id() list[str][source]
service_name() list[str][source]
url() list[str][source]
user_identifier() list[str][source]
user_name() list[str][source]
class PyXA.apps.Contacts.XAContactsURL(properties)[source]

Bases: XAContactsContactInfo

A URL associated with a contact in Contacts.app.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsURLList(properties: dict, filter: dict | None = None)[source]

Bases: XAContactsContactInfoList

A wrapper around lists of contact URLs that employs fast enumeration techniques.

All properties of contact URLs can be called as methods on the wrapped list, returning a list containing each URL’s value for the property.

New in version 0.0.7.

class PyXA.apps.Contacts.XAContactsWindow(properties)[source]

Bases: XASBWindow

A window of Contacts.app.

New in version 0.0.7.

Attributes:

document

The documents currently displayed in the window.

property document: XAContactsDocument

The documents currently displayed in the window.