{"id":47842594,"url":"https://github.com/abbgrade/python-vobject","last_synced_at":"2026-04-03T21:01:30.709Z","repository":{"id":21295312,"uuid":"24611461","full_name":"abbgrade/python-vobject","owner":"abbgrade","description":null,"archived":false,"fork":false,"pushed_at":"2014-09-29T20:24:35.000Z","size":156,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T00:47:27.797Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"agersant/polaris-web","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abbgrade.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-29T20:21:39.000Z","updated_at":"2024-05-02T00:47:27.798Z","dependencies_parsed_at":"2022-08-20T15:20:11.334Z","dependency_job_id":null,"html_url":"https://github.com/abbgrade/python-vobject","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abbgrade/python-vobject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2Fpython-vobject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2Fpython-vobject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2Fpython-vobject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2Fpython-vobject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbgrade","download_url":"https://codeload.github.com/abbgrade/python-vobject/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbgrade%2Fpython-vobject/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31377117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-04-03T21:01:30.452Z","updated_at":"2026-04-03T21:01:30.700Z","avatar_url":"https://github.com/abbgrade.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=======\nVObject\n=======\n\nVObject simplifies the process of parsing and creating iCalendar and\nvCard objects.\n\n--------------\n Installation\n--------------\n\nTo install vobject, run::\n\n  python setup.py install\n\nvobject requires the dateutil package, which can be installed via\neasy_install or downloaded from http://labix.org/python-dateutil\n\n---------------\n Running tests\n---------------\n\nUnit tests live in doctests throughout the source code, to run all tests, use::\n\n  python tests/tests.py\n\n-------\n Usage\n-------\n\nCreating iCalendar objects\n..........................\n\nvobject has a basic datastructure for working with iCalendar-like\nsyntaxes.  Additionally, it defines specialized behaviors for many of\nthe commonly used iCalendar objects.\n\nTo create an object that already has a behavior defined, run:\n\n\u003e\u003e\u003e import vobject\n\u003e\u003e\u003e cal = vobject.newFromBehavior('vcalendar')\n\u003e\u003e\u003e cal.behavior\n\u003cclass 'vobject.icalendar.VCalendar2_0'\u003e\n\nConvenience functions exist to create iCalendar and vCard objects:\n\n\u003e\u003e\u003e cal = vobject.iCalendar()\n\u003e\u003e\u003e cal.behavior\n\u003cclass 'vobject.icalendar.VCalendar2_0'\u003e\n\u003e\u003e\u003e card = vobject.vCard()\n\u003e\u003e\u003e card.behavior\n\u003cclass 'vobject.vcard.VCard3_0'\u003e\n\nOnce you have an object, you can use the add method to create\nchildren:\n\n\u003e\u003e\u003e cal.add('vevent')\n\u003cVEVENT| []\u003e\n\u003e\u003e\u003e cal.vevent.add('summary').value = \"This is a note\"\n\u003e\u003e\u003e cal.prettyPrint()\n VCALENDAR\n    VEVENT\n       SUMMARY: This is a note\n\nNote that summary is a little different from vevent, it's a\nContentLine, not a Component.  It can't have children, and it has a\nspecial value attribute.\n\nContentLines can also have parameters.  They can be accessed with\nregular attribute names with _param appended:\n\n\u003e\u003e\u003e cal.vevent.summary.x_random_param = 'Random parameter'\n\u003e\u003e\u003e cal.prettyPrint()\n VCALENDAR\n    VEVENT\n       SUMMARY: This is a note\n       params for  SUMMARY:\n          X-RANDOM ['Random parameter']\n\nThere are a few things to note about this example\n\n  * The underscore in x_random is converted to a dash (dashes are\n    legal in iCalendar, underscores legal in Python)\n  * X-RANDOM's value is a list.\n\nIf you want to access the full list of parameters, not just the first,\nuse \u003cparamname\u003e_paramlist:\n\n\u003e\u003e\u003e cal.vevent.summary.x_random_paramlist\n['Random parameter']\n\u003e\u003e\u003e cal.vevent.summary.x_random_paramlist.append('Other param')\n\u003e\u003e\u003e cal.vevent.summary\n\u003cSUMMARY{'X-RANDOM': ['Random parameter', 'Other param']}This is a note\u003e\n\nSimilar to parameters, If you want to access more than just the first\nchild of a Component, you can access the full list of children of a\ngiven name by appending _list to the attribute name:\n\n\u003e\u003e\u003e cal.add('vevent').add('summary').value = \"Second VEVENT\"\n\u003e\u003e\u003e for ev in cal.vevent_list:\n...     print ev.summary.value\nThis is a note\nSecond VEVENT\n\nThe interaction between the del operator and the hiding of the\nunderlying list is a little tricky, del cal.vevent and del\ncal.vevent_list both delete all vevent children:\n\n\u003e\u003e\u003e first_ev = cal.vevent\n\u003e\u003e\u003e del cal.vevent\n\u003e\u003e\u003e cal\n\u003cVCALENDAR| []\u003e\n\u003e\u003e\u003e cal.vevent = first_ev\n\nvobject understands Python's datetime module and tzinfo classes.\n\n\u003e\u003e\u003e import datetime\n\u003e\u003e\u003e utc = vobject.icalendar.utc\n\u003e\u003e\u003e start = cal.vevent.add('dtstart')\n\u003e\u003e\u003e start.value = datetime.datetime(2006, 2, 16, tzinfo = utc)\n\u003e\u003e\u003e first_ev.prettyPrint()\n     VEVENT\n        DTSTART: 2006-02-16 00:00:00+00:00\n        SUMMARY: This is a note\n        params for  SUMMARY:\n           X-RANDOM ['Random parameter', 'Other param']\n\nComponents and ContentLines have serialize methods:\n\n\u003e\u003e\u003e cal.vevent.add('uid').value = 'Sample UID'\n\u003e\u003e\u003e icalstream = cal.serialize()\n\u003e\u003e\u003e print icalstream\nBEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//PYVOBJECT//NONSGML Version 1//EN\nBEGIN:VEVENT\nUID:Sample UID\nDTSTART:20060216T000000Z\nSUMMARY;X-RANDOM=Random parameter,Other param:This is a note\nEND:VEVENT\nEND:VCALENDAR\n\nObserve that serializing adds missing required lines like version and\nprodid.  A random UID would be generated, too, if one didn't exist.\n\nIf dtstart's tzinfo had been something other than UTC, an appropriate\nvtimezone would be created for it.\n\n\nParsing iCalendar objects\n.........................\n\nTo parse one top level component from an existing iCalendar stream or\nstring, use the readOne function:\n\n\u003e\u003e\u003e parsedCal = vobject.readOne(icalstream)\n\u003e\u003e\u003e parsedCal.vevent.dtstart.value\ndatetime.datetime(2006, 2, 16, 0, 0, tzinfo=tzutc())\n\nSimilarly, readComponents is a generator yielding one top level\ncomponent at a time from a stream or string.\n\n\u003e\u003e\u003e vobject.readComponents(icalstream).next().vevent.dtstart.value\ndatetime.datetime(2006, 2, 16, 0, 0, tzinfo=tzutc())\n\nMore examples can be found in source code doctests.\n\nvCards\n......\n\nMaking vCards proceeds in much the same way. Note that the 'N' and 'FN'\nattributes are required.\n\n\u003e\u003e\u003e j = vobject.vCard()\n\u003e\u003e\u003e j.add('n')\n \u003cN{}    \u003e\n\u003e\u003e\u003e j.n.value = vobject.vcard.Name( family='Harris', given='Jeffrey' )\n\u003e\u003e\u003e j.add('fn')\n \u003cFN{}\u003e\n\u003e\u003e\u003e j.fn.value ='Jeffrey Harris'\n\u003e\u003e\u003e j.add('email')\n \u003cEMAIL{}\u003e\n\u003e\u003e\u003e j.email.value = 'jeffrey@osafoundation.org'\n\u003e\u003e\u003e j.email.type_param = 'INTERNET'\n\u003e\u003e\u003e j.prettyPrint()\n VCARD\n    EMAIL: jeffrey@osafoundation.org\n    params for  EMAIL:\n       TYPE ['INTERNET']\n    FN: Jeffrey Harris\n    N:  Jeffrey  Harris\n\nserializing will add any required computable attributes (like 'VERSION')\n\n\u003e\u003e\u003e j.serialize()\n'BEGIN:VCARD\\r\\nVERSION:3.0\\r\\nEMAIL;TYPE=INTERNET:jeffrey@osafoundation.org\\r\\nFN:Jeffrey Harris\\r\\nN:Harris;Jeffrey;;;\\r\\nEND:VCARD\\r\\n'\n\u003e\u003e\u003e j.prettyPrint()\n VCARD\n    VERSION: 3.0\n    EMAIL: jeffrey@osafoundation.org\n    params for  EMAIL:\n       TYPE ['INTERNET']\n    FN: Jeffrey Harris\n    N:  Jeffrey  Harris \n\nParsing vCards\n..............\n\n\u003e\u003e\u003e s = \"\"\"\n... BEGIN:VCARD\n... VERSION:3.0\n... EMAIL;TYPE=INTERNET:jeffrey@osafoundation.org\n... FN:Jeffrey Harris\n... N:Harris;Jeffrey;;;\n... END:VCARD\n... \"\"\"\n\u003e\u003e\u003e v = vobject.readOne( s )\n\u003e\u003e\u003e v.prettyPrint()\n VCARD\n    VERSION: 3.0\n    EMAIL: jeffrey@osafoundation.org\n    params for  EMAIL:\n       TYPE [u'INTERNET']\n    FN: Jeffrey Harris\n    N:  Jeffrey  Harris\n\u003e\u003e\u003e v.n.value.family\nu'Harris'","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbgrade%2Fpython-vobject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbgrade%2Fpython-vobject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbgrade%2Fpython-vobject/lists"}