# CardDAV implementation in Tryton

**URL:** https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650
**Category:** Developer
**Tags:** party
**Created:** [August 7, 2019, 2:31pm UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650 "2019-08-07T14:31:42Z")
**Posts on this page:** 10
**Page:** 2

<div class="post-metadata">

### Author: ![LordVan](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/lordvan/32/1269_2.png) [@LordVan](https://discuss.tryton.org/u/LordVan)
#### Post date: [June 1, 2023, 11:53am UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/21 "2023-06-01T11:53:23Z")

</div>

I made a very basic version of a vcard export

here is the commit on my github repo: [add very basic vcard export · LordVan/tryton-modules@0bf92a0 · GitHub](https://github.com/LordVan/tryton-modules/commit/0bf92a07943e84fdea6da4302bdf240b4c87a0fd)

(i think for thunderbird to be able to connect i need to also route .well-known,.. if i look at the request log:

```auto
Thu Jun 01 11:44:37 2023] INFO:trytond.wsgi:<Request 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav' [GET]>
Thu Jun 01 11:44:41 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:44:41] "GET /tryton_test/party/carddav HTTP/1.1" 200 -
Thu Jun 01 11:45:46 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:45:46 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:45:46] "PROPFIND /tryton_test/party/carddav/ HTTP/1.1" 405 -
Thu Jun 01 11:45:47 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:45:47 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:45:47] "PROPFIND /tryton_test/party/carddav/ HTTP/1.1" 405 -
Thu Jun 01 11:45:48 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/.well-known/carddav' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:45:48 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:45:48] "PROPFIND /tryton_test/party/carddav/.well-known/carddav HTTP/1.1" 405 -
Thu Jun 01 11:45:51 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:45:51 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:45:51] "PROPFIND /tryton_test/party/carddav/ HTTP/1.1" 405 -
Thu Jun 01 11:45:52 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:45:52 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:45:52] "PROPFIND /tryton_test/party/carddav/ HTTP/1.1" 405 -
Thu Jun 01 11:45:53 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/.well-known/carddav' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:45:53 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:45:53] "PROPFIND /tryton_test/party/carddav/.well-known/carddav HTTP/1.1" 405 -
Thu Jun 01 11:46:39 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:46:39 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:46:39] "PROPFIND /tryton_test/party/carddav/ HTTP/1.1" 405 -
Thu Jun 01 11:46:40 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:46:40 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:46:40] "PROPFIND /tryton_test/party/carddav/ HTTP/1.1" 405 -
Thu Jun 01 11:46:41 2023] INFO:trytond.wsgi:<XMLRequest 192.168.69.1 'http://192.168.0.9:8000/tryton_test/party/carddav/.well-known/carddav' [PROPFIND] (invalid WSGI environ)>
Thu Jun 01 11:46:41 2023] INFO:werkzeug:192.168.69.1 - - [01/Jun/2023 11:46:41] "PROPFIND /tryton_test/party/carddav/.well-known/carddav HTTP/1.1" 405 -

```

this is of course no carddav yet .. just a vcard export, but it could be used for one-way sync already. I am still reading cardDAV RFC / looking for libraries

improvement suggestions / comments welcome. - also I can make this a seperate module later on if others are interested. - That said I think most people would want to customize stuff here anyway for custom fields,..

---

<div class="post-metadata">

### Author: ![LordVan](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/lordvan/32/1269_2.png) [@LordVan](https://discuss.tryton.org/u/LordVan)
#### Post date: [June 1, 2023, 12:39pm UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/22 "2023-06-01T12:39:03Z")

</div>

Should there be an interest in a more generic module/approach I would likely split it into sperate methods, so things can be overwritten per “line/attribute”

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 1, 2023, 1:56pm UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/23 "2023-06-01T13:56:53Z")

</div>

There is an interest to have such feature in standard (probably in a module `party_carddav`) with authentication.  
About extensibility, it will probably be better to use a library like [vobject](https://pypi.org/project/vobject/) so each party’s card can be easily extended.  
The best would be to propose a merge request.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [June 2, 2023, 1:01pm UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/24 "2023-06-02T13:01:43Z")

</div>

> [@ced](#):
>
> About extensibility, it will probably be better to use a library like [vobject](https://pypi.org/project/vobject/) so each party’s card can be easily extended.

I’m a little bit concerned about vobject usage as it seems it has not have any new release in 5 years, nobody is [answering issues](https://github.com/eventable/vobject/issues) and [the organization behing it has no members](https://github.com/orgs/eventable/people). So it seems the project is no longer mantainded.

---

<div class="post-metadata">

### Author: ![yangoon](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/y/67e7ee/32.png) [@yangoon](https://discuss.tryton.org/u/yangoon)
#### Post date: [June 2, 2023, 1:22pm UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/25 "2023-06-02T13:22:53Z")

</div>

Indeed we plan to migrate our stack to [icalendar](https://github.com/collective/icalendar)

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [June 5, 2023, 8:15am UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/26 "2023-06-05T08:15:20Z")

</div>

The discussion is related to contacts, not to calendars.

If there is no other library to generate the events. I think we can just return the raw text of each contact card in an extensible method (so it can be customized by third party modules).

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 5, 2023, 10:14am UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/27 "2023-06-05T10:14:16Z")

</div>

> [@pokoli](#):
>
> If there is no other library to generate the events. I think we can just return the raw text of each contact card in an extensible method (so it can be customized by third party modules).

I would prefer to use vobject than raw text even if vobject is not maintained for now (it can still be revived or forked).

---

<div class="post-metadata">

### Author: ![LordVan](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/lordvan/32/1269_2.png) [@LordVan](https://discuss.tryton.org/u/LordVan)
#### Post date: [June 21, 2023, 5:31am UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/28 "2023-06-21T05:31:09Z")

</div>

Yeah I wasn’t sure about using vobject cuz of the last updates to it. but I guess it might be worth it (rather than starting with something similar from scratch .. as you said it can be forked.

---

<div class="post-metadata">

### Author: ![kamrulSh](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/k/f17d59/32.png) [@kamrulSh](https://discuss.tryton.org/u/kamrulSh)
#### Post date: [December 25, 2024, 6:03pm UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/29 "2024-12-25T18:03:29Z")

</div>

Have you created any module for carddav sync?

---

<div class="post-metadata">

### Author: ![LordVan](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/lordvan/32/1269_2.png) [@LordVan](https://discuss.tryton.org/u/LordVan)
#### Post date: [December 26, 2024, 9:09am UTC](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650/30 "2024-12-26T09:09:03Z")

</div>

hi. i have started, but it was more complex than i had thought at first, so I did put it on the lower priority list for now - i need to decide on what library,.. can be used for it as re-implementing carddav would be a bit of a pain

[Previous page](https://discuss.tryton.org/t/carddav-implementation-in-tryton/1650.md?page=1)
