{ "info": { "author": "Pulkit Singh", "author_email": "pulkitsingh01@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "## dukepy\ncollection of useful python snippets\n\n`pip install dukepy`\n\n### config\nConfiuration manager (using json) with the ability to \n* add new keys\n* remove deprecated keys (i.e. keys not in defaults)\n* backup the older versions of the (json) configuration file\n\nGenerated sample file -\n\nC:\\Users\\xyz\\.myconfig\\config.json\n```json\n{\n \"newkey1\": \"newvalue1\",\n \"newkeygroup1\": {\n \"newkey2\": \"newvalue2\"\n },\n \"newkey3\": [\n \"newvalue4\",\n \"newvalue4\"\n ],\n \"newkey5\": \"newvalue5\"\n}\n```\n\nUsage example -\n```python\nimport os\n\nfrom dukepy.config import Config\n\nconfig_dir = os.path.join(os.path.expanduser(\"~\"), \".myconfig\")\nconfig_file = os.path.join(config_dir, \"config.json\")\nConfig(path=config_file, defaults={\n \"newkey1\": \"newvalue1\",\n \"newkeygroup1\": {\n \"newkey2\": \"newvalue2\"\n },\n \"newkey3\": [\"newvalue4\", \"newvalue4\"]\n})\n\nConfig()[\"newkey5\"] = \"newvalue5\"\nConfig().commit()\n```\n\n### converge\nTo find the extremes of a finite sequence, given that the sequence is continuous.\nProvide at least two known numbers in the sequence,\nand a method to check the validity of the number predicted by the algorithm.\n\nUsage example -\n```python\ndef check_validity(val):\n if val > -30 and val < 101:\n return True\n else:\n return False\n\n\nlow, high = Converge(-28, 50, check_validity).run()\nprint(low)\nprint(high)\n```\n\nOutput -\n```\n-29\n100\n```\n\n### dict_diff\n* To find the recursive differences between two dictionaries.\n* To update one dictionary with the other (each one optional)-\n * Add keys from the other\n * Remove keys which are not part of the other\n * Update values from the keys of the other\n\nUsage example -\n```python\ndictionary_1 = {\"abc\": \"value_abc\",\n \"prs\": \"value_prs\"}\n dictionary_2 = {\"abc\": \"value_abc\",\n \"xyz\": \"value_xyz\"}\n dict_diff(dictionary_1, dictionary_2)\n print(dictionary_1)\n print(dictionary_2)\n\n dict_diff(dictionary_1, dictionary_2,\n udpate_added_keys=True)\n\n print(dictionary_1)\n print(dictionary_2)\n```\n\nOutput -\n```\n:\n - prs : value_prs\n :\n + xyz : value_xyz\n{'abc': 'value_abc', 'prs': 'value_prs'}\n{'abc': 'value_abc', 'xyz': 'value_xyz'}\n :\n - prs : value_prs\n :\n + xyz : value_xyz\n{'abc': 'value_abc', 'prs': 'value_prs', 'xyz': 'value_xyz'}\n{'abc': 'value_abc', 'xyz': 'value_xyz'}\n```\n### logger\n### mail_bot\n### safe_dict\n### singleton\n### taces\nPrints the origin of the exception, not just the exception string.\nUsage example -\n```python\nmydict = dict()\n try:\n print(mydict[\"sdf\"])\n except Exception as e:\n print_exception_traces(e)\n```\n\nOutput -\n```\nTraceback (most recent call last):\n File \"C:/Dev/libpython/src/dukepy/traces.py\", line 16, in \n print(mydict[\"sdf\"])\nKeyError: 'sdf'\n```\n\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/duke79/libpython", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "dukepy", "package_url": "https://pypi.org/project/dukepy/", "platform": "", "project_url": "https://pypi.org/project/dukepy/", "project_urls": { "Homepage": "https://github.com/duke79/libpython" }, "release_url": "https://pypi.org/project/dukepy/1.3.0/", "requires_dist": [ "colorama", "pypiwin32", "Flask-SQLAlchemy" ], "requires_python": "", "summary": "A useful collection of utilities", "version": "1.3.0" }, "last_serial": 4424742, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d9c34de315adc3a50bdace46e9d83359", "sha256": "5cfd6f31d2d1d5f54e7310623dc5c69c71c92782663a0e3636fbfe6a5ee3f6a4" }, "downloads": -1, "filename": "dukepy-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d9c34de315adc3a50bdace46e9d83359", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13998, "upload_time": "2018-10-20T06:24:06", "url": "https://files.pythonhosted.org/packages/e5/0f/9b0cc112cbb02e17bc8675a53e3f604c064bc682cecb99e5e2ae20f953d5/dukepy-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2822c3a3bee5a28731e05e370d402b31", "sha256": "ec880da63a2e29ed0fd5108f3bd6ca2f81f610b2ddda6936ba514eb4d9f77b4d" }, "downloads": -1, "filename": "dukepy-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2822c3a3bee5a28731e05e370d402b31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10102, "upload_time": "2018-10-20T06:24:07", "url": "https://files.pythonhosted.org/packages/8c/99/5c0e11fd3ec368f1748445965fff60ec27a1ba40dc8538b730b66a7e9d9f/dukepy-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "53df6b8cc401d2776272420ab3e51718", "sha256": "58a2cdd34479a17951b65ec8b2fcadf3137adb5bff4eafb5b63f649263328ceb" }, "downloads": -1, "filename": "dukepy-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "53df6b8cc401d2776272420ab3e51718", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14002, "upload_time": "2018-10-20T06:35:54", "url": "https://files.pythonhosted.org/packages/ac/ab/36d3eccbd516a38fec1c5b3ba9e468e1cda784110f611978ff46aaa28295/dukepy-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16cee685af9d5c69ce2cd60672940672", "sha256": "7f20676e981f8605f825fabd266b1207533ee0a6041b38c76347ced99c73e6b6" }, "downloads": -1, "filename": "dukepy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "16cee685af9d5c69ce2cd60672940672", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10131, "upload_time": "2018-10-20T06:35:56", "url": "https://files.pythonhosted.org/packages/3e/c7/6ba14a5a4af4eb2c0829d09dda910c31a2f62accab2c48d87187e7866985/dukepy-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "e327ac5de4fd94f3561d60b3ca69952d", "sha256": "31e77af52f50b96bad014bd85d51128635564d9e15c7a5b2d32fe83f26c9b777" }, "downloads": -1, "filename": "dukepy-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e327ac5de4fd94f3561d60b3ca69952d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14106, "upload_time": "2018-10-20T06:50:51", "url": "https://files.pythonhosted.org/packages/02/73/75f97a4f267e63b1108b4ea9f24042ab8827336838af16d8ef620a13404e/dukepy-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fccd1770f2ea5b928aaecad3c4955f40", "sha256": "336fa04dd94c6e25c82fe8876ca81d7a52886889f45e5fadc6b3024f89e056de" }, "downloads": -1, "filename": "dukepy-0.0.3.tar.gz", "has_sig": false, "md5_digest": "fccd1770f2ea5b928aaecad3c4955f40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10202, "upload_time": "2018-10-20T06:50:52", "url": "https://files.pythonhosted.org/packages/42/41/b5376db861ca7481cfcef4a7b3819d60df6cc36ed162e9c7fc1871e6fe73/dukepy-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "629a8b396698ec04367e18e7eb8dc5e3", "sha256": "be14b654763d467b8c83d4d1b613bb354820bdf298379b52b7c4b6659c3cd886" }, "downloads": -1, "filename": "dukepy-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "629a8b396698ec04367e18e7eb8dc5e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14070, "upload_time": "2018-10-20T08:56:22", "url": "https://files.pythonhosted.org/packages/7a/b3/43ee4bab91d00e00419148c71489ac160f73ee160ee92f89f67423840736/dukepy-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1c2959ff7a1e4635ee0d3ecc606b01ff", "sha256": "c456542a4388af6a0b86a612c131bc4e71f6c1fdf6d88513810b4ed5363eaa7c" }, "downloads": -1, "filename": "dukepy-0.0.4.tar.gz", "has_sig": false, "md5_digest": "1c2959ff7a1e4635ee0d3ecc606b01ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10169, "upload_time": "2018-10-20T08:56:24", "url": "https://files.pythonhosted.org/packages/ff/ca/6c4dd427d2e83b75d128b0e1932b4e6933598865429588e6e03689cb180a/dukepy-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "96781cdc7e8e18e1aba7289ed3ac71a8", "sha256": "036259ed1fa9c9de77cbbb130f4ab4b817611640b406e7465398bf112146918f" }, "downloads": -1, "filename": "dukepy-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "96781cdc7e8e18e1aba7289ed3ac71a8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14119, "upload_time": "2018-10-20T09:09:37", "url": "https://files.pythonhosted.org/packages/87/86/2eb32218b5976523ec5d2ccfac6184c3bae57154265c8fb0578ad02f8267/dukepy-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fbc9c4fdeb927d34b24b247ddd674835", "sha256": "604885333afbc984018f7b596167fc6d05cb690d8cbda627ec2130cc4e1695bf" }, "downloads": -1, "filename": "dukepy-0.0.5.tar.gz", "has_sig": false, "md5_digest": "fbc9c4fdeb927d34b24b247ddd674835", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10212, "upload_time": "2018-10-20T09:09:38", "url": "https://files.pythonhosted.org/packages/de/d2/2b0cd323a2dc1e958592db5e8435a1895184f2dab6257c91ace479f6a758/dukepy-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "fb0430f196645816be72406ec5c2456c", "sha256": "46c4dc5c5441916e78eed2d93acc54804251ecd9f53b2e42b96462dadb804105" }, "downloads": -1, "filename": "dukepy-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "fb0430f196645816be72406ec5c2456c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14120, "upload_time": "2018-10-21T04:14:43", "url": "https://files.pythonhosted.org/packages/1e/a8/4acdfbae1a2ba1c471e7fe29be2e7c634914827e4cff4e253dc3fe0c0318/dukepy-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f8a6c964f6221e9292307e9379aa5a0a", "sha256": "c144e79792360bc7283c7bd198ae7dffeb6fb12f0b756c8cc8593874edc311d5" }, "downloads": -1, "filename": "dukepy-0.0.6.tar.gz", "has_sig": false, "md5_digest": "f8a6c964f6221e9292307e9379aa5a0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10244, "upload_time": "2018-10-21T04:14:44", "url": "https://files.pythonhosted.org/packages/a8/6f/7807f07598696cf3f6ba7a20ddb90092376bbd029246924299cb3d2c2e51/dukepy-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "a156a96eefe9ebcfbbd520f292e33a0f", "sha256": "787458fee2c81f3e0244ec86890ba79acb8690c42272cc64529d4298a20200c2" }, "downloads": -1, "filename": "dukepy-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "a156a96eefe9ebcfbbd520f292e33a0f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14113, "upload_time": "2018-10-21T04:19:20", "url": "https://files.pythonhosted.org/packages/94/78/c037cdd32dabff5caf7c0fac972ba990d4002a0fd5a0897fd894c7214279/dukepy-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "40c8f075f11ec9b5dec9fd9a2a310305", "sha256": "c8e0678e3010345829d9aaad9872726b3a377b66a98d396f110b53e056f81fa9" }, "downloads": -1, "filename": "dukepy-0.0.7.tar.gz", "has_sig": false, "md5_digest": "40c8f075f11ec9b5dec9fd9a2a310305", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10220, "upload_time": "2018-10-21T04:19:21", "url": "https://files.pythonhosted.org/packages/83/80/4fed8c24f35b13458e30e735ca7efec567bffa8511229db1700d00bd885b/dukepy-0.0.7.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "74823f1d368586c5d87905ac28b68aeb", "sha256": "822bd8d9ca92310ee76ed8ef60e4cfdf8672bd284f6dee79cb119661e6c0257a" }, "downloads": -1, "filename": "dukepy-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "74823f1d368586c5d87905ac28b68aeb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15357, "upload_time": "2018-10-21T08:35:18", "url": "https://files.pythonhosted.org/packages/9e/ce/e6e0a787dbee130f129f24b6b0627fcfe9fac733754b8d6d220f77973b52/dukepy-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db5e57f1ef658ed7124ac0a137bacdba", "sha256": "62ed955607ba165e0c43e47960f058979b6f75e9ef2e105b9020bf5358e3636a" }, "downloads": -1, "filename": "dukepy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "db5e57f1ef658ed7124ac0a137bacdba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11704, "upload_time": "2018-10-21T08:35:19", "url": "https://files.pythonhosted.org/packages/25/be/2b6f827d5b8cf6db2ff0372ddd36ba999a698812f5678316964daf3d6c5b/dukepy-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "c2a8d0ec47c5a649ab492f419d466134", "sha256": "d62d899feadded4abf12580b798a7531fa7efac56276a175cc242ddea295852e" }, "downloads": -1, "filename": "dukepy-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c2a8d0ec47c5a649ab492f419d466134", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18622, "upload_time": "2018-10-25T15:18:53", "url": "https://files.pythonhosted.org/packages/d6/79/da52eace1021cb076c4915251c8ffc8be4754be749f72244bfb3e95533ba/dukepy-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9fe7badda4170a80795bac7ff87d6a36", "sha256": "78512885ee2c78444560f7fdc85f81c1feb5e95f16380820d209e1a61c6f370a" }, "downloads": -1, "filename": "dukepy-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9fe7badda4170a80795bac7ff87d6a36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14646, "upload_time": "2018-10-25T15:18:55", "url": "https://files.pythonhosted.org/packages/01/28/cb43f81033be40d45acbe067ee510b0e9c33bb940f7de2dd140812608a6c/dukepy-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "8c830a10862405fa130c907a6dfc6e72", "sha256": "1b1cd49115d862990cc48436f1bdba82be10935e9cebe7b78cc0651ffba726d3" }, "downloads": -1, "filename": "dukepy-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8c830a10862405fa130c907a6dfc6e72", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19589, "upload_time": "2018-10-28T12:28:18", "url": "https://files.pythonhosted.org/packages/0c/53/c39acd4a1e38650ddf7d7b5e8f9cb020cc9f30c9a3dbd95335f0864c98b1/dukepy-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6cd3be01e0346e1c569994fe5558dbbf", "sha256": "d3c69dcb328297dec556bc455ae7d48d7f9e7d9bf04535e53969f9de4101bbe1" }, "downloads": -1, "filename": "dukepy-1.2.0.tar.gz", "has_sig": false, "md5_digest": "6cd3be01e0346e1c569994fe5558dbbf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15429, "upload_time": "2018-10-28T12:28:20", "url": "https://files.pythonhosted.org/packages/2b/01/2dc9e2ee3d8ca1b44cf142a6012718d019b514a1e098b35f98e0b7169eab/dukepy-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "51fe72e12a6da39ee7d9d7a493b97c86", "sha256": "34027be43d9ac6523b7aac09ff2cf46d6a12b8f89eacfea9cc6f6797db6b2aa9" }, "downloads": -1, "filename": "dukepy-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "51fe72e12a6da39ee7d9d7a493b97c86", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21836, "upload_time": "2018-10-28T16:37:50", "url": "https://files.pythonhosted.org/packages/8d/e6/c966ab0248c384c4dd13d52d5b4c5847404d87577bff84ec93de8457d681/dukepy-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7690adc0dca0b195cd7405b308d26225", "sha256": "6c92b93d353e1fddf6ae59d1e77653946da535416f0695da6f71367f5062463c" }, "downloads": -1, "filename": "dukepy-1.3.0.tar.gz", "has_sig": false, "md5_digest": "7690adc0dca0b195cd7405b308d26225", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17111, "upload_time": "2018-10-28T16:37:51", "url": "https://files.pythonhosted.org/packages/29/28/bf95262b49dbd1407444c5aec16f203979f2682aafda801ed0df88f95098/dukepy-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "51fe72e12a6da39ee7d9d7a493b97c86", "sha256": "34027be43d9ac6523b7aac09ff2cf46d6a12b8f89eacfea9cc6f6797db6b2aa9" }, "downloads": -1, "filename": "dukepy-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "51fe72e12a6da39ee7d9d7a493b97c86", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21836, "upload_time": "2018-10-28T16:37:50", "url": "https://files.pythonhosted.org/packages/8d/e6/c966ab0248c384c4dd13d52d5b4c5847404d87577bff84ec93de8457d681/dukepy-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7690adc0dca0b195cd7405b308d26225", "sha256": "6c92b93d353e1fddf6ae59d1e77653946da535416f0695da6f71367f5062463c" }, "downloads": -1, "filename": "dukepy-1.3.0.tar.gz", "has_sig": false, "md5_digest": "7690adc0dca0b195cd7405b308d26225", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17111, "upload_time": "2018-10-28T16:37:51", "url": "https://files.pythonhosted.org/packages/29/28/bf95262b49dbd1407444c5aec16f203979f2682aafda801ed0df88f95098/dukepy-1.3.0.tar.gz" } ] }