New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let users download profiles as vCards #241
Conversation
Users can now download a simple [vCard] for profiles they visit. This is implemented as a new route. It uses [VObject], the best Python vCard package I could find. Some work was required to make edge cases work, such as the legacy vCard "name" field. See [issue Greening-Digital#106]. [vCard]: https://en.wikipedia.org/wiki/VCard [VObject]: https://eventable.github.io/vobject/ [issue Greening-Digital#106]: Greening-Digital#106
@@ -284,6 +286,23 @@ def generate_invite_mail(self): | |||
|
|||
return {"text": rendered_invite_txt, "html": rendered_invite_html} | |||
|
|||
def vcard(self) -> vobject.vCard: | |||
properties = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add additional properties in the future, but I think this is a good starter set. The vCard Wikipedia page has a good list of these properties, as does the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @EvanHahn , this looks great! I'm very happy to merge this in. - I've asked for a couple of docstrings for the tests as a convenience but otherwise I'm very happy for this to be merged in.
I'm not sure you gave the ability to merge in from an approved PR, if not please let me know, and I'll either grant access or merge it in at your end.
"Biscuit", | ||
"Dr.", | ||
"Dr. Gravy Biscuit", | ||
"Sweet Gravy Biscuit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good names.
I think I've addressed all comments! I don't have permission to merge this myself. Happy to have you do it, or to get the permission to do so myself—whichever is easier for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very happy! Thanks @EvanHahn
Users can now download a simple vCard for profiles they visit. This is implemented as a new route.
Here's how it looks imported into GNOME Contacts:
And into iOS:
It uses VObject, the best Python vCard package I could find. Some work was required to make edge cases work, such as the legacy vCard "name" field.
Addresses #106.