pythonvCard4
A RFC 6350‑compliant vCard 4.0 parser and generator for Python.
Features
- Create vCard (.vcf) files from Python
Contactobjects - Parse existing vCard files back into
Contactinstances - Support for names, emails, multiple phone numbers, addresses, URLs, social profiles, photos, dates, and more
- Inline image embedding (resize + Base64 encode)
- Extension properties (
X-fields) viacustomandsocial_profiles - Full round‑trip fidelity, folding/unfolding, and escaping per spec
Installation
Install via PyPI:
pip install pythonvCard4
Quick Start
1. Create a vCard
from datetime import date
from pythonvCard4.vcard import Contact
# Build a Contact
c = Contact(
fn="Jane Doe",
n=["Doe","Jane","","",""] ,
email=[{"value": "jane@example.com", "type": ["work"]}],
tel=[
{"value": "+1234567890", "type": ["cell"]},
{"value": "+0987654321", "type": ["home"]}
],
url=["https://janedoe.dev"],
bday=date(1990, 5, 15),
)
# Add a Twitter profile
c.social_profiles.append({
"type": ["twitter"],
"value": "http://twitter.com/janedoe"
})
# Embed a photo (JPEG)
c.photo_path = "path/to/photo.jpg"
# Serialize to vCard text
vcf_text = c.to_vcard()
print(vcf_text)
2. Parse an existing vCard
from pythonvCard4.vcard import Contact
# Load from file
vcf_text = open('jane.vcf', 'r', encoding='utf-8').read()
contact = Contact.from_vcard(vcf_text)
print(contact.fn)
print(contact.tel)
print(contact.social_profiles)
Documentation & Support
See [GitHub](https://github.com/sharf-shawon/pythonvCard4 for full docs, examples, and issue tracking.
Metadata
Release files for pythonvCard4 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pythonvcard4-0.2.0.tar.gz | 5.5 kB | Without provenance | Details for pythonvcard4-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pythonvcard4-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pythonvcard4-0.2.0-py3-none-any.whl |
Total release size: 11.4 kB
Release files / pythonvcard4-0.2.0.tar.gz
| Download URL | pythonvcard4-0.2.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
236bba2769e459645cfa776407ff07856aced45b437116bf40ddb39bbcefdb6d
|
|
BLAKE2b-256 checksum How to use checksums |
340402d5952a9d8cbcb9e62b4fc4f6f842e8d43aead6e307f83e6fd6f7352fbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / pythonvcard4-0.2.0-py3-none-any.whl
| Download URL | pythonvcard4-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dce31355dd50aee537f8883de86f301510e407bc1755a68ec8d5055b64f5c660
|
|
BLAKE2b-256 checksum How to use checksums |
0d2fee10d88bbe12e4e9e06f81589d999687038e5cd5fec6c05aed57c50aede6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for pythonvCard4 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.