{ "info": { "author": "Glenn Hutchings", "author_email": "zondo42@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Natural Language :: English", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Operating System :: Unix", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Communications :: Email :: Address Book", "Topic :: Database" ], "description": "\n==============================================================\n PyBBDB -- an interface to the Insidious Big Brother Database\n==============================================================\n\n.. contents::\n\nIntroduction\n============\n\nPyBBDB may sound like a rude noise, but it is actually a Python interface\nto the Insidious Big Brother Database (BBDB_), an address book used with\n`GNU Emacs`_. You can find out more about BBDB on the `Emacs Wiki`_. The\nPyBBDB source repo is hosted at Bitbucket_. Releases can be found on\nPyPI_.\n\n.. note::\n\n This module only handles BBDB version 2. There is a version 3 in\n development on Savannah_, but there has been no public release as yet.\n\nRequirements\n============\n\nTo install and run it:\n pyparsing_, voluptuous_ and six_\n\nTo run unit tests:\n pytest_\n\nInstallation\n============\n\nThe usual incantation will install things::\n\n pip install pybbdb\n\nUsage\n=====\n\nCreating a BBDB database\n------------------------\n\nTo create a new database is as simple as you might expect::\n\n >>> from bbdb import BBDB\n >>> db = BBDB()\n\nThe database starts with no records. To add a new one, use the\n``add_record()`` method, specifying the first and last names, and any other\nattributes you want to set::\n\n >>> fred = db.add_record(\"Fred\", \"Flintstone\")\n >>> fred\n \n\n >>> barney = db.add_record(\"Barney\", \"Rubble\")\n >>> db\n \n\nYou can use the returned record object to set other attributes::\n\n >>> fred.set_company(\"Slate Rock & Gravel\")\n\nA ``Record`` is a subclass of ``OrderedDict``, so you can set or modify\nattributes in this style::\n\n >>> fred[\"company\"] = \"Slate Rock & Gravel\"\n\nAs a convenience, there are properties for each of the valid attributes::\n\n >>> fred.firstname\n 'Fred'\n\n >>> fred.company\n 'Slate Rock & Gravel'\n\nThere's also a composite ``name`` property::\n\n >>> fred.name\n 'Fred Flintstone'\n\nSome BBDB attributes consist of lists of things, and there are ``add_*()``\nmethods for these::\n\n >>> fred.add_net(\"fred@bedrock.org\")\n >>> fred.add_net(\"fred.flintstone@gravel.com\")\n >>> fred.net\n ['fred@bedrock.org', 'fred.flintstone@gravel.com']\n\n >>> fred.add_aka(\"Freddie\")\n >>> fred.aka\n ['Freddie']\n\nTelephone records consist of a location tag and a phone number string::\n\n >>> fred.add_phone(\"Work\", \"555-6789\")\n >>> fred.add_phone(\"Home\", \"555-1234\")\n >>> fred.phone\n SortedDict([('Home', '555-1234'), ('Work', '555-6789')])\n\nRecords can have multiple addresses, each indexed by a location tag. Each\naddress in turn has several attributes::\n\n >>> home = fred.add_address(\"Home\")\n >>> home.add_location(\"Cave 2a\", \"345 Cavestone Road\")\n >>> home.set_city(\"Bedrock\")\n >>> home.set_state(\"Hanna Barbera\")\n >>> home.set_zipcode(\"12345\")\n >>> home.set_country(\"USA\")\n\n >>> home\n \n\n >>> home.location\n ['Cave 2a', '345 Cavestone Road']\n\n >>> home.zipcode\n '12345'\n\nFinally, each entry can have an arbitrary dictionary of user-defined\nfields::\n\n >>> fred.add_field(\"spouse\", \"Wilma\")\n >>> fred.add_field(\"kids\", \"Pebbles, Bam-Bam\")\n >>> fred.add_field(\"catchphrase\", '\"Yabba dabba doo!\"')\n >>> fred.fields\n SortedDict([('catchphrase', '\"Yabba dabba doo!\"'), ('kids', 'Pebbles, Bam-Bam'), ('spouse', 'Wilma')])\n\nField values can also have newlines::\n\n >>> barney.add_field(\"pets\", \"brontosaurus\\npterodactyl\")\n\nReading and writing BBDB files\n------------------------------\n\nThe ``write()`` method will write the database to a stream (default\n``stdout``) in a format suitable for use by GNU Emacs::\n\n >>> db.write() # doctest: +ELLIPSIS +REPORT_UDIFF\n ;; -*-coding: utf-8-emacs;-*-\n ;;; file-version: 6\n ;;; user-fields: (catchphrase kids pets spouse)\n [\"Barney\" \"Rubble\" nil nil nil nil nil ((pets . \"brontosaurus\\npterodactyl\")) nil]\n [\"Fred\" \"Flintstone\" (\"Freddie\") \"Slate Rock & Gravel\" ([\"Home\" \"555-1234\"] ...\n\nThe convenience ``write_file()`` method will put that in a file::\n\n >>> db.write_file(\"examples/bbdb.el\")\n\nYou can read a database from file using the ``fromfile()`` static method::\n\n >>> newdb = BBDB.fromfile(\"examples/bbdb.el\")\n >>> newdb\n \n\n >>> newdb == db\n True\n\nThe ``read()`` and ``read_file()`` methods of a BBDB database can be used\nimport records from other databases.\n\nExporting to other formats\n--------------------------\n\nSince all BBDB objects are subclasses of ``OrderedDict``, you can easily\nserialize it to other formats. For example, JSON::\n\n >>> import sys\n >>> import json\n >>> json.dump(db, sys.stdout, indent=4) # doctest: +NORMALIZE_WHITESPACE +REPORT_UDIFF\n {\n \"coding\": \"utf-8-emacs\", \n \"fileversion\": 6, \n \"records\": [\n {\n \"firstname\": \"Barney\", \n \"lastname\": \"Rubble\", \n \"company\": \"\", \n \"aka\": [], \n \"phone\": {}, \n \"address\": {}, \n \"net\": [], \n \"fields\": {\n \"pets\": \"brontosaurus\\\\npterodactyl\"\n }\n }, \n {\n \"firstname\": \"Fred\", \n \"lastname\": \"Flintstone\", \n \"company\": \"Slate Rock & Gravel\", \n \"aka\": [\n \"Freddie\"\n ], \n \"phone\": {\n \"Home\": \"555-1234\", \n \"Work\": \"555-6789\"\n }, \n \"address\": {\n \"Home\": {\n \"location\": [\n \"Cave 2a\", \n \"345 Cavestone Road\"\n ], \n \"city\": \"Bedrock\", \n \"state\": \"Hanna Barbera\", \n \"zipcode\": \"12345\", \n \"country\": \"USA\"\n }\n }, \n \"net\": [\n \"fred@bedrock.org\", \n \"fred.flintstone@gravel.com\"\n ], \n \"fields\": {\n \"catchphrase\": \"\\\"Yabba dabba doo!\\\"\", \n \"kids\": \"Pebbles, Bam-Bam\", \n \"spouse\": \"Wilma\"\n }\n }\n ]\n }\n\nYou can create a BBDB database from an appropriately-structured dict using\nthe ``fromdict`` method::\n\n >>> serialized = json.dumps(db)\n >>> data = json.loads(serialized)\n >>> newdb = BBDB.fromdict(data)\n >>> newdb == db\n True\n\nRelease history\n===============\n\nVersion 0.4 (10 February 2017)\n------------------------------\n\n* Use pytest for unit tests.\n\n* Bugfix: add support for newlines in fields.\n* Bugfix: allow last name to be nil.\n\nVersion 0.3 (22 July 2015)\n--------------------------\n\n* Bugfix: get things working properly with Python 3.\n\nVersion 0.2 (2 July 2015)\n-------------------------\n\n* Add validation of data using voluptuous_.\n* Add a bunch of demo converter programs.\n* Add tox_ test support.\n* Add Python 3 support.\n\n* Bugfix: convert records from file to correct type.\n\nVersion 0.1 (11 June 2015)\n--------------------------\n\n* Initial release.\n\nFeedback\n========\n\nReport any problems, bugs, etc, to me (Glenn Hutchings) at\nzondo42@gmail.com. Patches will also be welcome!\n\n.. _Bitbucket: https://bitbucket.org/zondo/pybbdb\n.. _BBDB: http://bbdb.sourceforge.net\n.. _PyPI: https://pypi.python.org/pypi/pybbdb\n.. _Emacs Wiki: http://www.emacswiki.org/emacs/CategoryBbdb\n.. _Mercurial: http://mercurial.selenic.com\n.. _GNU Emacs: https://www.gnu.org/software/emacs\n.. _Savannah: https://savannah.nongnu.org/projects/bbdb\n.. _pyparsing: https://pypi.python.org/pypi/pyparsing\n.. _pytest: https://pypi.python.org/pypi/pytest\n.. _six: https://pypi.python.org/pypi/six\n.. _tox: https://pypi.python.org/pypi/tox\n.. _voluptuous: https://pypi.python.org/pypi/voluptuous\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/pybbdb", "keywords": "", "license": "LGPL v2 or later", "maintainer": "", "maintainer_email": "", "name": "pybbdb", "package_url": "https://pypi.org/project/pybbdb/", "platform": "", "project_url": "https://pypi.org/project/pybbdb/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/pybbdb" }, "release_url": "https://pypi.org/project/pybbdb/0.4/", "requires_dist": null, "requires_python": "", "summary": "Interface to BBDB, the Insidious Big Brother Database.", "version": "0.4" }, "last_serial": 2633932, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a1435fae901ce6bae5469ee3725821c2", "sha256": "d0a0a117c35da5659aec65a71a10b53ab4efbf04215fc33847c3528285628619" }, "downloads": -1, "filename": "pybbdb-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a1435fae901ce6bae5469ee3725821c2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10077, "upload_time": "2015-06-11T17:25:28", "url": "https://files.pythonhosted.org/packages/19/2e/ba4b62246fa005113cddfc463a7a07a0130ed9a8800c2ed9ca536d0b0c08/pybbdb-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "baf79445900437d0528210e51db45106", "sha256": "18a977c79e0ace1e74104f203d039117a33542b02966dcd5e83547dfa996bf9f" }, "downloads": -1, "filename": "pybbdb-0.1.tar.gz", "has_sig": false, "md5_digest": "baf79445900437d0528210e51db45106", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14892, "upload_time": "2015-06-11T17:25:21", "url": "https://files.pythonhosted.org/packages/30/ad/67b6e997595fc26ff341babd3699673736dc89c5912051403cc5ca2769c7/pybbdb-0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "535d4eeed57f7b1dd578de376e47ce91", "sha256": "a2d5d55d615c36253466cac1a30f5a71cfb70318cae44ac1f3f7e54ccf85f92e" }, "downloads": -1, "filename": "pybbdb-0.1.zip", "has_sig": false, "md5_digest": "535d4eeed57f7b1dd578de376e47ce91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21560, "upload_time": "2015-06-11T17:25:24", "url": "https://files.pythonhosted.org/packages/88/80/0d0a1c1d1179cff5ecb0ae1421278efd97fa34c6b070b2aebbf74908226c/pybbdb-0.1.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "a5b96965e5c835ee9c30441e1f93fe41", "sha256": "6b1caa82f3d083f350303331a99a5be900eb519485b822924fe3c659002b5dce" }, "downloads": -1, "filename": "pybbdb-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a5b96965e5c835ee9c30441e1f93fe41", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17218, "upload_time": "2015-07-02T20:34:37", "url": "https://files.pythonhosted.org/packages/27/54/d9f7350607796abf6040ef894574c0f037f272ead7e9b718b8ac76fc4c57/pybbdb-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f1d19d1e8f7d6e8c5af1879821822774", "sha256": "ad96c9886913a668e09653ad041d3a7baa1187639eee3c83d11a858c48e1af3d" }, "downloads": -1, "filename": "pybbdb-0.2.tar.gz", "has_sig": false, "md5_digest": "f1d19d1e8f7d6e8c5af1879821822774", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25657, "upload_time": "2015-07-02T20:34:30", "url": "https://files.pythonhosted.org/packages/e3/16/88d3cdbf3437fd9faf74363864c8c7086e07211cf306b2e4eed01eea0656/pybbdb-0.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "00867eb8e7010c079e3f146af3972a32", "sha256": "cd07bda1f9c7b59515f4db3af0fb993ba3b66094e3b7569a48b9042f53e5ed9d" }, "downloads": -1, "filename": "pybbdb-0.2.zip", "has_sig": false, "md5_digest": "00867eb8e7010c079e3f146af3972a32", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35584, "upload_time": "2015-07-02T20:34:33", "url": "https://files.pythonhosted.org/packages/ee/5a/2e0e4f3865cfca5d780c30b294cebc64b6e47753e22aa256b9ad42e4c838/pybbdb-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7437b532665fc625dfddf9bf80314dd6", "sha256": "097572c21a7fb83978fef10a10113b7db78b3c6db1ecc8f8c9d4c45035ac93ec" }, "downloads": -1, "filename": "pybbdb-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7437b532665fc625dfddf9bf80314dd6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17289, "upload_time": "2015-07-22T07:59:39", "url": "https://files.pythonhosted.org/packages/74/d6/79956a591d175cf6de8d8f14da4bd0a021dcd5c20d75d132401b616c8c9e/pybbdb-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c51f88917296f98f5d40026079cb1733", "sha256": "52a225548288e47d14cd102bc8c260d42f33cdb3e8bc9530a8f6e5d388f9623b" }, "downloads": -1, "filename": "pybbdb-0.3.tar.gz", "has_sig": false, "md5_digest": "c51f88917296f98f5d40026079cb1733", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25785, "upload_time": "2015-07-22T07:59:32", "url": "https://files.pythonhosted.org/packages/29/03/26d71be5366afa320f6f96162b2dce431fb66bbea8f29f0f06ccbc41cd6d/pybbdb-0.3.tar.gz" }, { "comment_text": "", "digests": { "md5": "6ee9a70bc6cc0de1c37588edcc59bbc6", "sha256": "764ad45e557cd827d26f18218a45acbf1476933998dc3c85cdf2bf2447621fb3" }, "downloads": -1, "filename": "pybbdb-0.3.zip", "has_sig": false, "md5_digest": "6ee9a70bc6cc0de1c37588edcc59bbc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35711, "upload_time": "2015-07-22T07:59:35", "url": "https://files.pythonhosted.org/packages/53/e2/8576f8d038cc38696d70b94f7aeb6dae14b5c846b8f1fc62957d2826a289/pybbdb-0.3.zip" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "c34d30a1b8fe365f1b3ea40d180def18", "sha256": "4ac2708b30c051d798caf06256db4c92a88c8565bee45560d80f17067e0091bb" }, "downloads": -1, "filename": "pybbdb-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c34d30a1b8fe365f1b3ea40d180def18", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 14384, "upload_time": "2017-02-10T17:43:00", "url": "https://files.pythonhosted.org/packages/b2/c6/f8f9015fc19bcfdb2a021196e78fd5dedb806b2d0ee6a8606cb76a68c204/pybbdb-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a403efc5b65ca0e51a2e3d7a31f3e44", "sha256": "52bf989b0700778b89285bb425b0e424d7e9af05914fd9671214c27679f12a43" }, "downloads": -1, "filename": "pybbdb-0.4.tar.gz", "has_sig": false, "md5_digest": "2a403efc5b65ca0e51a2e3d7a31f3e44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25539, "upload_time": "2017-02-10T17:42:57", "url": "https://files.pythonhosted.org/packages/1c/f8/f0f65db63447c12b46345d0a47d9b91625ec16c3f7c6288f6bab7486e94f/pybbdb-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c34d30a1b8fe365f1b3ea40d180def18", "sha256": "4ac2708b30c051d798caf06256db4c92a88c8565bee45560d80f17067e0091bb" }, "downloads": -1, "filename": "pybbdb-0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c34d30a1b8fe365f1b3ea40d180def18", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 14384, "upload_time": "2017-02-10T17:43:00", "url": "https://files.pythonhosted.org/packages/b2/c6/f8f9015fc19bcfdb2a021196e78fd5dedb806b2d0ee6a8606cb76a68c204/pybbdb-0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a403efc5b65ca0e51a2e3d7a31f3e44", "sha256": "52bf989b0700778b89285bb425b0e424d7e9af05914fd9671214c27679f12a43" }, "downloads": -1, "filename": "pybbdb-0.4.tar.gz", "has_sig": false, "md5_digest": "2a403efc5b65ca0e51a2e3d7a31f3e44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25539, "upload_time": "2017-02-10T17:42:57", "url": "https://files.pythonhosted.org/packages/1c/f8/f0f65db63447c12b46345d0a47d9b91625ec16c3f7c6288f6bab7486e94f/pybbdb-0.4.tar.gz" } ] }