relikd f3ecab5da7 Merge pull request #8 from elsiehupp/pypi-instructions
Update instructions to use PyPI (and tidy Markdown formatting)
2026-01-18 13:52:16 +01:00
2025-12-03 02:47:10 +01:00
2023-02-21 20:53:43 +01:00
2025-12-03 02:56:28 +01:00
2023-02-21 16:29:18 +01:00
2023-02-21 21:11:44 +01:00
2021-06-05 21:00:22 +02:00
2021-06-05 21:00:22 +02:00

abcddb2vcard

This python script reads an AddressBook database file (AddressBook-v22.abcddb) and export its content to a vCard file (.vcf).

I created this script to automate my contacts backup procedure. The output of this script should be exactly the same as dragging and dropping the "All Contacts" card.

Installation

To install abcddb2vcard from PyPi, use pip:

pip install abcddb2vcard

Or

pip3 install abcddb2vcard

abcddb2vcard can then be used from any working directory in the Terminal.

To uninstall:

pip uninstall abcddb2vcard

Or

pip3 uninstall abcddb2vcard

Usage

abcddb2vcard backup/contacts_$(date +"%Y-%m-%d").vcf

assuming db is located at "~/Library/Application Support/AddressBook/AddressBook-v22.abcddb"

Export into individual files

abcddb2vcard outdir -s 'path/%{fullname}.vcf'

Extract contact images

vcard2img AllContacts.vcf ./profile_pics/

Supported data fields

  • firstname
  • lastname
  • middlename
  • nameprefix
  • namesuffix
  • nickname
  • maidenname
  • phonetic_firstname
  • phonetic_middlename
  • phonetic_lastname
  • phonetic_organization
  • organization
  • department
  • jobtitle
  • birthday
  • [email]
  • [phone]
  • [address]
  • [socialprofile]
  • note
  • [url]
  • [xmpp-service]
  • image
  • iscompany

Limitations

The image field currently only supports JPG images. But as far as I see, Apple converts PNG to JPG before storing the image. If you encounter a db which includes other image types, please let me know.

Disclaimer

You should check the output for yourself before using it in a production environment. I have tested the script with many arbitrary fields, however there may be some edge cases missing. Feel free to create an issue for missing or wrong field values.

Note: The output of diff or FileMerge.app can be different to this output. Apple does some weird transformations on vcf export that are not only unnecessary but in many cases break the re-import of the file.

Description
Convert abcddb AddressBook format to vCard and export profile images from vCard
Readme MIT 119 KiB
Languages
Python 96.4%
Makefile 3.6%