{ "info": { "author": "Davydenko Myroslav", "author_email": "i@valsorym.com", "bugtrack_url": null, "classifiers": [], "description": "LordKey\n=======\n\nIt solves the problem of determining the combination in a sequence based on\nthe some alphabet with a given length, and use combination to determine the\niteration index.\n\n\nProblem\n-------\n\nThere are several elements to iterate - ``a``, ``b`` and ``c``. How many\npossible combinations for unique enumeration if key size is ``3``? Or, which\ncombination is at the tenth iteration? Or which iteration corresponds the\n``aca`` combination?\n\nFor `abc` alphabet and 3 key size can be created the next iterations::\n\n 0. aaa 1. aab 2. aac 3. aba 4. abb 5. abc\n 6. aca 7. acb 8. acc 9. baa 10. bab 11. bac\n 12. bba 13. bbb 14. bbc 15. bca 16. bcb 17. bcc\n 18. caa 19. cab 20. cac 21. cba 22. cbb 23. cbc\n 24. cca 25. ccb 26. ccc\n\nSo, the maximum number of iterations - ``27``, for ``10`` iteration corresponds\nto ``baa`` combination and the ``aca`` combination - it is ``7`` iteration.\n\n\nTheory\n------\n\nUse the arbitrary alphabet (set of available characters to create a key) and\nsize of key can be created a sequence of unique combinations, where each new\ncombination has its unique numeric index (from 0 to N - where the N is maximum\nnumber of possible combinations or infinity).\n\nIf specify the index (for example an ID in the table of database) - will be\nreturned the combination (key) for this index, and if specify combination -\nwill be returned it index.\n\nP.s. The sequence is not created - just calculate the data of a specified\nelement. This algorithm allows you to quickly get the result.\n\nExample::\n\n # INITIAL DATA\n # =================\n # Alphabet | abcde\n # ---------+-------\n # Key size | 3\n #\n # SEQUENCE\n # ==============================================\n # ID | 0 | 1 | 2 | ... | 122 | 123 | 124\n # ----+-----+-----+-----+-----+-----+-----+-----\n # Key | aaa | aab | aac | ... | eec | eed | eee\n\n lk = LordKey(alphabet='abcde', size=3)\n lk.get_key_by_id(122) # eec\n lk.get_id_by_key('ecc') # 122\n\nThe alphabet may be omitted then will be used value by default. If not set the\nsize value - key size can be from one char to infinity.\n\nExample::\n\n # Size not specified.\n lk = LordKey(alphabet='abc')\n lk.get_key_by_id(1) # b\n lk.get_key_by_id(10) # bab\n lk.get_key_by_id(100) # bacab\n lk.get_key_by_id(1000) # bbabaab\n lk.get_key_by_id(10000) # bbbcabbab\n lk.get_key_by_id(100000) # bcaacabbcab\n lk.get_key_by_id(1000000) # bcbccbacacaab\n lk.get_key_by_id(10000000) # caacbbaabbacbab", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/valsorym/lordkey/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "LordKey", "package_url": "https://pypi.org/project/LordKey/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/LordKey/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/valsorym/lordkey/" }, "release_url": "https://pypi.org/project/LordKey/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Detect the sequence element by identifier or the identifier by element of sequence.", "version": "0.0.3" }, "last_serial": 2306126, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "0a1495461336dacb9e753aaf9f25385f", "sha256": "180c8e43e54e45c97e18b992e7a2492c1bcaba26ca72835412f85b96748c2557" }, "downloads": -1, "filename": "LordKey-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0a1495461336dacb9e753aaf9f25385f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4134, "upload_time": "2016-08-26T05:38:49", "url": "https://files.pythonhosted.org/packages/0b/a0/a3c33ad83d010f5345feed78302ae44dd93a29e8daf3c548ab509133608c/LordKey-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "168db0e680ab0972c6f2c129c10fc6f2", "sha256": "9c1d97f26245d1718dcdbbc3b2795f87f1d530838a97af7985fec3aecf31067a" }, "downloads": -1, "filename": "LordKey-0.0.3.tar.gz", "has_sig": false, "md5_digest": "168db0e680ab0972c6f2c129c10fc6f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4342, "upload_time": "2016-08-26T13:01:21", "url": "https://files.pythonhosted.org/packages/e9/2b/fde3d17306e7f819c76cd4765b9b959aa75be8c97ffb55fc90fd6e697a0e/LordKey-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "168db0e680ab0972c6f2c129c10fc6f2", "sha256": "9c1d97f26245d1718dcdbbc3b2795f87f1d530838a97af7985fec3aecf31067a" }, "downloads": -1, "filename": "LordKey-0.0.3.tar.gz", "has_sig": false, "md5_digest": "168db0e680ab0972c6f2c129c10fc6f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4342, "upload_time": "2016-08-26T13:01:21", "url": "https://files.pythonhosted.org/packages/e9/2b/fde3d17306e7f819c76cd4765b9b959aa75be8c97ffb55fc90fd6e697a0e/LordKey-0.0.3.tar.gz" } ] }