{ "info": { "author": "muodov", "author_email": "muodov@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python" ], "description": "[![Build Status](https://travis-ci.org/muodov/kociemba.svg?branch=master)](https://travis-ci.org/muodov/kociemba)\n\n# kociemba\nThis Python package contains two equivalent implementations (in C and Python) of Herbert Kociemba's two-phase algorithm for solving Rubik's Cube.\nOriginal Java implementation can be found here: http://kociemba.org/download.htm.\n\nThese ports are pretty straightforward (not to say dumb) and most probably can be optimized. But they have been extensively tested in our Rubik's cube solving machines ([FAC System Solver](https://blog.zok.pw/hacking/2015/08/18/fac-rubik-solver/) and [Meccano Rubik's Shrine](http://blog.zok.pw/hacking/2016/08/12/meccano-rubiks-shrine/)), so be confident the algorithm is working.\n\n**NB** please note that two-phase algorithm does not guarantee that the produced solution is the shortest possible. Instead, it gives you a \"good enough\" solution in a very short time. You can implement additional checks on top of this library, for example, to not produce any moves if the cube is already solved. \n\n## Installation\nThis package is published on PyPI and can be installed with:\n\n```$ pip install kociemba```\n\nIt was tested under Python 2.7 and 3.3+.\n\n### Unix-based systems\n\nYou might need to install libffi system library beforehand. For example, on Debian-based distributions (e.g. Raspbian) you would run `sudo apt-get install libffi-dev`.\n\n### Windows\n\nLibrary should work on Windows, however it is not automatically tested at this moment: Travis CI [doesn't have windows support](https://github.com/travis-ci/travis-ci/issues/2104).\n\nNormal `pip install kociemba` (or `pip3 install kociemba` for Python 3.3+) should work, but you will need to install free build tools from Microsoft first. Check the following links:\n\n- for Python 2.7: https://www.microsoft.com/en-us/download/details.aspx?id=44266\n- for Python 3: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017\n\n## Usage\n\nThe package exposes just one function ```solve()```, which accepts a cube definition string and returns a solution string in standard notation (see below).\nOptional second argument allows solving to a specific pattern.\n\n```python\n>>> import kociemba\n\n>>> kociemba.solve('DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD')\nu\"D2 R' D' F2 B D R2 D2 R' F2 D' F2 U' B2 L2 U2 D R2 U\"\n\n>>> kociemba.solve('FLBUULFFLFDURRDBUBUUDDFFBRDDBLRDRFLLRLRULFUDRRBDBBBUFL', 'BBURUDBFUFFFRRFUUFLULUFUDLRRDBBDBDBLUDDFLLRRBRLLLBRDDF')\nu\"R' D2 R' U2 R F2 D B2 U' R F' U R2 D L2 D' B2 R2 B2 U' B2\"\n```\n\n## Standalone tool\nWhen installing with pip, `kociemba` will also register a command line tool with the same name. So you can also use it like this:\n\n```$ kociemba ```\n\n## Cube string notation\nThe names of the facelet positions of the cube (letters stand for Up, Left, Front, Right, Back, and Down):\n```\n |************|\n |*U1**U2**U3*|\n |************|\n |*U4**U5**U6*|\n |************|\n |*U7**U8**U9*|\n |************|\n ************|************|************|************\n *L1**L2**L3*|*F1**F2**F3*|*R1**R2**R3*|*B1**B2**B3*\n ************|************|************|************\n *L4**L5**L6*|*F4**F5**F6*|*R4**R5**R6*|*B4**B5**B6*\n ************|************|************|************\n *L7**L8**L9*|*F7**F8**F9*|*R7**R8**R9*|*B7**B8**B9*\n ************|************|************|************\n |************|\n |*D1**D2**D3*|\n |************|\n |*D4**D5**D6*|\n |************|\n |*D7**D8**D9*|\n |************|\n```\n\nA cube definition string \"UBL...\" means that in position U1 we have the U-color, in position U2 we have the\nB-color, in position U3 we have the L color etc. according to the order `U1`, `U2`, `U3`, `U4`, `U5`, `U6`, `U7`, `U8`, `U9`, `R1`, `R2`,\n`R3`, `R4`, `R5`, `R6`, `R7`, `R8`, `R9`, `F1`, `F2`, `F3`, `F4`, `F5`, `F6`, `F7`, `F8`, `F9`, `D1`, `D2`, `D3`, `D4`, `D5`, `D6`, `D7`, `D8`, `D9`, `L1`, `L2`, `L3`, `L4`,\n`L5`, `L6`, `L7`, `L8`, `L9`, `B1`, `B2`, `B3`, `B4`, `B5`, `B6`, `B7`, `B8`, `B9`.\n\nSo, for example, a definition of a solved cube would be `UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB`\n\nSolution string consists of space-separated parts, each of them represents a single move:\n* A single letter by itself means to turn that face clockwise 90 degrees.\n* A letter followed by an apostrophe means to turn that face counterclockwise 90 degrees.\n* A letter with the number 2 after it means to turn that face 180 degrees.\n\ne.g. **`R U R\u2019 U R U2 R\u2019 U`**\n\n## C version\nC sources reside in the `ckociemba` folder. Running `make` inside this directory will compile a standalone binary. It accepts a cube representation as a command line argument, and writes the solution to the standard output. You can, of course, use `ckociemba` sources directly in your projects.\n\n## Performance\nWhen possible, `kociemba` will use C implementation under the hood. If something goes wrong (C version cannot be imported) it will automatically fall back to pure-Python implementation. However, it will be much slower.\n\n\n## Testing\nTo run the tests, clone the repository and run:\n\n```$ python setup.py test```\n\n## Thanks to\n\n- @jarheadjoe for his contribution to Windows support\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/muodov/kociemba", "keywords": "kociemba rubik cube solver twophase", "license": "GPLv2", "maintainer": "", "maintainer_email": "", "name": "kociemba", "package_url": "https://pypi.org/project/kociemba/", "platform": "", "project_url": "https://pypi.org/project/kociemba/", "project_urls": { "Homepage": "https://github.com/muodov/kociemba" }, "release_url": "https://pypi.org/project/kociemba/1.2.1/", "requires_dist": [ "cffi (>=1.0.0)", "future" ], "requires_python": "", "summary": "Python/C implementation of Herbert Kociemba's Two-Phase algorithm for solving Rubik's Cube", "version": "1.2.1" }, "last_serial": 5450125, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "f0250c9b972842e4fef374e2e360e264", "sha256": "d6c2448dbe83c1dffe701204f7da88afcdcc8b9a16e23c70346ff1bbbf758812" }, "downloads": -1, "filename": "kociemba-1.0.2-cp27-none-macosx_10_10_x86_64.whl", "has_sig": false, "md5_digest": "f0250c9b972842e4fef374e2e360e264", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6771451, "upload_time": "2015-12-23T23:59:09", "url": "https://files.pythonhosted.org/packages/8d/c0/f7912fb85467a61079f7c57e7ac0467ead65c00bf10de87af36c266978c4/kociemba-1.0.2-cp27-none-macosx_10_10_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a2f5c9b9aa8700d899ee87a648e056b9", "sha256": "fc5b9a8988f84dc62d7bec10ab8a573df5b2799093c5a9fce94c8c2ad48ba950" }, "downloads": -1, "filename": "kociemba-1.0.2-cp35-cp35m-macosx_10_11_x86_64.whl", "has_sig": false, "md5_digest": "a2f5c9b9aa8700d899ee87a648e056b9", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 6755551, "upload_time": "2015-12-27T21:30:50", "url": "https://files.pythonhosted.org/packages/df/a5/8534a52e4b3fa525bb3f44563e187652c9a42ae71b91a354ac122678d38f/kociemba-1.0.2-cp35-cp35m-macosx_10_11_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "f3a2ccf24dd41ce0517de4848c673e95", "sha256": "8f33b082473006128f4691eadd4f4603940e9002ead482de3fbf8398159d5dbc" }, "downloads": -1, "filename": "kociemba-1.0.2-py2.7-linux-x86_64.egg", "has_sig": false, "md5_digest": "f3a2ccf24dd41ce0517de4848c673e95", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 6801175, "upload_time": "2015-12-24T14:42:53", "url": "https://files.pythonhosted.org/packages/ac/da/4bc985460e3fd3d82ce5518ee784584ee09b6ab1d5dc08e796ce742f3621/kociemba-1.0.2-py2.7-linux-x86_64.egg" }, { "comment_text": "", "digests": { "md5": "02352a4a4ae0b1b0ad8aa42c90b246b3", "sha256": "ba16e89168519c8a2bf47600b9df7fce0482cfc29b7788672124e3c2e3b6c67b" }, "downloads": -1, "filename": "kociemba-1.0.2.tar.gz", "has_sig": false, "md5_digest": "02352a4a4ae0b1b0ad8aa42c90b246b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9291281, "upload_time": "2015-12-23T23:58:31", "url": "https://files.pythonhosted.org/packages/18/2a/eb6ef41adf3bac06d43922ca93cbba625a0c58989928c1af532d9bb0284b/kociemba-1.0.2.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "79bd9c7322810b4f47992bb09331b3cc", "sha256": "02f71bd5396a5d657d3546c7340e51767f69663a8391af7f446dd1f0ab8b934c" }, "downloads": -1, "filename": "kociemba-1.1.tar.gz", "has_sig": false, "md5_digest": "79bd9c7322810b4f47992bb09331b3cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6599475, "upload_time": "2016-06-06T16:27:43", "url": "https://files.pythonhosted.org/packages/5b/f6/c676a86a7bd0ad8067df21e2c4fcb51dabd991c09d075b1a25206b205942/kociemba-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "5838890dc0718752f223b4bde1e7ae64", "sha256": "6da489c2dd1043b2d4aa17f2be1623c432fbcc033ba1d4c3a02ff015e9b20531" }, "downloads": -1, "filename": "kociemba-1.2-cp27-cp27m-macosx_10_13_x86_64.whl", "has_sig": false, "md5_digest": "5838890dc0718752f223b4bde1e7ae64", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 6760955, "upload_time": "2018-03-18T23:07:16", "url": "https://files.pythonhosted.org/packages/21/22/f869e85780967f70415acca49afab1ad754896ac50e6742a049cb6275a1b/kociemba-1.2-cp27-cp27m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "b741a9deabb0515c0ced088e6522209a", "sha256": "9445e2af0a6adcfbe9128b441993988c5be6e9922d4f816d29495895281f0900" }, "downloads": -1, "filename": "kociemba-1.2-cp27-cp27m-win32.whl", "has_sig": false, "md5_digest": "b741a9deabb0515c0ced088e6522209a", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 6755608, "upload_time": "2018-03-18T23:07:23", "url": "https://files.pythonhosted.org/packages/00/82/c001494ef1aca9a97cbd1ed801b7f5c76cd0e43eea8db13c8779680f3290/kociemba-1.2-cp27-cp27m-win32.whl" }, { "comment_text": "", "digests": { "md5": "03ada0044cbd33ec1b0f8672884ce7d0", "sha256": "bfad73cdc1d3ef4578bce0e0a40559610d2d0a873d5d08a13255eec9346890b5" }, "downloads": -1, "filename": "kociemba-1.2-cp36-cp36m-macosx_10_13_x86_64.whl", "has_sig": false, "md5_digest": "03ada0044cbd33ec1b0f8672884ce7d0", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 6761024, "upload_time": "2018-03-18T23:07:31", "url": "https://files.pythonhosted.org/packages/44/1f/435d52fa21d6e9fd6375d0bdec70fa5896deebb859cb4fbd4c39c1331288/kociemba-1.2-cp36-cp36m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "af1928380894cae4459cc30505a240f6", "sha256": "a79f01e24b0edb1798f8dc342bf68ca77f45c4ef8fc22118d6a11aa57dde284c" }, "downloads": -1, "filename": "kociemba-1.2-cp36-cp36m-win32.whl", "has_sig": false, "md5_digest": "af1928380894cae4459cc30505a240f6", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 6758202, "upload_time": "2018-03-18T23:07:39", "url": "https://files.pythonhosted.org/packages/2f/da/a48ca779bfe4682f31e86271c594b66d3f347e6aab58bbda5e6ceb8fbfb8/kociemba-1.2-cp36-cp36m-win32.whl" }, { "comment_text": "", "digests": { "md5": "f2e5a057e7732e14c9781b1673cf14eb", "sha256": "52115ba37737b14ba1574725ecb75ff2053eeef5de1e6e64806e33504c266006" }, "downloads": -1, "filename": "kociemba-1.2.tar.gz", "has_sig": false, "md5_digest": "f2e5a057e7732e14c9781b1673cf14eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6603405, "upload_time": "2018-03-18T23:07:46", "url": "https://files.pythonhosted.org/packages/8f/57/8a25250dd75fd7db838bea71428570a955197644ce680c32c6ecb24a130b/kociemba-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "ba506f79828c5da7c2665b5e30ea8abe", "sha256": "80aecdc3a6c9030832b1d548b4be77ecf08c355928b32d3b3479971fd87e02c4" }, "downloads": -1, "filename": "kociemba-1.2.1-cp37-cp37m-macosx_10_14_x86_64.whl", "has_sig": false, "md5_digest": "ba506f79828c5da7c2665b5e30ea8abe", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 6768352, "upload_time": "2019-06-26T08:01:54", "url": "https://files.pythonhosted.org/packages/3d/ee/7bd040750df84c44e8448ebbf9ee222b8f0d41251d8f81ee641b45e0a49d/kociemba-1.2.1-cp37-cp37m-macosx_10_14_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "6217be73e71c428b7231e011bf6e377a", "sha256": "b77435d7b0e93e9c7963e487e8cc3820540bd1c9bb9fe5665999d3a8deac9ee6" }, "downloads": -1, "filename": "kociemba-1.2.1.tar.gz", "has_sig": false, "md5_digest": "6217be73e71c428b7231e011bf6e377a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6605709, "upload_time": "2019-06-26T08:02:48", "url": "https://files.pythonhosted.org/packages/b3/b6/3fe5719527e4691aaa7da5e74426f62e71e833767d8a8b9d48b5f3cbb9fb/kociemba-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ba506f79828c5da7c2665b5e30ea8abe", "sha256": "80aecdc3a6c9030832b1d548b4be77ecf08c355928b32d3b3479971fd87e02c4" }, "downloads": -1, "filename": "kociemba-1.2.1-cp37-cp37m-macosx_10_14_x86_64.whl", "has_sig": false, "md5_digest": "ba506f79828c5da7c2665b5e30ea8abe", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 6768352, "upload_time": "2019-06-26T08:01:54", "url": "https://files.pythonhosted.org/packages/3d/ee/7bd040750df84c44e8448ebbf9ee222b8f0d41251d8f81ee641b45e0a49d/kociemba-1.2.1-cp37-cp37m-macosx_10_14_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "6217be73e71c428b7231e011bf6e377a", "sha256": "b77435d7b0e93e9c7963e487e8cc3820540bd1c9bb9fe5665999d3a8deac9ee6" }, "downloads": -1, "filename": "kociemba-1.2.1.tar.gz", "has_sig": false, "md5_digest": "6217be73e71c428b7231e011bf6e377a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6605709, "upload_time": "2019-06-26T08:02:48", "url": "https://files.pythonhosted.org/packages/b3/b6/3fe5719527e4691aaa7da5e74426f62e71e833767d8a8b9d48b5f3cbb9fb/kociemba-1.2.1.tar.gz" } ] }