{ "info": { "author": "Radovan Bast", "author_email": "radovan.bast@uit.no", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6" ], "description": ".. image:: https://travis-ci.org/bast/ascii2graph.svg?branch=master\n :target: https://travis-ci.org/bast/ascii2graph/builds\n.. image:: https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg\n :target: ../master/LICENSE\n\n\nascii2graph\n===========\n\nConverts ASCII text to a graph (represented as a dictionary of connections and\nangles). It can represent directed and undirected graphs.\n\n\nInstallation\n------------\n\n::\n\n $ pip install ascii2graph\n\n\nExample\n-------\n\n.. code-block:: python\n\n from ascii2graph import graph\n\n text = r'''\n a->boo\n ^ | x\n | v /\n c<--d-e\n | |\n f-g'''\n\n result = graph(text)\n print(result)\n\nThis produces the following graph (dictionary):\n\n.. code-block:: python\n\n result = {(1, 4, 'a'): [(1, 7, 'boo', 90)],\n (4, 4, 'c'): [(1, 4, 'a', 0)],\n (4, 8, 'd'): [(4, 4, 'c', 270), (4, 10, 'e', 90), (6, 8, 'f', 180)],\n (4, 10, 'e'): [(2, 12, 'x', 45), (4, 8, 'd', 270), (6, 10, 'g', 180)],\n (2, 12, 'x'): [(4, 10, 'e', 225)],\n (6, 8, 'f'): [(6, 10, 'g', 90), (4, 8, 'd', 0)],\n (6, 10, 'g'): [(6, 8, 'f', 270), (4, 10, 'e', 0)],\n (1, 7, 'boo'): [(4, 8, 'd', 180)]}\n\nNodes can be anything that is not one of these characters::\n\n - | / \\ v ^ < >\n\nThere is one exception (sorry!): If \"/\" is part of `[sometext/foo]`, then it is not interpreted\nas an edge. The reason is that I needed this to visualize Git branches and Git history where I needed\n`[origin/somebranch]`.\n\n\nBut ... why?\n------------\n\nI use it to create SVG graphics for teaching Git DAGs from plain text files\nbecause it is so easy to change a text file and simply generate a new SVG\nimage. This module helps me to obtain a graph representation that I can use\nsomewhere else to generate graphics.\n\n\nSuggestions? Corrections? Pull requests?\n----------------------------------------\n\nYes please!", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bast/ascii2graph", "keywords": "", "license": "MPL-2.0", "maintainer": "", "maintainer_email": "", "name": "ascii2graph", "package_url": "https://pypi.org/project/ascii2graph/", "platform": "", "project_url": "https://pypi.org/project/ascii2graph/", "project_urls": { "Homepage": "https://github.com/bast/ascii2graph" }, "release_url": "https://pypi.org/project/ascii2graph/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Converts ASCII text to a graph (represented as a dictionary).", "version": "0.3.1" }, "last_serial": 3507304, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b174717fcd7d7389746de7a3155ebd05", "sha256": "e3960caf39aae5aead6400143ebc3446910d549107425454987ac447813544e1" }, "downloads": -1, "filename": "ascii2graph-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b174717fcd7d7389746de7a3155ebd05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3756, "upload_time": "2018-01-04T17:20:46", "url": "https://files.pythonhosted.org/packages/e6/8c/f4dbbb5a0526b4b80e8a2e092345c3200c750361de74eb04687ed471d4e8/ascii2graph-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "0fb28a1cad451c8437cc1e1b34287647", "sha256": "1a105150827e3a9da2681f77643008ef49210fd7241572b23f581729238df784" }, "downloads": -1, "filename": "ascii2graph-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0fb28a1cad451c8437cc1e1b34287647", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4413, "upload_time": "2018-01-07T18:23:41", "url": "https://files.pythonhosted.org/packages/9b/55/1cef0e1d5cb63e87dad85b04bd807938aacc4a5c3121d4aa70865371ec49/ascii2graph-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "df4aaa26aede8b63aaa7f0ae973cee83", "sha256": "e73507df441e42c3ff26fbf3dc94b568f03d40c5036a605500e90f6d95a76884" }, "downloads": -1, "filename": "ascii2graph-0.3.0.tar.gz", "has_sig": false, "md5_digest": "df4aaa26aede8b63aaa7f0ae973cee83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4824, "upload_time": "2018-01-20T16:11:54", "url": "https://files.pythonhosted.org/packages/c6/c1/37d04e2f9ca99d1189a859fa800e90b1afd964af377e9801efae4eefc1ca/ascii2graph-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "67779a559292b87f3cfcfb966045a98d", "sha256": "a1a1c35061966b147c41eb91388d970fd5a5922ba6cffd93d6e55b270ed992ac" }, "downloads": -1, "filename": "ascii2graph-0.3.1.tar.gz", "has_sig": false, "md5_digest": "67779a559292b87f3cfcfb966045a98d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4852, "upload_time": "2018-01-20T16:33:55", "url": "https://files.pythonhosted.org/packages/1b/84/50b6c700a857819b8c176fd403f16a16dcf97b655aa4fcaeadd9afe91143/ascii2graph-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "67779a559292b87f3cfcfb966045a98d", "sha256": "a1a1c35061966b147c41eb91388d970fd5a5922ba6cffd93d6e55b270ed992ac" }, "downloads": -1, "filename": "ascii2graph-0.3.1.tar.gz", "has_sig": false, "md5_digest": "67779a559292b87f3cfcfb966045a98d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4852, "upload_time": "2018-01-20T16:33:55", "url": "https://files.pythonhosted.org/packages/1b/84/50b6c700a857819b8c176fd403f16a16dcf97b655aa4fcaeadd9afe91143/ascii2graph-0.3.1.tar.gz" } ] }