📇 vcard-rs

vCard parser, validator, editor and builder library for Rust
Table of contents
Features
- All vCard versions: parse and write 2.1, 3.0 and 4.0 through a single, version-agnostic model.
- Byte-faithful editing: change one parameter or value and every other byte of the card, line endings included, is preserved exactly.
- Forgiving parser: accept any real card, even a malformed one, and round-trip it unchanged.
- Strict building and validation: construct cards checked against the standard, with an escape hatch when you need to step outside it.
- Small and portable: no_std compatible, with an allocation-only core that pulls in no dependencies.
- Optional content decoding: quoted-printable text, inline base64 binary and foreign character sets, each behind its own feature.
- Optional jCard: read and write a card as JSON.
- Optional JSContact: convert a card to and from the Card object exchanged over JMAP.
[!TIP] vcard-rs uses cargo features to gate optional support. The default feature set is declared in Cargo.toml or on docs.rs.
RFC coverage
| Spec | What is covered |
|---|---|
| 2.1 | vCard 2.1: the original versit format, including its quoted-printable and charset conventions |
| 2425 | text/directory: bare directory records carrying no BEGIN and END envelope |
| 2426 | vCard 3.0 |
| 6350 | vCard 4.0: the current standard, with its full property set, value types and parameters |
| 7095 | jCard: the JSON representation of a card |
| 9553 | JSContact: the Card object model exchanged over JMAP |
| 9554 | vCard format extensions: the newer properties and the extended address components, modeled first-class |
| 9555 | JSContact vCard mapping: the lossless conversion between a card and a JSContact Card |
Usage
See documentation at docs.rs.
Examples
See complete examples at ./examples.
License
This project is licensed under either of:
Social
- Chat on Matrix
- News on Mastodon or RSS
- Mail at pimalaya.org@posteo.net
Sponsoring
Special thanks to the NLnet foundation and the European Commission that have been financially supporting the project for years:
- 2022 → 2023: NGI Assure
- 2023 → 2024: NGI Zero Entrust
- 2024 → 2026: NGI Zero Core
- 2026 → 2027: NGI Zero Commons Fund
This program is part of Pimalaya, free software funded entirely by grants and donations. If you find it useful, consider sponsoring its development:
