Code Monkey home page Code Monkey logo

csv2vcf's Introduction

csv2vcf

csv2vcf is a small command line tool to convert CSV files to VCard (.vcf) files.

Usage :

Go to terminal or command prompt and type:

python csv2vcf.py CSV_FILE_NAME [ -s | --single ] INPUT_FILE_FORMAT

Where :

  • CSV_FILE_NAME is the full name of the CSV file you want to convert
  • INPUT_FILE_FORMAT is a JSON formatted string which tells csv2vcf how to parse your input file
  • -s or --single: Use this argument if you want your output in a single file. Optional parameter. By default, the program will create separate Vcard files for each entry
JSON Format :

The JSON string can have the following keys:

name, given, surname, nickname, org, tel, url, bday, role, and email, where each property is in accordance with vCard property types

Format is {KEY_1:KEY_1_COLUMN_NO, KEY_2:KEY_2_COLUMN_NO, ...}

Example :

Suppose you have a CSV file contacts.csv with the following content :

+-----------+-------------+
|    NAME   |    MOBILE   |
+-----------+-------------+
|   Mrid    |  1111111111 |
|   Arnav   |  2222222222 |
|   Sunil   |  3333333333 |
|     .     |      .      |
|     .     |      .      |
|     .     |      .      |
+-----------+-------------+

To convert this file to vCard, you will have to write :

python csv2vcf.py contacts.csv '{"name":1, "tel":2}'

if you want separate vCards for each person, or

python csv2vcf.py -s contacts.csv '{"name":1, "tel":2}'

if you want to generate a single vCard file.

Another example, if you've downloaded your contacts from LinkedIn, use the following command to import then into your address book:

./csv2vcf.py Connections.csv '{"given":1, "surname":2, "email":3, "org":4, "role":5}'

Report bugs and suggestions:

If you want to report a bug or want to add a suggestion, just add it in the issues.

Copyright and license :

The license is available within the repository in the LICENSE file (it's MIT).

csv2vcf's People

Contributors

alexanderwillner avatar mridah avatar rotty avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.