Export a MySQL database with contacts to a compatible CardDav system
<p>I have a standard MySQL database, with a table containing contacts (I'm adding contacts to the table using a webapp using Zend Framework), thus with my own fields.</p>

<p>Is it possible to create a server which would be compatible to be used with the Address Book system of OsX? I think I must be compatible with the CardDav system.</p>

<p>Has anyone already done that? If yes, how did you handle it? Created your own server? Is there a CardDav library for Python for example? I just want to be able to read my contacts using the Address Book of OsX.</p>

<p>Thanks a lot for your answers,</p>

<p>Best,</p>

<p>Jean</p>

<blockquote>
  <p>Is it possible to create a server which would be compatible to be used
  with the Address Book system of OsX? I think I must be compatible with
  the CardDav system.</p>
</blockquote>

<p>Yes you can create such a server and there are plenty already. You can choose between either CardDAV or LDAP, depending on your needs. When LDAP is good enough for your use case, you might get even get away with just configuring OpenLDAP to use your database.</p>

<p>LDAP is usually just read &amp; query only (think big company address book / yellow pages). CardDAV is usually read/write and full sync.</p>

<blockquote>
  <p>Has anyone already done that?</p>
</blockquote>

<p>Many people have, the <a href="http://carddav.calconnect.org/implementations/servers.html" rel="nofollow">CalConnect CardDAV Server Implementations</a> site alone lists 16, most of them FOSS. There are more.</p>

<blockquote>
  <p>If yes, how did you handle it? Created your own server?</p>
</blockquote>

<p>I think this is the most common approach.</p>

<blockquote>
  <p>Is there a CardDav library for Python for example?</p>
</blockquote>

<p>Please do your research, this is trivial to figure out ...</p>

<p>Many PHP servers (you mentioned Zend) are using <a href="http://sabre.io" rel="nofollow">SabreDAV</a> as a basis.</p>

<blockquote>
  <p>I just want to be able to read my contacts using the Address Book of OsX.</p>
</blockquote>

<p>That makes it a lot easier. While you can use a library like SabreDAV, implementing CardDAV readonly is really not that hard. Authentication, a few XML requests for locating an addressbook and then some code to render your existing records as vCards.</p>

<p>If you want to add editing, things get more complicated.</p>

python mysql osx carddav