{"id":18728284,"url":"https://github.com/worthmine/text-vcard-precisely","last_synced_at":"2025-07-17T07:32:27.103Z","repository":{"id":56576720,"uuid":"75694312","full_name":"worthmine/Text-vCard-Precisely","owner":"worthmine","description":"Read, Write or Edit vCard 3.0 or 4.0 with perl","archived":false,"fork":false,"pushed_at":"2020-11-01T02:25:24.000Z","size":425,"stargazers_count":3,"open_issues_count":6,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T15:02:27.203Z","etag":null,"topics":["perl","vcard"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Text::vCard::Precisely","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worthmine.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-06T04:25:30.000Z","updated_at":"2023-04-12T17:14:30.000Z","dependencies_parsed_at":"2022-08-15T21:20:19.208Z","dependency_job_id":null,"html_url":"https://github.com/worthmine/Text-vCard-Precisely","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/worthmine/Text-vCard-Precisely","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2FText-vCard-Precisely","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2FText-vCard-Precisely/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2FText-vCard-Precisely/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2FText-vCard-Precisely/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worthmine","download_url":"https://codeload.github.com/worthmine/Text-vCard-Precisely/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2FText-vCard-Precisely/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261583278,"owners_count":23180641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["perl","vcard"],"created_at":"2024-11-07T14:20:26.074Z","updated_at":"2025-06-24T00:35:06.332Z","avatar_url":"https://github.com/worthmine.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/worthmine/Text-vCard-Precisely.svg?branch=master)](https://travis-ci.com/worthmine/Text-vCard-Precisely) [![MetaCPAN Release](https://badge.fury.io/pl/Text-vCard-Precisely.svg)](https://metacpan.org/release/Text-vCard-Precisely) [![Build Status](https://img.shields.io/appveyor/ci/worthmine/Text-vCard-Precisely/master.svg?logo=appveyor)](https://ci.appveyor.com/project/worthmine/Text-vCard-Precisely/branch/master)\n# NAME\n\nText::vCard::Precisely - Read, Write and Edit the vCards 3.0 and/or 4.0 precisely\n\n# SYNOPSIS\n\n    use Text::vCard::Precisely;\n    my $vc = Text::vCard::Precisely-\u003enew();\n    # Or now you can write like below if you want to use 4.0:\n    my $vc4 = Text::vCard::Precisely-\u003enew( version =\u003e '4.0' );\n    #or $vc4 = Text::vCard::Precisely::V4-\u003enew(); # it's same\n\n    $vc-\u003en([ 'Gump', 'Forrest', , 'Mr', '' ]);\n    $vc-\u003efn( 'Forrest Gump' );\n\n    use GD;\n    use MIME::Base64;\n    my $gd = GD::Image-\u003enew();\n\n    my $img = $gd-\u003epng();\n    my $base64 = MIME::Base64::encode($img);\n\n    $vc-\u003ephoto([\n       { content =\u003e 'https://avatars2.githubusercontent.com/u/2944869?v=3\u0026s=400',  media_type =\u003e 'image/jpeg' },\n       { content =\u003e $img, media_type =\u003e 'image/png' }, # Now you can set a binary image directly\n       { content =\u003e $base64, media_type =\u003e 'image/png' }, # Also accept the text encoded in Base64\n    ]);\n\n    $vc-\u003eorg('Bubba Gump Shrimp Co.'); # Now you can set/get org!\n\n    $vc-\u003etel({ content =\u003e '+1-111-555-1212', types =\u003e ['work'], pref =\u003e 1 });\n\n    $vc-\u003eemail({ content =\u003e 'forrestgump@example.com', types =\u003e ['work'] });\n\n    $vc-\u003eadr( {\n       types =\u003e ['work'],\n       pobox     =\u003e '109',\n       extended  =\u003e 'Shrimp Bld.',\n       street    =\u003e 'Waters Edge',\n       city      =\u003e 'Baytown',\n       region    =\u003e 'LA',\n       post_code =\u003e '30314',\n       country   =\u003e 'United States of America',\n    });\n\n    $vc-\u003eurl({ content =\u003e 'https://twitter.com/worthmine', types =\u003e ['twitter'] }); # for URL param\n\n    print $vc-\u003eas_string();\n\n# DESCRIPTION\n\nA vCard is a digital business card.\nvCard and [Text::vFile::asData](https://metacpan.org/pod/Text%3A%3AvFile%3A%3AasData) provides an API for parsing vCards\n\nThis module is forked from [Text::vCard](https://metacpan.org/pod/Text%3A%3AvCard)\nbecause some reason below:\n\n- Text::vCard **doesn't provide** full methods based on [RFC2426](https://tools.ietf.org/html/rfc2426)\n- Mac OS X and iOS can't parse vCard4.0 with UTF-8 precisely. they cause some Mojibake\n- Android 4.4.x can't parse vCard4.0\n\nTo handle an address book with several vCard entries in it, start with\n[Text::vFile::asData](https://metacpan.org/pod/Text%3A%3AvFile%3A%3AasData) and then come back to this module.\n\nNote that the vCard RFC requires `VERSION` and `FN`.  This module does not check or warn yet if these conditions have not been met\n\n# Constructors\n\n## load\\_hashref($HashRef)\n\nAccepts a HashRef that looks like below:\n\n    my $hashref = {\n       N   =\u003e [ 'Gump', 'Forrest', '', 'Mr.', '' ],\n       FN  =\u003e 'Forrest Gump',\n       SORT_STRING =\u003e 'Forrest Gump',\n       ORG =\u003e 'Bubba Gump Shrimp Co.',\n       TITLE =\u003e 'Shrimp Man',\n       PHOTO =\u003e { media_type =\u003e 'image/gif', content =\u003e 'http://www.example.com/dir_photos/my_photo.gif' },\n       TEL =\u003e [\n           { types =\u003e ['WORK','VOICE'], content =\u003e '(111) 555-1212' },\n           { types =\u003e ['HOME','VOICE'], content =\u003e '(404) 555-1212' },\n       ],\n       ADR =\u003e[{\n           types       =\u003e ['work'],\n           pref        =\u003e 1,\n           extended    =\u003e 100,\n           street      =\u003e 'Waters Edge',\n           city        =\u003e 'Baytown',\n           region      =\u003e 'LA',\n           post_code   =\u003e '30314',\n           country     =\u003e 'United States of America'\n       },{\n           types       =\u003e ['home'],\n           extended    =\u003e 42,\n           street      =\u003e 'Plantation St.',\n           city        =\u003e 'Baytown',\n           region      =\u003e 'LA',\n           post_code   =\u003e '30314',\n           country     =\u003e 'United States of America'\n       }],\n       URL =\u003e 'http://www.example.com/dir_photos/my_photo.gif',\n       EMAIL =\u003e 'forrestgump@example.com',\n       REV =\u003e '2008-04-24T19:52:43Z',\n    };\n\n## load\\_file($file\\_name)\n\nAccepts a file name\n\n## load\\_string($vCard)\n\nAccepts a vCard string\n\n# METHODS\n\n## as\\_string()\n\nReturns the vCard as a string with non-decoded UTF-8.\nif you have \\`use utf8;\\` in your scope, you have to do `Encode::decode_utf8`\n\n## as\\_file($filename)\n\nWrite data in vCard format to $filename.\nDies if not successful\n\n# SIMPLE GETTERS/SETTERS\n\nThese methods accept and return strings\n\n## version()\n\nreturns Version number of the vcard.\nDefaults to **'3.0'** and this method is **READONLY**\n\n## rev()\n\nTo specify revision information about the current vCard\n\n## sort\\_string()\n\nTo specify the family name, given name or organization text to be used for\nnational-language-specific sorting of the `FN`, `N` and `ORG`.\n\n**This method is DEPRECATED in vCard4.0** Use `SORT-AS` param instead of it.\n\n# COMPLEX GETTERS/SETTERS\n\nThey are based on Moose with coercion.\nSo these methods accept not only ArrayRef\\[HashRef\\] but also ArrayRef\\[Str\\],\nsingle HashRef or single Str.\n\nRead source if you were confused\n\n## n()\n\nTo specify the components of the name of the object the vCard represents\n\n## tel()\n\nAccepts/returns an ArrayRef that looks like:\n\n    [\n       { types =\u003e ['work'], content =\u003e '651-290-1234', preferred =\u003e 1 },\n       { types =\u003e ['home'], content =\u003e '651-290-1111' },\n    ]\n\nAfter version 0.18, **content will not be validated as phone numbers** \nAll _Str_ types are accepted.\n\nSo you have to validate phone numbers with your way.\n\n## adr(), address()\n\nAccepts/returns an ArrayRef that looks like:\n\n    [\n       { types =\u003e ['work'], street =\u003e 'Main St', pref =\u003e 1 },\n       {   types     =\u003e ['home'],\n           pobox     =\u003e 1234,\n           extended  =\u003e 'asdf',\n           street    =\u003e 'Army St',\n           city      =\u003e 'Desert Base',\n           region    =\u003e '',\n           post_code =\u003e '',\n           country   =\u003e 'USA',\n           pref      =\u003e 2,\n       },\n    ]\n\n## email()\n\nAccepts/returns an ArrayRef that looks like:\n\n    [\n       { types =\u003e ['work'], content =\u003e 'bbanner@ssh.secret.army.mil' },\n       { types =\u003e ['home'], content =\u003e 'bbanner@timewarner.com', pref =\u003e 1 },\n    ]\n\nor accept the string as email like below\n\n    'bbanner@timewarner.com'\n\n## url()\n\nAccepts/returns an ArrayRef that looks like:\n\n    [\n       { content =\u003e 'https://twitter.com/worthmine', types =\u003e ['twitter'] },\n       { content =\u003e 'https://github.com/worthmine' },\n    ]\n\nor accept the string as URL like below\n\n    'https://github.com/worthmine'\n\n## photo(), logo()\n\nAccepts/returns an ArrayRef of URLs or Images: \nEven if they are raw image binary or text encoded in Base64, it does not matter\n\n**Attention!** Mac OS X and iOS **ignore** the description beeing URL\n\nuse Base64 encoding or raw image binary if you have to show the image you want\n\n## note()\n\nTo specify supplemental information or a comment that is associated with the vCard\n\n## org(), title(), role(), categories()\n\nTo specify additional information for your jobs\n\nIn these, `CATEGORIES` may have multiple content with being separated by COMMA.\nmultiple content is expressed by using ArrayRef like this:\n\n    $vc-\u003ecategories([qw(Internet Travel)]);\n\n## fn(), full\\_name(), fullname()\n\nA person's entire name as they would like to see it displayed\n\n## nickname()\n\nTo specify the text corresponding to the nickname of the object the vCard represents\n\nLike `CATEGORIES`, It ALSO may have multiple content with being separated by COMMA.\n\n    $vc-\u003enickname([qw(Johny John)]);\n\n## geo()\n\nTo specify information related to the global positioning of the object the vCard represents\n\n## key()\n\nTo specify a public key or authentication certificate associated with the object that the vCard represents\n\n## label()\n\nToDo: because **It's DEPRECATED in vCard4.0**\n\nTo specify the formatted text corresponding to delivery address of the object the vCard represents\n\n## uid()\n\nTo specify a value that represents a globally unique identifier corresponding to \nthe individual or resource associated with the vCard\n\n## tz(), timezone()\n\nBoth are same method with Alias\n\nTo specify information related to the time zone of the object the vCard represents\n\nutc-offset format is NOT RECOMMENDED from vCard4.0\n\n`TZ` can be a URL, but there is no document in\n [RFC2426](https://tools.ietf.org/html/rfc2426)\nor [RFC6350](https://tools.ietf.org/html/rfc6350)\n\nSo it just supports some text values\n\n## bday(), birthday()\n\nBoth are same method with Alias\n\nTo specify the birth date of the object the vCard represents\n\n## prodid()\n\nTo specify the identifier for the product that created the vCard object\n\n## source()\n\nTo identify the source of directory information contained in the content type\n\n## sound()\n\nTo specify a digital sound content information that annotates some aspect of the vCard\n\nThis property is often used to specify the proper pronunciation of \nthe name property value of the vCard\n\n## socialprofile()\n\nThere is no documents about `X-SOCIALPROFILE` in RFC but it works in iOS and Mac OS X!\n\nI don't know well about in Android or Windows. Somebody please feedback me\n\n## label()\n\n**It's DEPRECATED in vCard4.0** You can use this method Just ONLY in vCard3.0\n\n# For operating files with multiple vCards\n\nSee [Text::vCard::Precisely::Multiple](https://metacpan.org/pod/Text%3A%3AvCard%3A%3APrecisely%3A%3AMultiple)\n\n# aroud UTF-8\n\nIf you want to send precisely the vCard with UTF-8 characters to the **ALMOST**\nof smartphones, Use 3.0\n\nIt seems to be TOO EARLY to use 4.0\n\n# for under perl-5.12.5\n\nThis module uses `\\P{ascii}` in regexp so You have to use 5.12.5 and later\n\n# SEE ALSO\n\n- [RFC 2426](https://tools.ietf.org/html/rfc2426)\n- [RFC 2425](https://tools.ietf.org/html/rfc2425)\n- [RFC 6350](https://tools.ietf.org/html/rfc6350)\n- [Text::vCard::Precisely::Multiple](https://metacpan.org/pod/Text%3A%3AvCard%3A%3APrecisely%3A%3AMultiple)\n- [Text::vFile::asData](https://metacpan.org/pod/Text%3A%3AvFile%3A%3AasData)\n\n# AUTHOR\n\nYuki Yoshida([worthmine](https://github.com/worthmine))\n\n# LICENSE\n\nThis is free software; you can redistribute it and/or modify it under the same terms as Perl.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworthmine%2Ftext-vcard-precisely","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworthmine%2Ftext-vcard-precisely","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworthmine%2Ftext-vcard-precisely/lists"}