Skip to content

bolorundurowb/vCardLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

vCardLib: A vCard (.vcf) Processing Library πŸ“‡

NuGet Version Coverage Status NET Standard NET Standard License: MIT


About vCardLib πŸ“œ

vCardLib is a powerful and flexible .NET library designed to simplify working with vCard (.vcf) files. Whether you're reading, writing, or manipulating contact information, vCardLib provides an easy-to-use API to handle vCard versions 2.1, 3.0, and 4.0 seamlessly. 🌟

Perfect for applications dealing with contact management, address books, or any scenario where vCard files are used, vCardLib ensures your vCard processing is smooth and efficient. πŸš€


Features ✨

  • Read Multiple Contacts: Parse multiple contacts from a single .vcf file, stream, or string.
  • Easy Iteration: Returns contact data as an IEnumerable<vCard> for effortless looping.
  • Cross-Version Support: Works with vCard versions 2.1, 3.0, and 4.0.
  • Serialization and Deserialization: Easily convert between vCard objects and their string/file representations.

Installation πŸ“¦

You can install vCardLib via NuGet using one of the following methods:

Package Manager

Install-Package vCardLib.dll

.NET CLI

dotnet add package vCardLib.dll

Usage πŸ› οΈ

Deserialization (Reading vCards)

From a File

string filePath = // path to .vcf file;
IEnumerable<vCard> contacts = vCardDeserializer.FromFile(filePath);

From a Stream

var stream = // generate stream containing serialized vCards
IEnumerable<vCard> contacts = vCardDeserializer.FromStream(stream);

From a String

var contactDetails = @"BEGIN:VCARD
VERSION:2.1
N:John;Doe;;;
END:VCARD";
IEnumerable<vCard> contacts = vCardDeserializer.FromContent(contactDetails);

Serialization (Writing vCards)

Serialize as String

var vcard = new vCard(vCardVersion.V2)
{
    FormattedName = "John Doe"
};
var serialized = vCardSerializer.Serialize(vcard);

/*
Output:
BEGIN:VCARD
VERSION:2.1
REV:20230719T001838Z
FN:John Doe
END:VCARD
*/

Serialize with Version Override

var vcard = new vCard(vCardVersion.V2)
{
    FormattedName = "John Doe"
};
var serialized = vCardSerializer.Serialize(vcard, vCardVersion.V4);

/*
Output:
BEGIN:VCARD
VERSION:4.0
REV:20230719T001838Z
FN:John Doe
END:VCARD
*/

Branches 🌿

  • master: Contains the latest breaking changes and features. 🚧
    Note: This branch may contain unstable code and is not recommended for production use.

  • v4 Tag: The most recent stable release. βœ…


Contributors πŸ™Œ

A huge thank you to these amazing contributors who have helped make vCardLib better:

@bolorundurowb, @crowar,
@rmja, @JeanCollas


License πŸ“œ

vCardLib is licensed under the MIT License. See the LICENSE file for more details.


Get Started Today! πŸŽ‰

Whether you're building a contact management system, integrating vCard support into your app, or just need to process .vcf files, vCardLib is here to make your life easier. Install the package, follow the examples, and start working with vCards like a pro! ⏱️

Happy Coding! πŸš€

About

πŸ“‡ A .NET standard library for reading and writing vCard files

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 7

Languages