{ "info": { "author": "Dax Wilson", "author_email": "daxwilson@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Description\n-----------\nThe propdb package is a simple database package. It is basically a\npersisting Python dictionary.\n\nProperty item name's are dictionary keys and the dictionary values are\nproperty items. The keys are enforced to be of basestring type whereas\nthe values can be anything, almost. The property bag is saved to the file\nsystem by serializing the dictionary as JSON or by cPickle; therefore,\nthe property item values must be able to be seriailized by one of those\ntwo modules.\n\nProperty bag name and location form the path where the bag is saved. If no\nlocation is set then the current working directory is used. If no name is\nset then a temp name is automatically generated. Property bags\nare created by instantiating a propbag. Property items are created by\ncalling add from the bag instance.\n\nIf autosave is true then the bag will automatically save when property\nitems are added, updated, or dropped. If multiple items need to be added,\nupdated, or dropped then suspend autosave before operations\nby calling suspend_autosave(). Resume autosaving once operations are\ncompleted by calling resume_autosave(). If autosave is false then the bag\ncan manually be saved by calling the save() method. Checking the is_dirty\nproperty on the bag indicates if the bag needs to be saved.\n\nProperty items in a property bag can be iterated directly on the instance\nof the bag (e.g. for item in bag).\n\nProperty bags can be serialized as JSON or by cPickle by setting the\n\"backend\" argument when instantiating a bag.\n\nProperty bags can be encrypted by setting the secret_key argument.\nThe secret_key can be 32 characters in length and AES encryption\nalgorithm is used. Note: The M2Crypto must be installed for this\nfeature to work.\n\nProperty bags can be sync'd if multiple instances of the same bag\nis referenced by other property bags by calling the sync() method.\nIf autosync is set to true when instantiating a property bag then\nsync'ing will automatically be done when saving.\n\nInstallation\n------------\n::\n\n\tpip install propdb\n\nBasic Usage\n-----------\n::\n\n\tfrom propdb.propbag import propbag as bag\n\tfrom propdb.propbag import propitem as item\n\t\n\tbag1 = bag('bag1')\n\tbag1.add('item1')\n\tbag1.add(('item2', 'Value as a string', 'item3', 3333))\n\t\n\titem1 = bag1['item1']\n\titem1.value = [1, 2, 3, 4]\n\tbag1.set(item1)\n\t\n\tbag1.set(('item2', 'A new string value'))\n\tbag1.set({'item3':12345})\n\nImports\n-------\n::\n\n\tfrom propdb.propbag import propbag\n\tfrom propdb.propbag import propitem\n\nCreate a new property bag\n-------------------------\n::\n\n\t# all arguments are optional\n\tpropbag(name, directory, autosave, backend, secret_key)\n\n\t# creates a bag with a random name\n\tbag1 = propbag()\n\n\t# creates a bag named 'mybag' in the current working directory\n\tbag2 = propbag('mybag')\n\n\t# creates a bag named 'mybag' in the temp folder\n\tbag3 = propbag('mybag', 'c:\\\\temp')\n\n\t# creates a bag named 'mybag' where autosave is off and the\n\t# backend is pickle\n\tbag4 = propbag('mybag', autosave = False, backend = backendformat.pickle)\n\tbag4.save()\n\n\t# creates an encrypted bag\n\tbag5 = propbag(secret_key = 'supersecretpassword')\n\tprint(bag5.location)\n\nAdding property items\n---------------------\nUse the propbag.add(items) method to add property item(s) to the bag.\n\nReturns a list of all the added property items.\n\nAdding property items is very flexible. It is acceptable\nto add one or many with one call. It can be just a name, a collection, or a\nproperty item instance. Adding by list can be name/value pairs or\na collection of property items. Adding by dictionary uses the key for\nthe name and the value for the property item's value.\n::\n\n\tfrom propdb.propbag import propbag\n\n\t# create new bag\n\tbag = propbag('mybag')\n\n\t# adds a property item with the value set to None\n\tbag.add('item1')\n\t\n\t# by list of name/value pairs\n\tbag.add(('item1', 1, 'item2', 2, ...))\n\t\n\t# by dictionary\n\tbag.add({'item1':1, 'item2':2, ...})\n\t\n\t# by list or propitems\n\tbag.add((propitem, propitem, ...))\n\t\n\t# by propitem\n\tbag.add(propitem)\n\nAdding property items with the + and += operators can be done in the\nsame exact way as the add method (e.g. propbag + propitem, etc). The\nonly difference is that there is no return value when adding by\noperator.\n\nFor example:\n::\n\n\tbag + 'item1'\n\tbag += ('item1', 1, 'item2', 2, ...)\n\nUpdating property items\n-----------------------\nUse propbag.set to update property item(s) in the bag.\n\nReturns a list of all the updated property items.\n\nUpdating property items is very flexible. It is acceptable\nto update one or many with one call. It can be a collection or an instance of a\nproperty item. Updating by list must be by name/value pairs or a collection\nof property items. Updating by dictionary assumes the key to be\nthe name and the dictionary value the value of the property item.\n::\n\n\tfrom propdb.propbag import propbag\n\n\t# create new bag\n\tbag = propbag('mybag')\n\n\t# by list of name/value pairs\n\tbag.set(('item1', 1, 'item2', 2, ...))\n\t\n\t# by dictionary\n\tbag.set({'item1':1, 'item2':2, ...})\n\t\n\t# by list or propitems\n\tbag.set((propitem, propitem, ...))\n\t\n\t# by propitem\n\tbag.set(propitem)\n\nUpdating property items with the [] operator can be done by\nindexing the property bag with the name of the property item\nand passing in a new value or a property item.\n\nFor example:\n::\n\n\tbag['item1'] = value\n\tbag[propitem.name] = propitem\n\nDeleting property items\n-----------------------\nUse propbag.drop to delete property item(s) from the bag.\n\nReturns the number of property items dropped.\n\nDropping property items is very flexible. It is acceptable\nto drop one or many with one call. It can be a single string,\nproperty item, or list.\n\nDelete one property item by passing the name of the item to delete.\nPassing a list can either be a list of names or property items,\nmixed is acceptable as well (e.g. ('item1', propitem)).\n::\n\n\tfrom propdb.propbag import propbag\n\n\t# create new bag\n\tbag = propbag('mybag')\n\n\t# drops one property by name\n\tbag.drop('item1')\n\t\n\t# drops one property item by name\n\tbag.drop(propitem)\n\t\n\t# by list of names\n\tbag.drop(('item1', 'item2', 'item3', ...))\n\t\n\t# by list of propitems\n\tbag.drop((propitem, propitem, ...))\n\nDropping property items with the - and -= operators can be done in\nthe same exact way as the drop method (e.g. propbag - propitem, etc).\nThe only difference is that there is no return value when dropping\nby operator.\n\nFor example:\n::\n\n\tbag - 'item1' # drops one property item by name\n\tbag -= ('item1', 'item2', 'item3', ...) # via list of names\n\nSync'ing property items\n-----------------------\nUse propbag.sync to sync changes in a bag if altered by a different\ninstance of the same bag.\n\nSetting autosync to true when instantiating a property bag will\nactivate this feature automatically.\n::\n\n\tfrom propdb.propbag import propbag\n\n\t# create two bags that point to the same bag\n\tbag1 = propbag('mybag')\n\tbag2 = propbag('mybag')\n\n\t# create property item in bag1\n\tbag1.add({'item1':1})\n\n\t# sync bag2...bag2 now has item1\n\tbag2.sync()\n\n\nChanges\n--------\n\n0.3.0 - Sync and autosync features added to property bags.\n\n0.2.0 - Supports two types of serialization: backendformat.json (default)\nand backendformat.pickle. Supports saving the bag encrypted with M2Crypto.\n\n0.1.4 - Added unittests and fixed a bug when adding by dictionary\n\n<= 0.1.3 - Working out the details of publishing to PyPI", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/daxwilson/propdb", "keywords": null, "license": "GNU-GPL", "maintainer": null, "maintainer_email": null, "name": "propdb", "package_url": "https://pypi.org/project/propdb/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/propdb/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/daxwilson/propdb" }, "release_url": "https://pypi.org/project/propdb/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Property Bag Style Database", "version": "0.3.0" }, "last_serial": 1074818, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "007eacc164e70b8deedaf0b3162685d3", "sha256": "e08e2c8eb186d0303310c23ac9b259a4d941782c0302b278af37052968276c69" }, "downloads": -1, "filename": "propdb-0.1.0.zip", "has_sig": false, "md5_digest": "007eacc164e70b8deedaf0b3162685d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6240, "upload_time": "2014-02-09T23:56:54", "url": "https://files.pythonhosted.org/packages/be/ee/8fb5df700104c64a668572b1bfd9c508cb258dddbe9c202bd7fa445af216/propdb-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "4dab0f137f60cb574ee75f8aeacb0a85", "sha256": "8a3d3d5821a2aaa4da076c76373b100968708ba670744790d60220fecf3aeb3b" }, "downloads": -1, "filename": "propdb-0.1.1.zip", "has_sig": false, "md5_digest": "4dab0f137f60cb574ee75f8aeacb0a85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7873, "upload_time": "2014-02-10T01:22:45", "url": "https://files.pythonhosted.org/packages/9a/e3/788b25b93be86c498bbd999370bb7807692f2ad32b1bd7155c5cae8ac5b5/propdb-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "47bd271d7c84c1b2a3866bc100f35298", "sha256": "a2349e8b789ba51d753c18a9669eb2f821e5ad40526fa95fb3b070d99bdc0034" }, "downloads": -1, "filename": "propdb-0.1.2.zip", "has_sig": false, "md5_digest": "47bd271d7c84c1b2a3866bc100f35298", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7935, "upload_time": "2014-02-10T04:10:05", "url": "https://files.pythonhosted.org/packages/e4/b0/5d18a91702d2f25e0bfac289fd127f04756a5aa15704130485c708708910/propdb-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "508d93e7c946075f509597c804f8d352", "sha256": "de8f2e7e15d16f9eafb163ed93e34e35566389c3d6886144950926c165b6cadb" }, "downloads": -1, "filename": "propdb-0.1.3.zip", "has_sig": false, "md5_digest": "508d93e7c946075f509597c804f8d352", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9695, "upload_time": "2014-02-10T20:28:36", "url": "https://files.pythonhosted.org/packages/b4/32/df969573a1dba84a1e609d2e6f64230429260799ddf7e3c5ec2f3867fcc6/propdb-0.1.3.zip" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "103c9dfccf3fb39884c49085109ceea3", "sha256": "0c1e6870bf6df04a14cc9ce12ea0e697a3298431bb1d8ec43be83d3e1f1a60e5" }, "downloads": -1, "filename": "propdb-0.1.4.zip", "has_sig": false, "md5_digest": "103c9dfccf3fb39884c49085109ceea3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13674, "upload_time": "2014-02-12T05:16:29", "url": "https://files.pythonhosted.org/packages/12/81/221e218b10b7b2a43fc3de2a8933868054f900629d0eac56e94a2d04b1cd/propdb-0.1.4.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b4556d9d48d88aeb1cc32d270c17de48", "sha256": "212aaaaab67894c5cd553a2cba34390915ef04e36ae091e5151d0a588f1750a0" }, "downloads": -1, "filename": "propdb-0.2.0.zip", "has_sig": false, "md5_digest": "b4556d9d48d88aeb1cc32d270c17de48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18732, "upload_time": "2014-03-05T04:04:29", "url": "https://files.pythonhosted.org/packages/2b/93/cdf1eb2e24cfeadff89a02afdba0bf21981d5f3a6ffb20d5503dece024ec/propdb-0.2.0.zip" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "cc2c3516cb8dcd0c0539f1965939d422", "sha256": "275e537bddb504e8b9948474bdd861792443eaed7d3f05e09ec9e50cc681a725" }, "downloads": -1, "filename": "propdb-0.3.0.zip", "has_sig": false, "md5_digest": "cc2c3516cb8dcd0c0539f1965939d422", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21899, "upload_time": "2014-04-28T23:39:35", "url": "https://files.pythonhosted.org/packages/e1/54/07fb79bbab3b7e6a4579555f138f175579229a991be202d248b22d4f5261/propdb-0.3.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cc2c3516cb8dcd0c0539f1965939d422", "sha256": "275e537bddb504e8b9948474bdd861792443eaed7d3f05e09ec9e50cc681a725" }, "downloads": -1, "filename": "propdb-0.3.0.zip", "has_sig": false, "md5_digest": "cc2c3516cb8dcd0c0539f1965939d422", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21899, "upload_time": "2014-04-28T23:39:35", "url": "https://files.pythonhosted.org/packages/e1/54/07fb79bbab3b7e6a4579555f138f175579229a991be202d248b22d4f5261/propdb-0.3.0.zip" } ] }