{ "info": { "author": "pierre-sassoulas", "author_email": "pierre.sassoulas@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# shadok\n\nA python library that permit to unleash the full efficiency of shadok's logic.\n\n* [Installation](https://github.com/Pierre-Sassoulas/shadok#installation)\n* [Usage](https://github.com/Pierre-Sassoulas/shadok#usage)\n* [FAQ](https://github.com/Pierre-Sassoulas/shadok#faq)\n\n## Installation\n\n```bash\npip3 install shadok\n```\n\n## Usage\n\n### ShadokInteger\n\nYou can create a `ShadokInteger` from an int or a string.\n\n```python\nfrom shadok import ShadokInteger\ni = ShadokInteger(\"BugaZoMeu\")\nj = ShadokInteger(56)\nk = ShadokInteger(\"\u25ff\")\nprint(i,j,k)\n#\u00a0\u2212\ud835\ude7e\u14a7\u25ff \u25ff\u14a7\ud835\ude7e \u25ff\nprint(int(i), int(j), int(k))\n# 75 56 3\nprint(i.pronunciation, j.pronunciation, k.pronunciation)\n# BuGaZoMeu MeuZoGa Meu\n```\n\nYou can't create a `ShadokInteger` from a string with multiple word. The following\ncode will raise an error. But the more you fail the closer you are to success :\n\n```python\nfrom shadok import ShadokInteger\nShadokInteger(\"Buga ZoMeu\")\n```\n\nWill get you the following error :\n\n```\nTraceback (most recent call last):\n File \"\", line 1, in \n File \"/home/shadok/shadok/shadok_integer.py\", line 14, in __init__\n % value\nshadok.path_to_success.ImproperShadokLogic: Cannot cast string containing\nmultiple words ('Buga ZoMeu') to an int.\n``` \n\n### ShadokString\n\nYou can create a `ShadokString` from a shadok sentences with multiple words\nseparated by spaces. If a word is an shadok integer you can get its value\nwith `int()`. `ShadokString` are string, it means you can create a\n`ShadokInteger` from one.\n\n```python\nfrom shadok import ShadokString\na = ShadokString(\"zogabuzomEu\")\nb = ShadokString(\"ZoGabuzoMeu\")\nc = ShadokString(\"Gabu\")\nc += \"\u25ff\u14a7\ud835\ude7e ZoMEU\" #\u00a0Mutlitple words\nprint(a,b,c)\n#\u00a0ZoGaBuZoMeu ZoGaBuZoMeu GaBu \u25ff\u14a7\ud835\ude7e ZoMeu\nprint(int(a), int(b)) #\u00a0c cannot be casted to int\n#\u00a0539 539\n```\n\nYou can't use improper shadok syntax in a `ShadokString` :\n\n```python\nfrom shadok import ShadokString\nShadokString(\"Gabu Gibi\")\n```\n\nWill get you the following error :\n\n```\nTraceback (most recent call last):\n File \"\", line 1, in \n File \"/home/shadok/shadok/shadok_string.py\", line 42, in __init__\n MagicFaucet.check_syntax(self.raw_string)\n File \"/home/shadok/shadok/magic_faucet.py\", line 42, in check_syntax\n raise ImproperShadokSyntax(word, matches)\nshadok.path_to_success.ImproperShadokSyntax:\nIncorrect shadok syntax in 'Gibi'\n ^^^^\nAu Goulp !\n```\n\nYou can also translate a ShadokString to french :\n\n```python\nimport itertools\nfrom shadok import ShadokString\nresult = lambda val:print(\"Translation of {} : {}\".format(val, ShadokString(val).translation))\nletters = [\"Ga\", \"Bu\", \"Zo\", \"Meu\"]\nfor a in letters:\n result(a)\nfor a, b in itertools.product(letters, letters):\n result(a+b)\nfor a,b,c in itertools.product(letters, letters, letters):\n result(a+b+c)\n```\n\nWill result in this output :\n\n```\nTranslation of Ga : {0, 'Moi', 'Int\u00e9rieur', 'Non'}\nTranslation of Bu : {1, 'Oui', 'Eau'}\nTranslation of Zo : {'Nouille', 2, 'Ext\u00e9rieur', 'Lui'}\nTranslation of Meu : {'Trou', 3}\nTranslation of GaGa : {0, 'Toi'}\nTranslation of GaBu : {1, 'Notion'}\nTranslation of GaZo : {2}\nTranslation of GaMeu : {3}\nTranslation of BuGa : {4, 'Petite pompe'}\nTranslation of BuBu : {5}\nTranslation of BuZo : {6}\nTranslation of BuMeu : {7}\nTranslation of ZoGa : {8}\nTranslation of ZoBu : {9}\nTranslation of ZoZo : {10}\nTranslation of ZoMeu : {11}\nTranslation of MeuGa : {12}\nTranslation of MeuBu : {13}\nTranslation of MeuZo : {14}\nTranslation of MeuMeu : {'Trous', 15}\nTranslation of GaGaGa : {0, \"Esp\u00e8ce d'imb\u00e9cile\"}\nTranslation of GaGaBu : {1}\nTranslation of GaGaZo : {2}\nTranslation of GaGaMeu : {3}\nTranslation of GaBuGa : {4}\nTranslation of GaBuBu : {5}\nTranslation of GaBuZo : {6}\nTranslation of GaBuMeu : {7}\nTranslation of GaZoGa : {8}\nTranslation of GaZoBu : {9}\nTranslation of GaZoZo : {10}\nTranslation of GaZoMeu : {11}\nTranslation of GaMeuGa : {12}\nTranslation of GaMeuBu : {13}\nTranslation of GaMeuZo : {14}\nTranslation of GaMeuMeu : {15}\nTranslation of BuGaGa : {16, 'Grosse pompe'}\n\n...\nTranslation of MeuMeuMeu : {63}\n```\n\n### MagicFaucet\n\nThe `MagicFaucet` permit to check if a string is in proper Shadok syntax :\n\n```python\nfrom shadok import MagicFaucet\n#\u00a0Proper syntax, nothing will happen\nMagicFaucet.check_syntax(\"GabuZo\")\n#\u00a0Will raise an ImproperShadokSyntax exception\nMagicFaucet.check_syntax(\"GabuZoMi\")\n```\n\nWill get you the following error :\n\n```\nTraceback (most recent call last):\n File \"\", line 1, in \n File \"/home/shadok/shadok/magic_faucet.py\", line 42, in check_syntax\n raise ImproperShadokSyntax(word, matches)\nshadok.path_to_success.ImproperShadokSyntax:\nIncorrect shadok syntax in 'GabuZoMi'\n ^^\nAu Goulp !\n```\n\nThe `MagicFaucet` also permit to pretty print your shadok without instantiation of a `ShadokString`:\n\n```\n>>> MagicFaucet.pretty_print(\"meumEumUumeu\")\n'MeuMeuMeuMeu'\n```\n\n## FAQ\n\n* I need to perform serious arithmetic operations on large numbers does this library provide that ?\n\nSadly the highest order of meta-bin yet attainable is only 31. Those are big very meta bins\nthough.\n\n* My empty meta bins are disappearing when I create a `ShadokInteger` ?!\nBut I need them if my number get bigger !\n\nStop reporting this issue. This is a feature not a bug ! You should create meta bins\nonly when you need them for efficiency. I don't care about your use case.\n\n* Why is `GaGaGaGaGaBu` becoming `Bu` when I cast it to `int` ?\n\nSee \"*My empty meta bins are disappearing*\".\n\n* My string was `Gagaga` and was casted to a boolean. It returned `False`, shouldn't it means\n`You fool !` and be `True` instead ?\n\nWhen evaluating a string containing only `Ga` you must ask yourself :\nwhy make a simple test when a complicated one will do ? The shadok logic tell us\nthat we need to cast to an int when evaluating a boolean value.\nWe must also get rid of the empty meta bins in integer. So `Gagaga` equals 0,\nequals `[False, \"You fool !\"]`. So when casted into a boolean you have 1 in 33\nchance that its equals to `False` and 1 in 2 chance that its equal to `\"You fool !\"`.\nIt could also be `True` but that would really be by chance and maybe by mistake.\n\n\n* Is there any side effect to using this library ?\n\nYes, for small operations, we're trying to rely on the new threshold required to be parent (`BuBu`).\nIf you're using the program before it was created and if the new reform\nis not yet effective, we can count to the old limit (`BuGa`) and create one or a\nfew millions shadok's eggs, if we're not careful. Please however note that for big operation\nthis help with performance because shadok can help with parallelism as soon as they hatch,\nso in this situation we're counting over 5 on purpose.\n\n* Can I run this in parallel ?\n\nSee question above, this is the default, but you need to count to **\u2212\u2212** first.\nIf you count to **\u2212\ud835\ude7e** or less why do you even want to run in parallel in the first\nplace ?\n\n* Do you count to **\u2212\ud835\ude7e** when you pretty print using MagicFaucet ?\n\nNo.\n\n* I get a `ColanderIsInFactABusError` when I instantiate my `Colander`...\n\nYour colander seems to be a pot, please make sure your pot has a handle and is\nnot, in fact, a bus.", "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/Pierre-Sassoulas/shadok", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "shadok", "package_url": "https://pypi.org/project/shadok/", "platform": "", "project_url": "https://pypi.org/project/shadok/", "project_urls": { "Homepage": "https://github.com/Pierre-Sassoulas/shadok" }, "release_url": "https://pypi.org/project/shadok/1.2.0/", "requires_dist": null, "requires_python": "", "summary": "Permit to unleash the full efficiency of shadok's logic in Python.", "version": "1.2.0" }, "last_serial": 5242894, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "040d046165ef91c12be0c2672bbec887", "sha256": "2991c6a332cf08e15db90036b21fa829bc74e348274324d63dc819d57f739c4c" }, "downloads": -1, "filename": "shadok-1.0.0.tar.gz", "has_sig": false, "md5_digest": "040d046165ef91c12be0c2672bbec887", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9394, "upload_time": "2019-05-07T22:11:48", "url": "https://files.pythonhosted.org/packages/7d/65/348d7f11ae4bda27f2ab1168a661159e295b9efc3d5d6c8f3d41df5beccf/shadok-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0aa996898dc5b7107b56660aaa4a41b6", "sha256": "28d39227e3123134f8e54a255ccda8c11a8662512f4ae7a8f19be12111c60fc4" }, "downloads": -1, "filename": "shadok-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0aa996898dc5b7107b56660aaa4a41b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9354, "upload_time": "2019-05-07T22:30:45", "url": "https://files.pythonhosted.org/packages/bf/b3/1a54594e9e5d6ab98d1ef71b83c684ee872b065c8b5a241f655b53c4957d/shadok-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "efc174cec9549404acfd43cbc919c4ce", "sha256": "262217be040b64bb796e58a0d07fbe9c825fe7eec66ce39ab2fa19d78ad69c31" }, "downloads": -1, "filename": "shadok-1.1.0.tar.gz", "has_sig": false, "md5_digest": "efc174cec9549404acfd43cbc919c4ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11112, "upload_time": "2019-05-08T12:27:21", "url": "https://files.pythonhosted.org/packages/17/ba/f885126c9abdbc746b29a9e9792a30bd5520018edfbfb2f9316479b9faa5/shadok-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "40d5b7f4dd739f899eef3ed53115a8c5", "sha256": "62c3d06226f2409d5b4241b6706575f122c64915d979474a2adfb924122d2eac" }, "downloads": -1, "filename": "shadok-1.1.1.tar.gz", "has_sig": false, "md5_digest": "40d5b7f4dd739f899eef3ed53115a8c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11276, "upload_time": "2019-05-08T12:41:17", "url": "https://files.pythonhosted.org/packages/8f/82/29bff9c32832fb86a09ccf78b1f1c47f23f8bcd1505d2c0dcfa0d525fcfa/shadok-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "8df0acab1368eb8f0c30566c4a64c6b3", "sha256": "efd4ce1e19c32d1bff7b8e828ae7f34af0fbd6d4b2aaf9749a5e470fc84b929b" }, "downloads": -1, "filename": "shadok-1.2.0.tar.gz", "has_sig": false, "md5_digest": "8df0acab1368eb8f0c30566c4a64c6b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12699, "upload_time": "2019-05-08T13:37:33", "url": "https://files.pythonhosted.org/packages/ed/d8/d1fe2820003ea32702107320bbfe799406cf62a1443cfadbbbd927c526c2/shadok-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8df0acab1368eb8f0c30566c4a64c6b3", "sha256": "efd4ce1e19c32d1bff7b8e828ae7f34af0fbd6d4b2aaf9749a5e470fc84b929b" }, "downloads": -1, "filename": "shadok-1.2.0.tar.gz", "has_sig": false, "md5_digest": "8df0acab1368eb8f0c30566c4a64c6b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12699, "upload_time": "2019-05-08T13:37:33", "url": "https://files.pythonhosted.org/packages/ed/d8/d1fe2820003ea32702107320bbfe799406cf62a1443cfadbbbd927c526c2/shadok-1.2.0.tar.gz" } ] }