{ "info": { "author": "Hengyue Li", "author_email": "hengyue.li@hengyue.li", "bugtrack_url": null, "classifiers": [], "description": "# PyDictFileEncy\n\nA simple API used to encrypt the python dict into a file using AES256. The interaction is between the file and memory directly(No decrypted file.tmp will be created). The encrypted data is saved by string in a file on the disc. If one were developing a single thread app, this can be used as encrypted \"SQL\".\nThis API is a collection of the answers on StackOverflow.\n\n\n## Install\n\n```\npip install pydictfileency\n```\n\n\n## Usage\nA (set of) python dict is collected in a \"container\" which will be operated directly.\n\n\n\n## example and API\n\n```\nfrom pydictfileency import PyDictFileEncy\n```\n\n\n\n\nCreate a container\n```\n#-----------------------------------------------------\n# create a new filedict (with password = 'password')\ncontainer = PyDictFileEncy('encrypted.dat','password')\ncontainer.connect()\n# a file is created. One can check the context in it.\n```\n\n\n\nConnect to it (verify password)\n```\n#-----------------------------------------------------\n# connect to a filedict\ncontainer = PyDictFileEncy('encrypted.dat','password')\ncontainer.connect()\nprint(container.IsConnected())\n# a filedict is connect. One can try another password.\n```\n\n\n\n\nCreate a table (a table is a python dict) \n```\n#-----------------------------------------------------\n# create a table\ncontainer = PyDictFileEncy('encrypted.dat','password')\ncontainer.connect()\ncontainer.CreateTableIfNotExist('testTable')\n# remenber to save it\ncontainer.Save()\n```\n\n\nShow all tables\n```\n#-----------------------------------------------------\n# get all the tables in container\ncontainer = PyDictFileEncy('encrypted.dat','password')\ncontainer.connect()\n# return a python dict 'dict_keys' type\nl = container.GetTableList()\nprint(l)\n```\n\n\nGet a python dict in the container. One can have operations on it.\n```\n#-----------------------------------------------------\n# get a normal python dict in the container so one can interact with it\ncontainer = PyDictFileEncy('encrypted.dat','password')\ncontainer.connect()\nd = container.GetTable('testTable')\nprint(type(d),d)\n# --- inser an element\nd['new'] = 'hellow'\n# remenber to save it\ncontainer.Save()\n```\n\nRemove a table\n```\n#-----------------------------------------------------\n# remove a table\ncontainer = PyDictFileEncy('encrypted.dat','password')\ncontainer.connect()\ncontainer.DropTable('testTable')\n# remenber to save it\ncontainer.Save()\n```\n\n\n\n\nReset a new password\n```\n#-----------------------------------------------------\n# reset password\ncontainer = PyDictFileEncy('encrypted.dat','password')\ncontainer.connect()\ncontainer.SetPassword('newpassword')\n# remenber to save it\ncontainer.Save()\n# the container itself is already renewed\nprint( container.IsConnected() )\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/HengyueLi/PyDictFileEncy", "keywords": "", "license": "LICENSE.md", "maintainer": "", "maintainer_email": "", "name": "pydictfileency", "package_url": "https://pypi.org/project/pydictfileency/", "platform": "", "project_url": "https://pypi.org/project/pydictfileency/", "project_urls": { "Homepage": "https://github.com/HengyueLi/PyDictFileEncy" }, "release_url": "https://pypi.org/project/pydictfileency/2018.11.181/", "requires_dist": null, "requires_python": "", "summary": "A simply API to encrypt the python dict and save it into a file.", "version": "2018.11.181" }, "last_serial": 4499179, "releases": { "2018.11.181": [ { "comment_text": "", "digests": { "md5": "a726d572aee56c874a7e1c1f96b77d98", "sha256": "b62a21f6e2dff2daa59c041969aebfbddbe4a0f0bf390d321d263979bd695932" }, "downloads": -1, "filename": "pydictfileency-2018.11.181.tar.gz", "has_sig": false, "md5_digest": "a726d572aee56c874a7e1c1f96b77d98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4317, "upload_time": "2018-11-18T07:33:07", "url": "https://files.pythonhosted.org/packages/58/77/f9f4864e83412e2a2f903c7bca7cf455fe1101ed9d81370c509391942500/pydictfileency-2018.11.181.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a726d572aee56c874a7e1c1f96b77d98", "sha256": "b62a21f6e2dff2daa59c041969aebfbddbe4a0f0bf390d321d263979bd695932" }, "downloads": -1, "filename": "pydictfileency-2018.11.181.tar.gz", "has_sig": false, "md5_digest": "a726d572aee56c874a7e1c1f96b77d98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4317, "upload_time": "2018-11-18T07:33:07", "url": "https://files.pythonhosted.org/packages/58/77/f9f4864e83412e2a2f903c7bca7cf455fe1101ed9d81370c509391942500/pydictfileency-2018.11.181.tar.gz" } ] }