{ "info": { "author": "John E. Barham", "author_email": "jbarham@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.5", "Topic :: System :: Filesystems" ], "description": "Overview\r\n ========\r\n \r\n Cdblib contains classes to read and write cdb (\"constant database\") files.\r\n \r\n Cdb files map string keys to string values with very fast record lookups.\r\n Cdblib also allows for in-memory indexes to enable even faster lookups.\r\n \r\n See http://cr.yp.to/cdb.html on D. J. Bernstein's site for the original\r\n specification.\r\n \r\n Installation\r\n ============\r\n \r\n Cdblib requires Python 2.5.\r\n \r\n The cdblib package contains a C extension module for speedups, but its use\r\n is not required and makes no difference to the interfaces exposed (except of\r\n course for speed).\r\n \r\n To install with the C extension module for speed, run::\r\n \r\n # python setup.py install\r\n \r\n Alternatively, you can simply copy the file cdblib.py to somewhere in your\r\n PYTHONPATH (but this will not include the speedups from the C extension).\r\n \r\n Example Usage\r\n =============\r\n \r\n Create a new CDB (or update an existing one):\r\n \r\n >>> from cdblib import CDB, CDBWriter\r\n >>> wcdb = CDBWriter(\"presidents.cdb\") # Create a new CDB file.\r\n >>> wcdb[\"Reagan\"] = \"1981 - 1988\"\r\n >>> wcdb[\"Bush\"] = \"1989 - 1992\"\r\n >>> wcdb[\"Clinton\"] = \"1993 - 2000\"\r\n >>> wcdb[\"Bush\"] = \"2001 - 2008\" # Creates a second record with the key \"Bush\".\r\n >>> wcdb[\"Bush\"] # Return the first record with key \"Bush\".\r\n '1989 - 1992'\r\n >>> wcdb.getall(\"Bush\") # Return all records with the key \"Bush\".\r\n ['1989 - 1992', '2001 - 2008']\r\n >>> wcdb[\"Clinton\"]\r\n '1993 - 2000'\r\n >>> wcdb.getall(\"Clinton\")\r\n ['1993 - 2000']\r\n >>> wcdb[\"Gore\"] # Oops, the CDB doesn't contain the key \"Gore\".\r\n Traceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"cdblib.py\", line 135, in __getitem__\r\n raise KeyError(key)\r\n KeyError: 'Gore'\r\n >>> wcdb.get(\"Gore\", \"Bush\") # Return \"Bush\" if the key \"Gore\" doesn't exist.\r\n 'Bush'\r\n >>> wcdb.close() # Close the CDB file and prevent any more writes.\r\n \r\n Open an existing CDB read-only:\r\n \r\n >>> rcdb = CDB(\"presidents.cdb\") # Re-open the saved CDB file read-only.\r\n >>> rcdb[\"Clinton\"]\r\n '1993 - 2000'\r\n >>> rcdb.close()\r\n >>> rcdb = CDB(\"presidents.cdb\", load_index=True) # Load the CDB index into memory for faster lookups.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "cdb constant database", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cdblib", "package_url": "https://pypi.org/project/cdblib/", "platform": "All", "project_url": "https://pypi.org/project/cdblib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/cdblib/0.5/", "requires_dist": null, "requires_python": null, "summary": "Read and write cdb (\"constant database\") files", "version": "0.5" }, "last_serial": 787291, "releases": { "0.5": [ { "comment_text": "", "digests": { "md5": "cabafb9b9aa8e1ec1cd5f7fd5211f076", "sha256": "95abd49ce3030dd138e689fec4037fa9a25e8d9bb70e230499c5cf0601dc3e38" }, "downloads": -1, "filename": "cdblib-0.5.zip", "has_sig": false, "md5_digest": "cabafb9b9aa8e1ec1cd5f7fd5211f076", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9644, "upload_time": "2009-06-20T06:54:32", "url": "https://files.pythonhosted.org/packages/c9/a9/470a1f80f6838c143d2b2e195aea040b0084d131b20fdff3099feea0e02e/cdblib-0.5.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cabafb9b9aa8e1ec1cd5f7fd5211f076", "sha256": "95abd49ce3030dd138e689fec4037fa9a25e8d9bb70e230499c5cf0601dc3e38" }, "downloads": -1, "filename": "cdblib-0.5.zip", "has_sig": false, "md5_digest": "cabafb9b9aa8e1ec1cd5f7fd5211f076", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9644, "upload_time": "2009-06-20T06:54:32", "url": "https://files.pythonhosted.org/packages/c9/a9/470a1f80f6838c143d2b2e195aea040b0084d131b20fdff3099feea0e02e/cdblib-0.5.zip" } ] }