{ "info": { "author": "Ross Anderson", "author_email": "ross.anderson@ualberta.ca", "bugtrack_url": null, "classifiers": [], "description": "catanlog\n--------\n\nThis project introduces a machine-parsable, human-readable file format for describing a game of Catan.\n\nEach `.catan` file contains all publicly known information in the game. Therefore, each `.catan` file contains\nsufficient information to 'replay' a game (from a spectator's point of view). This allows statistics and analysis to\nbe done after the fact, at any time.\n\nThis package is intended to support broadcast tooling (e.g. [catan-spectator](https://github.com/rosshamish/catan-spectator)), AI development (e.g. [goodcatan](https://github.com/rosshamish/goodcatan)), and other pursuits which benefit from well-defined game logs.\n\nUntil a formal specification is written, this implementation serves as the specification.\nThe spec will likely be formalized once stable, after v1.0.0\n\nSupports Python 3. Might work in Python 2.\n\n> Author: Ross Anderson ([rosshamish](https://github.com/rosshamish))\n\n### Installation\n\n```\npip install catanlog\n```\n\n### File Format\n\n\nAt a high level, files look like this:\n\n```\nversion |\ntimestamp | Header\nplayers |\nboard layout |\n...CATAN! -\ngameplay | Body\n```\n\nThe specification is defined by .feature files in `spec/`. The `.feature` files are human-readable. They are executed\nusing [behave](https://github.com/behave/behave).\n\n`$ behave spec/`\n\nThe format is not yet v1.0, and could change at any time until then. The version is listed in version.py. Todos before\nv1.0.0:\n- decide logged/not-logged for a) dev card types and b) *which* card was stolen in a robber move\n\n### Usage\n\nThere is one method in class CatanLog for each loggable action.\n\nSome methods expect parameters of types defined in module [`catan`](https://github.com/rosshamish/catan-py). Methods are\ndocumented individually, check the docstring.\n\nMethods which take a `location` expect location strings as computed by method `location()` in\nmodule [`hexgrid`](https://github.com/rosshamish/hexgrid). Use it! Locations look like this:\n\n```\n1 # the tile in the northwest corner\n(1 NW) # a node on the northwest corner of the board (settlement, city)\n(1 NW) # the edge on the northwest corner of the board (road)\n```\n\nThe tile numbers start from 1 in the northwest corner, and increase counterclockwise, spiralling inwards. See the\ndocumentation of [`hexgrid`](https://github.com/rosshamish/hexgrid) for more info.\n\nExamples:\n\n- Import it, create a logger\n\n```\nimport catanlog\n\nlog = catanlog.CatanLog(use_stdout=True)\n```\n\n- Header / game start\n\n```\nlog.log_game_start(players, terrain, numbers, ports)\n\ncatanlog v0.5.8 # version\ntimestamp: 2015-12-30 03:21:56.572418 # timestamp\nplayers: 4 # players\nname: yurick, color: green, seat: 1 #\nname: josh, color: blue, seat: 2 #\nname: zach, color: orange, seat: 3 #\nname: ross, color: red, seat: 4 #\nterrain: desert brick sheep brick ... wheat wood #\nnumbers: None 4 6 9 8 10 5 8 10 5 ... 9 12 11 6 4 2 # board layout\nports: wood(8 SE) brick(9 E) ... ore(2 W) 3:1(10 NE) #\n...CATAN! # end header\n```\n\n- Rolling. Players are named by their color. Two is the only special one.\n\n```\nlog.log_player_roll(player, roll)\n\ngreen rolls 4\nblue rolls 10\norange rolls 2 ...DEUCES!\n```\n\n- Moving the robber on a 7.\n\n```\nlog.log_robber(player, location, victim)\n\ngreen moves robber to 1, steals from red\n```\n\n- Buying and building. Note that the dev card type is not logged. This might change.\n\n```\nlog.log_player_buys_road(player, location)\nlog.log_player_buys_settlement(player, location)\nlog.log_player_buys_city(player, city)\nlog.log_player_buys_dev_card(player)\n\ngreen buys settlement, builds at (1 NW)\nblue buys city, builds at (1 SE)\norange buys road, builds at (2 E)\nred buys dev card\n```\n\n- Trading. Multiple port trades in a turn can (and should) be consolidated into large port transactions.\n\n```\nlog.log_player_trades_with_port(player, to_port, port, to_player)\nlog.log_player_trades_with_other_player(player, to_other, other, to_player)\n\ngreen trades [1 wheat, 1 brick] to player red for [1 sheep]\nblue trades [3 wheat] to port 3:1 for [1 sheep]\norange trades [6 wheat] to port wheat for [3 ore]\n```\n\n- Dev cards.\n\n```\nlog.log_player_plays_knight(player, location, victim)\nlog.log_player_plays_road_builder(player, location1, location2)\nlog.log_player_plays_year_of_plenty(player, resource1, resource2)\nlog.log_player_plays_monopoly(player, resource)\nlog.log_player_plays_victory_point(player)\n\ngreen plays knight\ngreen moves robber to 1, steals from red\nblue plays road builder, builds at (1 SW) and (1 W)\norange plays year of plenty, takes wood and brick\nred plays monopoly on ore\ngreen plays victory point\n```\n\n- End of turn. The length of the turn is logged, rounded to the nearest second.\n\n```\nlog.log_player_ends_turn\n\ngreen ends turn after 15s\n```\n\n- End of game.\n\n```\nlog.log_player_wins\n\ngreen wins\n```\n\n### License\n\nGPLv3", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/rosshamish/catanlog/tarball/0.10.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rosshamish/catanlog/", "keywords": null, "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "catanlog", "package_url": "https://pypi.org/project/catanlog/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/catanlog/", "project_urls": { "Download": "https://github.com/rosshamish/catanlog/tarball/0.10.1", "Homepage": "https://github.com/rosshamish/catanlog/" }, "release_url": "https://pypi.org/project/catanlog/0.10.1/", "requires_dist": null, "requires_python": null, "summary": "reference implementation for the catanlog (.catan) file format", "version": "0.10.1" }, "last_serial": 1960155, "releases": { "0.10.1": [ { "comment_text": "", "digests": { "md5": "f9c4a057424f3d04b58e21b4358bc80c", "sha256": "9fddf686baaf794ce203b0eea9efc858879806bd6766f6bba1003973d49eb564" }, "downloads": -1, "filename": "catanlog-0.10.1.tar.gz", "has_sig": false, "md5_digest": "f9c4a057424f3d04b58e21b4358bc80c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18756, "upload_time": "2016-02-16T21:09:03", "url": "https://files.pythonhosted.org/packages/ce/52/d7f72d28b938c4ac6b18df223899bb5598649c947c673aec4d2e814d2144/catanlog-0.10.1.tar.gz" } ], "0.5.10": [ { "comment_text": "", "digests": { "md5": "64ad861f1467f9c1b85d22a92bcd1fbd", "sha256": "4c80c9038baab6ab7e259346af39396675d79343f58356129ad12f9a69716965" }, "downloads": -1, "filename": "catanlog-0.5.10.tar.gz", "has_sig": false, "md5_digest": "64ad861f1467f9c1b85d22a92bcd1fbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5095, "upload_time": "2016-01-15T07:50:04", "url": "https://files.pythonhosted.org/packages/45/d2/7b04d1b2f582cd5fc37e9274e277e52f6ba9967eca2b0c816a9cfae8ea45/catanlog-0.5.10.tar.gz" } ], "0.5.11": [ { "comment_text": "", "digests": { "md5": "0882a182dfe0fc5a08bd62d4ec0ecef2", "sha256": "3476fc6d4e9a81c05c9d569616a88acab77bdbe7dcbfdb8253212a53678512f0" }, "downloads": -1, "filename": "catanlog-0.5.11.tar.gz", "has_sig": false, "md5_digest": "0882a182dfe0fc5a08bd62d4ec0ecef2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17456, "upload_time": "2016-01-22T23:25:12", "url": "https://files.pythonhosted.org/packages/5c/44/0cd07436a061236dcdd068373d9575efa51fe4600ce41238c039acac9e1b/catanlog-0.5.11.tar.gz" } ], "0.5.12": [ { "comment_text": "", "digests": { "md5": "ffb1ea1fca2b902b510fae3ea5c1aea5", "sha256": "b1e082734fd747cde67c5b8ffce2e3ad585e3042fafaa2fbb62137644c5362af" }, "downloads": -1, "filename": "catanlog-0.5.12.tar.gz", "has_sig": false, "md5_digest": "ffb1ea1fca2b902b510fae3ea5c1aea5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17469, "upload_time": "2016-01-22T23:31:06", "url": "https://files.pythonhosted.org/packages/6f/b6/f02b9c797c2b19c95769d6016964b3d09c9602abcf916ccc3d237957d5b5/catanlog-0.5.12.tar.gz" } ], "0.5.14": [ { "comment_text": "", "digests": { "md5": "5b4081c9b9f0ed3f9c19dc67d903a12c", "sha256": "95a659b48c1793fdd200c7da859bb4dc5786113fdfffdfdfd83a160e85754db5" }, "downloads": -1, "filename": "catanlog-0.5.14.tar.gz", "has_sig": false, "md5_digest": "5b4081c9b9f0ed3f9c19dc67d903a12c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17753, "upload_time": "2016-01-25T18:13:58", "url": "https://files.pythonhosted.org/packages/25/48/dc225e6818e1292d475800fa46c0409a7f450b51ca512b242b02229b6ab1/catanlog-0.5.14.tar.gz" } ], "0.5.6": [ { "comment_text": "", "digests": { "md5": "dd01676b0e8c6fd6a5b21e0ce8802d39", "sha256": "ded4650ef89a6c943dbf9d25e43924a48303d2f1991c3d6cea48f7911ce0cec5" }, "downloads": -1, "filename": "catanlog-0.5.6.tar.gz", "has_sig": false, "md5_digest": "dd01676b0e8c6fd6a5b21e0ce8802d39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5071, "upload_time": "2016-01-15T07:19:38", "url": "https://files.pythonhosted.org/packages/c6/75/235d066bb83721f6959dfbe97e1a203b13c4b1103741c1feda5ae44a1516/catanlog-0.5.6.tar.gz" } ], "0.5.7": [ { "comment_text": "", "digests": { "md5": "5bff0c73936a69dabb13d0b63ab461e2", "sha256": "e5c0fa3284073d0642ff76d956583b0aab78716a1fe8c3c6c05465c95b58e8b6" }, "downloads": -1, "filename": "catanlog-0.5.7.tar.gz", "has_sig": false, "md5_digest": "5bff0c73936a69dabb13d0b63ab461e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5067, "upload_time": "2016-01-15T07:22:10", "url": "https://files.pythonhosted.org/packages/de/cb/90edeb227a0909d4331223b91ddb577aa938df456afb4f43366dd3a6808f/catanlog-0.5.7.tar.gz" } ], "0.5.8": [ { "comment_text": "", "digests": { "md5": "7a2bf69ab3f39f2ef4c6d103a381d2b4", "sha256": "dea04af3237c13b5ba823d2f92a475068d9f56f53986600c719065f026b4b623" }, "downloads": -1, "filename": "catanlog-0.5.8.tar.gz", "has_sig": false, "md5_digest": "7a2bf69ab3f39f2ef4c6d103a381d2b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5071, "upload_time": "2016-01-15T07:24:14", "url": "https://files.pythonhosted.org/packages/1f/78/d93328ca9901b19e86b6dcf826ee52ae7c0a2abbb10eb811da80d370d181/catanlog-0.5.8.tar.gz" } ], "0.5.9": [ { "comment_text": "", "digests": { "md5": "a89b2d38cc42cfe11827d2cdec05b342", "sha256": "bc575256851b5967e17bdf838be1912f25c20d1adc4f4f90aca777b68ab056ea" }, "downloads": -1, "filename": "catanlog-0.5.9.tar.gz", "has_sig": false, "md5_digest": "a89b2d38cc42cfe11827d2cdec05b342", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5095, "upload_time": "2016-01-15T07:35:52", "url": "https://files.pythonhosted.org/packages/7a/91/5a6c76e5e1e84722e856b0c6ed07149656becd4d511a0447910817dc1cd4/catanlog-0.5.9.tar.gz" } ], "0.7.14": [ { "comment_text": "", "digests": { "md5": "9711940732dfdf88298e86628b050459", "sha256": "8c165fa5b817c23fd427acf3920b9daf959c8f0dcec2a22b004e691745bbe129" }, "downloads": -1, "filename": "catanlog-0.7.14.tar.gz", "has_sig": false, "md5_digest": "9711940732dfdf88298e86628b050459", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19386, "upload_time": "2016-01-31T18:32:32", "url": "https://files.pythonhosted.org/packages/88/97/20f55731464efdba921f41a862873707a4e705654b08b6b21c7700008060/catanlog-0.7.14.tar.gz" } ], "0.8.14": [ { "comment_text": "", "digests": { "md5": "b7644c65aa7c7867b268dc81fdfa7fde", "sha256": "f976e09fa7fc83369c9eb62db6eb4f5a674d43e19815a30a7ad11efce61edd41" }, "downloads": -1, "filename": "catanlog-0.8.14.tar.gz", "has_sig": false, "md5_digest": "b7644c65aa7c7867b268dc81fdfa7fde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18750, "upload_time": "2016-02-03T03:54:49", "url": "https://files.pythonhosted.org/packages/e5/55/7a2f172872f1d6ba0ac2a93bcf405c8cddf9523117aff3f848850ba5cf09/catanlog-0.8.14.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "3e9943c4d0ebc0663d46f617fef53fd9", "sha256": "8b824cbb28086e13c2542f932b77316175a09f9c483d7bce7644e89c42d34c75" }, "downloads": -1, "filename": "catanlog-0.9.2.tar.gz", "has_sig": false, "md5_digest": "3e9943c4d0ebc0663d46f617fef53fd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18734, "upload_time": "2016-02-04T01:13:56", "url": "https://files.pythonhosted.org/packages/cf/0f/6f68fffd9a4d0102c8f61568738556ca05f2975c0f3ee8c2414809968e2e/catanlog-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "9ef46f1e5b20a1c69493d813ae64a1de", "sha256": "72ab578045f5659c17906936b5b98f0afba7e72cabd493558aa8c65e59c521bc" }, "downloads": -1, "filename": "catanlog-0.9.3.tar.gz", "has_sig": false, "md5_digest": "9ef46f1e5b20a1c69493d813ae64a1de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18400, "upload_time": "2016-02-04T02:09:34", "url": "https://files.pythonhosted.org/packages/38/e6/7e64c4d5d3c2957d5488714074082af241e66862e4ecf9c4f1ca89d41504/catanlog-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9c4a057424f3d04b58e21b4358bc80c", "sha256": "9fddf686baaf794ce203b0eea9efc858879806bd6766f6bba1003973d49eb564" }, "downloads": -1, "filename": "catanlog-0.10.1.tar.gz", "has_sig": false, "md5_digest": "f9c4a057424f3d04b58e21b4358bc80c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18756, "upload_time": "2016-02-16T21:09:03", "url": "https://files.pythonhosted.org/packages/ce/52/d7f72d28b938c4ac6b18df223899bb5598649c947c673aec4d2e814d2144/catanlog-0.10.1.tar.gz" } ] }