|
|
Choosing A Webhost: |
Re: Importing contacts from delimited files: msg#00001cms.opengroupware.xmlrpc.devel
> Adam from the users@ mailing list recommended I hop on over here for a few > questions/help with XML-RPC scripts. > I was told its possible and actually VERY easy to import a number of contacts > from a delimited file using Python/XML-RPC scripts. I was wondering if > someone > could provide some help as to how this is actually done. Here is one simple example - #!/usr/bin/env python import sys, csv, xmlrpclib, pprint server = xmlrpclib.Server('http://{USER}:{PASSWORD}@{HOST}/RPC2') reader = csv.reader(open("{FILENAME}", "rb"), delimiter='|', quoting=csv.QUOTE_NONE) for row in reader: person = {} person['firstname'] = row[0] person['name'] = row[1] person['isPrivate'] = '1' person['extendedKeys'] = ['email1', 'title', 'other_title1'] person['extendedAttrs'] = {} person['extendedAttrs']['email1'] = row[5] person['extendedAttrs']['job_title'] = row[3] person['extendedAttrs']['other_title1'] = row[2] person['phones'] = {} person['phones']['01_tel'] = {} person['phones']['01_tel']['number'] = row[4] person = server.person.insert(person) person = server.person.getById(person) print person > Also, can someone recommend some information on 'PUT'ing contacts via > Zidestore using vCard files? You should be able to use any WebDAV client to PUT a vCard file to ZideStore; a URL like http://{HOST}/zidestore/dav/{USERNAME}/Contacts I mount ZideStore to the filesytsem with FUSE from my openSUSE workstation and one can navigate the tree with cd, ls, and friends. On Windows you should be able to do the same thing with WebDrive but I have never tried it. From WMOGAG: The command “wdfs %LOCALFOLDER% -a http://%HOSTNAME%/zidestore/so/% USERNAME%/ -u %USERNAME% -p %PASSWORD%” will mount the ZideStore folder tree to the specified local folder. In order for normal users to mount folders the “wdfs” binary must be set-uid.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Importing contacts from delimited files, Rick |
|---|---|
| Next by Date: | Re: Importing contacts from delimited files, Adam Tauno Williams |
| Previous by Thread: | Importing contacts from delimited files, Rick |
| Next by Thread: | Re: Importing contacts from delimited files, Adam Tauno Williams |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|