Skip to content
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

Merged
merged 2 commits into from Dec 19, 2023

Conversation

EvanHahn
Copy link
Collaborator

Users can now download a simple vCard for profiles they visit. This is implemented as a new route.

App screenshot

Here's how it looks imported into GNOME Contacts:

GNOME Contacts

And into iOS:

iOS screenshot

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.

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 = {
Copy link
Collaborator Author

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.

@EvanHahn EvanHahn marked this pull request as ready for review December 19, 2023 05:57
Copy link
Member

@mrchrisadams mrchrisadams left a 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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good names.

cl8/utils/tests/test_vcard_util.py Show resolved Hide resolved
cl8/utils/tests/test_vcard_util.py Show resolved Hide resolved
@EvanHahn
Copy link
Collaborator Author

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.

@mrchrisadams mrchrisadams merged commit a5270ea into Greening-Digital:main Dec 19, 2023
1 check passed
Copy link
Member

@mrchrisadams mrchrisadams left a 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

@EvanHahn EvanHahn deleted the vcard branch December 19, 2023 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants