https://github.com/emersion/Go-vcard
A Go library to parse and format vCard
https://github.com/emersion/Go-vcard
contacts vcard
Last synced: 4 months ago
JSON representation
A Go library to parse and format vCard
- Host: GitHub
- URL: https://github.com/emersion/Go-vcard
- Owner: emersion
- License: mit
- Created: 2017-03-21T08:30:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T21:38:15.000Z (8 months ago)
- Last Synced: 2025-03-08T06:47:27.544Z (4 months ago)
- Topics: contacts, vcard
- Language: Go
- Size: 85 KB
- Stars: 113
- Watchers: 5
- Forks: 36
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-vcard
[](https://pkg.go.dev/github.com/emersion/go-vcard)
[](https://builds.sr.ht/~emersion/go-vcard/commits?)A Go library to parse and format [vCard](https://tools.ietf.org/html/rfc6350).
## Usage
```go
f, err := os.Open("cards.vcf")
if err != nil {
log.Fatal(err)
}
defer f.Close()dec := vcard.NewDecoder(f)
for {
card, err := dec.Decode()
if err == io.EOF {
break
} else if err != nil {
log.Fatal(err)
}log.Println(card.PreferredValue(vcard.FieldFormattedName))
}
```## License
MIT