From c66d2057b433b837fc638cfe8e2a5527ada0d723 Mon Sep 17 00:00:00 2001 From: Elsie Hupp Date: Sat, 17 Jan 2026 11:41:40 -0500 Subject: [PATCH] Update instructions to use PyPI (and tidy Markdown formatting) --- README.md | 87 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index ccab56e..05560ca 100644 --- a/README.md +++ b/README.md @@ -2,48 +2,89 @@ 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. +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 -### Usage +To install `abcddb2vcard` from [PyPi](https://pypi.org/project/abcddb2vcard/), use `pip`: ```sh -python3 abcddb2vcard.py backup/contacts_$(date +"%Y-%m-%d").vcf +pip install abcddb2vcard +``` + +Or + +```sh +pip3 install abcddb2vcard +``` + +`abcddb2vcard` can then be used from any working directory in the Terminal. + +To uninstall: + +```sh +pip uninstall abcddb2vcard +``` + +Or + +```sh +pip3 uninstall abcddb2vcard +``` + +## Usage + +```sh +abcddb2vcard backup/contacts_$(date +"%Y-%m-%d").vcf ``` > assuming db is located at "~/Library/Application Support/AddressBook/AddressBook-v22.abcddb" -#### Export into individual files +### Export into individual files ```sh -python3 abcddb2vcard.py outdir -s 'path/%{fullname}.vcf' +abcddb2vcard outdir -s 'path/%{fullname}.vcf' ``` -#### Extract contact images +### Extract contact images ```sh -python3 vcard2image.py AllContacts.vcf ./profile_pics/ +vcard2img AllContacts.vcf ./profile_pics/ ``` +## Supported data fields -### 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` -`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. -### Limitations +## Disclaimer -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. +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. - -### 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. -Apples does some weird transformations on vcf export that are not only unnecessary but in many cases break the re-import of the file. \ No newline at end of file +> **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.