This python module parses (and produces) vCard data as provided in vcf files.
Project description
jk_vcard
Introduction
This python module parses (and produces) vCard data as provided in vcf files.
Information about this module can be found here:
How to use this module
Import this module
Please include this module into your application using the following code:
import jk_vcard
Parse a .vcf file
If you export your contacts in your Android smart phone, a VCF file is created. This can serve as an example file and can be parsed using the following code:
with open("contacts.vcf", "r") as f:
data = f.read()
for vCard in VCFParser.parseText(data):
print("-" * 120)
print()
vCard.dump()
print()
print("-" * 120)
Produce a .vcf file from vCard data
If you want to produce a .vcf
file you simply can invoke VCFEncoder.toLines(...)
in order to generate text lines in this format:
vCard = ....
for textLine in VCFEncoder.toLines(vCard):
print(textLine)
If you have a list of VCard
objects you can simple (re)create a .vcf
file like this:
with open("contacts.vcf", "w") as f:
for vCard in myVCardList:
for textLine in VCFEncoder.toLines(vCard):
f.write(textLine + "\n")
Contact Information
This work is Open Source. This enables you to use this work for free.
Please have in mind this also enables you to contribute. We, the subspecies of software developers, can create great things. But the more collaborate, the more fantastic these things can become. Therefore Feel free to contact the author(s) listed below, either for giving feedback, providing comments, hints, indicate possible collaborations, ideas, improvements. Or maybe for "only" reporting some bugs:
- Jürgen Knauth: pubsrc@binary-overflow.de
License
This software is provided under the following license:
- Apache Software License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file jk_vcard-0.2020.9.21.1.tar.gz
.
File metadata
- Download URL: jk_vcard-0.2020.9.21.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec191362669ca5767d4bdc20718b567da13f8ff2f23d45d8f816d55f90e2877 |
|
MD5 | 04550cfe79ab61cffe6a60f5c23e16f3 |
|
BLAKE2b-256 | d01e9ef20886ceea4d2201d6fbb579dc402f82014bd20cdcfae0faf2c25ef31b |