https://github.com/bolorundurowb/vcardlib
📇 A .NET standard library for reading and writing vCard files
https://github.com/bolorundurowb/vcardlib
c-sharp library vcard vcf
Last synced: 4 months ago
JSON representation
📇 A .NET standard library for reading and writing vCard files
- Host: GitHub
- URL: https://github.com/bolorundurowb/vcardlib
- Owner: bolorundurowb
- License: mit
- Created: 2016-04-03T12:44:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-02T19:41:18.000Z (10 months ago)
- Last Synced: 2025-05-30T04:59:09.214Z (6 months ago)
- Topics: c-sharp, library, vcard, vcf
- Language: C#
- Homepage: https://github.com/bolorundurowb/vCardLib/blob/master/README.md
- Size: 787 KB
- Stars: 29
- Watchers: 4
- Forks: 16
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# vCardLib: A vCard (.vcf) Processing Library 📇
 [](https://coveralls.io/github/bolorundurowb/vCardLib?branch=master)
[]() []() [](LICENSE)
---
## 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` 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**
```cmd
Install-Package vCardLib.dll
```
#### **.NET CLI**
```bash
dotnet add package vCardLib.dll
```
---
## Usage 🛠️
### Deserialization (Reading vCards)
#### **From a File**
```csharp
string filePath = // path to .vcf file;
IEnumerable contacts = vCardDeserializer.FromFile(filePath);
```
#### **From a Stream**
```csharp
var stream = // generate stream containing serialized vCards
IEnumerable contacts = vCardDeserializer.FromStream(stream);
```
#### **From a String**
```csharp
var contactDetails = @"BEGIN:VCARD
VERSION:2.1
N:John;Doe;;;
END:VCARD";
IEnumerable contacts = vCardDeserializer.FromContent(contactDetails);
```
---
### Serialization (Writing vCards)
#### **Serialize as String**
```csharp
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**
```csharp
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](https://github.com/bolorundurowb/vCardLib/tree/v4)**: The most recent stable release. ✅
---
## Contributors 🙌
A huge thank you to these amazing contributors who have helped make **vCardLib** better:
[@bolorundurowb](https://github.com/bolorundurowb), [@crowar](https://github.com/crowar),
[@rmja](https://github.com/rmja), [@JeanCollas](https://github.com/JeanCollas)
---
## License 📜
**vCardLib** is licensed under the MIT License. See the [LICENSE](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!** 🚀