Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sidedwards/contacts-exporter
Export contacts from the macOS Contacts app in vCard format to Markdown files with structured data.
https://github.com/sidedwards/contacts-exporter
contacts-manager markdown obsidian obsidian-md vcard vcard-parser
Last synced: about 1 month ago
JSON representation
Export contacts from the macOS Contacts app in vCard format to Markdown files with structured data.
- Host: GitHub
- URL: https://github.com/sidedwards/contacts-exporter
- Owner: sidedwards
- License: mit
- Created: 2023-04-10T23:38:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-08T20:00:00.000Z (6 months ago)
- Last Synced: 2024-07-09T00:50:26.761Z (6 months ago)
- Topics: contacts-manager, markdown, obsidian, obsidian-md, vcard, vcard-parser
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Contacts Exporter
This is a Python script to export contacts from the macOS Contacts app in vCard format to Markdown files with structured data. The script is compatible with Python 3.
## Installation
Clone this repository or download the script file `main.py`.
This script requires the `vobject` and `dateutil` Python packages. To install them, run:
```
pip3 install vobject python-dateutil
```## Usage
1. Open the Contacts app on your macOS.
2. Create or select a contact group that you want to export.
3. Open a terminal window and navigate to the directory where you saved `main.py`.
4. Run the script with `python3 main.py`.By default, the script exports the contacts from a default "Obsidian" group and saves the Markdown files in the "📇 Contacts" folder. You can customize these settings by setting the `CONTACT_GROUP` and `OUTPUT_FOLDER` environment variables, respectively.
## Output
The script exports each contact as a Markdown file with the following structure:
```md
## 👤 Name
- 📧 Email: [[email protected]](mailto:[email protected])
- ☎️ Phone: [+1 (555) 123-4567](tel:+15551234567)
- 🎂 Birthday: [[20000101]]
- 💍 Anniversary: [[20100101]]
- 🏢 Organization: Example Inc.
- 📝 Note: Some notes about the contact.
- 🌐 Website: [example.com](http://example.com)
- 📍 Location: 37.7749° N, 122.4194° W
- 💼 Role: Some role
- 📛 Title: Some title
- ♀️ Gender: F
- 🗣️ Language: English
- 🏠 Address: 123 Main St, Suite 100, San Francisco
```The script supports the following vCard fields:
- `fn`
- `email`
- `tel`
- `bday`
- `x_anniversary`
- `org`
- `note`
- `url`
- `geo`
- `role`
- `title`
- `x_gender`
- `lang`
- `adr`## Notes
If a vCard field is not present in a contact, the corresponding section will not be included in the Markdown file.
The script replaces any illegal characters (`\`, `/`, `*`, `?`, `:`, `"`, `<`, `>`, `|`) in the contact name with underscores (`_`) to avoid issues with file naming.