{ "info": { "author": "Simeon Visser", "author_email": "simeonvisser@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Games/Entertainment :: Puzzle Games" ], "description": "crossword\n =========\n \n .. image:: https://pypip.in/version/crossword/badge.svg\n :target: https://pypi.python.org/pypi/crossword/\n :alt: Latest Version\n \n .. image:: https://pypip.in/download/crossword/badge.svg\n :target: https://pypi.python.org/pypi/crossword/\n :alt: Downloads\n \n .. image:: https://pypip.in/py_versions/crossword/badge.svg\n :target: https://pypi.python.org/pypi/crossword/\n :alt: Supported Python versions\n \n .. image:: https://pypip.in/license/crossword/badge.svg\n :target: https://pypi.python.org/pypi/crossword/\n :alt: License\n \n Python library for handling crossword puzzles. This library provides a canonical data structure\n that can be used to represent crosswords in your application. It provides a Pythonic way to\n perform common operations on the grid, the words and the clues of the puzzle.\n \n The library is intended for American crossword style puzzles, such as the New York Times\n crossword, though variations within reason will also be supported.\n \n The library handles reading and writing the following files:\n \n * Across Lite .puz files\n * ipuz .ipuz files\n \n \n Installation\n ------------\n \n You can install using pip:\n \n .. code-block:: bash\n \n $ pip install crossword\n \n \n Creating and modifying crosswords\n ---------------------------------\n \n You can create a crossword:\n \n .. code:: python\n \n from crossword import Crossword\n \n puzzle = Crossword(15, 15)\n \n You can iterate over rows and cells:\n \n .. code:: python\n \n for row in puzzle:\n for cell in row:\n pass\n \n You also iterate using 'cells' (left-to-right, top-to-bottom):\n \n .. code:: python\n \n for x, y in puzzle.cells:\n print(puzzle[x, y])\n \n You can store cell content by using attributes such as 'cell' and 'solution':\n \n .. code:: python\n \n puzzle[x, y].cell = \" \"\n puzzle[x, y].solution = \"A\"\n puzzle[x, y].style = {'background-color': 'red'}\n \n You can access a metadata attribute:\n \n .. code:: python\n \n creator = puzzle.meta.creator\n \n Each puzzle has the attributes specified in the Dublin Core Metadata Element Set,\n Version 1.1, which include creator, date, description, identifier and title. By default\n these attributes have the value None.\n \n You can iterate over metadata:\n \n .. code:: python\n \n for key, value in puzzle.meta():\n print(key, value)\n \n You can set a clue for an entry:\n \n .. code:: python\n \n puzzle.clues.across[1] = \"This is a clue\"\n puzzle.clues.down[2] = \"This is a clue\"\n \n You can iterate over all clues (first Across, then Down):\n \n .. code:: python\n \n for direction, number, clue in puzzle.clues.all():\n print(direction, number, clue)\n \n You can iterate over clues in a particular direction:\n \n .. code:: python\n \n for number, clue in puzzle.clues.across():\n print(number, clue)\n for number, clue in puzzle.clues.down():\n print(number, clue)\n \n By default these functions iterate over the clues by numerical order\n of the specified clue numbers. If you wish to iterate over the clues in the\n order that they were inserted you can specify sort=None:\n \n .. code:: python\n \n puzzle.clues.all(sort=None)\n \n You can also specify a function yourself that will be used for sorting:\n \n .. code:: python\n \n puzzle.clues.all(sort=lambda entry: ...)\n \n You can use the following attributes as dictionaries (e.g., for conversion to JSON):\n \n .. code:: python\n \n puzzle.content (the cells, clues and metadata in one dictionary)\n puzzle.clues\n puzzle.clues.across\n puzzle.clues.down\n puzzle.meta\n \n You can use the following constants for values that represent block cells and empty cells:\n \n .. code:: python\n \n puzzle.block\n puzzle.empty\n \n A value of None may indicate that the default value is used (e.g., \"#\" for blocks in\n .ipuz puzzles).\n \n Reading and writing crosswords\n ------------------------------\n \n You can read a crossword from an .ipuz file using:\n \n .. code:: python\n \n with open('puzzle.ipuz') as puzzle_file:\n ipuz_dict = ipuz.read(puzzle_file.read()) # may raise ipuz.IPUZException\n \n puzzle = crossword.from_ipuz(ipuz_dict)\n \n This requires the \"ipuz\" package to be installed: https://pypi.python.org/pypi/ipuz.\n \n You can write a crossword to an .ipuz file using:\n \n .. code:: python\n \n ipuz_dict = crossword.to_ipuz(puzzle)\n \n with open('puzzle.ipuz', 'w') as puzzle_file:\n puzzle_file.write(ipuz.write(ipuz_dict))\n \n \n Contributing\n ------------\n \n Contributions are very welcome. If you've found an issue or if you'd like to\n suggest a feature please open a ticket at: https://github.com/svisser/crossword/issues.\n \n You should create a virtual environment first before installing the\n packages as described below. This keeps the dependencies separate from other Python packages\n on your system. See: https://pypi.python.org/pypi/virtualenv and, optionally,\n https://pypi.python.org/pypi/virtualenvwrapper.\n \n You can install the packages needed for developing and testing this library by running:\n \n .. code-block:: bash\n \n $ pip install -r dev-requirements.txt\n \n There are also various tests included. You can run these with:\n \n .. code-block:: bash\n \n $ tox\n \n This will run the tests in various Python versions to ensure that the library\n works properly in each of them.\n \n Ideas for new features\n ----------------------\n \n * Add support for Crossword Compiler .ccw files (http://crossword-compiler.com)\n * Add support for CrossDown .xwd files (http://www.crossdown.com/)\n * Add support for XPF files (http://www.xwordinfo.com/XPF/)", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/svisser/crossword", "keywords": "crossword puzzle ipuz puz", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "crossword", "package_url": "https://pypi.org/project/crossword/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/crossword/", "project_urls": { "Homepage": "https://github.com/svisser/crossword" }, "release_url": "https://pypi.org/project/crossword/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Python library for handling crossword puzzles", "version": "0.1.2" }, "last_serial": 1341987, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "51c14f412a39650dc546da2fec7fbb7f", "sha256": "2071b8bd8003f0f29aba6bc52b64d935277c607e240370bbaf6ce99ee2e9c0f9" }, "downloads": -1, "filename": "crossword-0.1.tar.gz", "has_sig": false, "md5_digest": "51c14f412a39650dc546da2fec7fbb7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4478, "upload_time": "2014-08-17T20:14:27", "url": "https://files.pythonhosted.org/packages/59/58/ca40a59d3b6377753d0ee91e1bb1d14830ee7162c3d4d2d5b23de8536d9f/crossword-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "afa1d30baf25a56e0ed7b55bf7577319", "sha256": "153240f2dd618f6b3ddd063a58e1ceb2e63506edbd1a657afda4c5ae918646cd" }, "downloads": -1, "filename": "crossword-0.1.1.tar.gz", "has_sig": false, "md5_digest": "afa1d30baf25a56e0ed7b55bf7577319", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5504, "upload_time": "2014-08-19T22:48:01", "url": "https://files.pythonhosted.org/packages/1e/64/26f2a060c1eafc3204d42a0089a66622cfceb3f2547709ca230ff5aa4d2b/crossword-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "56b3aa14fcac46d2a65546fcdfbaf63b", "sha256": "b1d5659eed43dc346f20131ccdb4fb9ef2714e9771dd19140f807cb813de6cee" }, "downloads": -1, "filename": "crossword-0.1.2.tar.gz", "has_sig": false, "md5_digest": "56b3aa14fcac46d2a65546fcdfbaf63b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7619, "upload_time": "2014-12-12T22:02:06", "url": "https://files.pythonhosted.org/packages/66/56/f3fbdfbab5235e457b5fb71323f637a19480b429397de859f23cf269ae80/crossword-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56b3aa14fcac46d2a65546fcdfbaf63b", "sha256": "b1d5659eed43dc346f20131ccdb4fb9ef2714e9771dd19140f807cb813de6cee" }, "downloads": -1, "filename": "crossword-0.1.2.tar.gz", "has_sig": false, "md5_digest": "56b3aa14fcac46d2a65546fcdfbaf63b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7619, "upload_time": "2014-12-12T22:02:06", "url": "https://files.pythonhosted.org/packages/66/56/f3fbdfbab5235e457b5fb71323f637a19480b429397de859f23cf269ae80/crossword-0.1.2.tar.gz" } ] }