{ "info": { "author": "Moises P. Sena", "author_email": "moisespsena@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Topic :: Utilities" ], "description": "# Py_SDAG2 - Python Simple Directed Acyclic Graph\n\nThe Python Simple Directed Graph whith Cicle Detector and TopoloGical sorter utilities.\n\n## Authors\n- [Moises P. Sena](http://moisespsena.com)\n\n## Install\n\n```bash\nsudo pip install py_sdag2\n```\n\n## Scripts\n\n### tsort.py\n\nSources from Standard Input:\n\n```bash\necho -e 'C A\\nA B\\nB D\\nC D' | tsort.py\n```\n\nSources from another file:\n\n```bash\necho -e 'C A\\nA B\\nB D\\nC D' > verticies.txt\n```\n\n```bash\ntsort.py verticies.txt\n```\n\nMore Options:\n\n```bash\ntsort.py --help\nUsage: tsort.py [options] [FILE [OUT_FILE]]\n\nOptions:\n -h, --help show this help message and exit\n -f FILE, --file=FILE With no FILE, or when FILE is -, read standard input.\n -o OUT_FILE, --out-file=OUT_FILE\n Write result to OUT_FILE, default is standard output.\n -s SEP, --separator=SEP\n Items separator, default is \\s regex.\n -q QUIT_SEQ, --quit-sequence=QUIT_SEQ\n Stop read FILE where line equals QUIT_SEQ, default is\n :quit.\n```\n\n## Tests\n\n```python\nimport unittest\nfrom sdag2 import DAG, CycleDetectedException\n\nclass DAGTest(unittest.TestCase): \n def test_simple(self):\n '''\n Tests the verticles order in:\n \n C --> A --> B --> D\n '''\n \n dag = DAG()\n a = dag.add(\"A\")\n b = dag.add(\"B\")\n c = dag.add(\"C\")\n d = dag.add(\"D\")\n \n dag.add_edge(c, a)\n dag.add_edge(a, b)\n dag.add_edge(b, d)\n dag.add_edge(c, d)\n \n rs = dag.topologicaly()\n \n self.assertTrue(rs.index(\"C\") < rs.index(\"A\"))\n self.assertTrue(rs.index(\"A\") < rs.index(\"B\"))\n self.assertTrue(rs.index(\"B\") < rs.index(\"D\"))\n self.assertTrue(rs.index(\"C\") < rs.index(\"D\"))\n \n def test_cicle_detect(self):\n '''\n Tests the verticles order in:\n \n C --> A --> B --> D -> C\n '''\n \n dag = DAG()\n a = dag.add(\"A\")\n b = dag.add(\"B\")\n c = dag.add(\"C\")\n d = dag.add(\"D\")\n \n dag.add_edge(c, a)\n dag.add_edge(a, b)\n dag.add_edge(b, d)\n dag.add_edge(c, d)\n \n try:\n # add cicle at A --> C --> A\n dag.add_edge(a, c)\n raise Exception(\"Cycle not detected\")\n except CycleDetectedException: pass\n\ndef main():\n unittest.main()\n \nif __name__ == \"__main__\":\n main()\n```", "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/moisespsena/py_sdag2", "keywords": "utils utilities directed graph digraph topological simple dag", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "py_sdag2", "package_url": "https://pypi.org/project/py_sdag2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/py_sdag2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/moisespsena/py_sdag2" }, "release_url": "https://pypi.org/project/py_sdag2/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Simple Directed Acyclic Graph whith Cicle Detector and TopoloGical sorter utilities.", "version": "1.0.1" }, "last_serial": 1126768, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "5995c9851978ea3e15294528af954d19", "sha256": "fe5798bc08de8f3c0c91d825aae2a291f49d259db832f36c8c3f57e511836343" }, "downloads": -1, "filename": "py_sdag2-1.0-py2.7.egg", "has_sig": false, "md5_digest": "5995c9851978ea3e15294528af954d19", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 9656, "upload_time": "2012-10-08T14:25:45", "url": "https://files.pythonhosted.org/packages/0f/fd/314f3f6125e0f3d8413a8d44aaf4170f6ec56b4b77856f004672ec8756e0/py_sdag2-1.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "a1cd03479468ea51ced8aaa7561d1e4f", "sha256": "d845035fbaeabac7cb59b0706f25127cbe6ffa0d24d102f836be27b9d8195e5b" }, "downloads": -1, "filename": "py_sdag2-1.0-py3.2.egg", "has_sig": false, "md5_digest": "a1cd03479468ea51ced8aaa7561d1e4f", "packagetype": "bdist_egg", "python_version": "3.2", "requires_python": null, "size": 9805, "upload_time": "2012-10-08T14:25:55", "url": "https://files.pythonhosted.org/packages/1b/4c/e2db299c5973893f65023614bae2909a85082351cb5906a19f25ffac14e1/py_sdag2-1.0-py3.2.egg" }, { "comment_text": "", "digests": { "md5": "9d1a3884311e139cd9c3eb1bc634cf92", "sha256": "fc6a1536dbc29b8a155842bafbb21f321ccbed0dd3bcd1e132c56a68adf5cd81" }, "downloads": -1, "filename": "py_sdag2-1.0.tar.gz", "has_sig": false, "md5_digest": "9d1a3884311e139cd9c3eb1bc634cf92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5728, "upload_time": "2012-10-08T14:25:47", "url": "https://files.pythonhosted.org/packages/7f/bd/16fbae11cd95500383f9e2a130bf54b0d27a006238725af4761271a8870f/py_sdag2-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "596e14a80998be35a31e2a36862eddc1", "sha256": "aa87e5eb7c28cbdc07819361cad95e9bc917a4ecabb8f430e633b0963cb5e7cd" }, "downloads": -1, "filename": "py_sdag2-1.0.1-py2.7.egg", "has_sig": false, "md5_digest": "596e14a80998be35a31e2a36862eddc1", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 9629, "upload_time": "2014-06-16T18:44:13", "url": "https://files.pythonhosted.org/packages/1a/f6/cc33ef4700fdb6e8aeb6663463f8b5995641e84a0f08320557be1436df43/py_sdag2-1.0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "88f25d85b741d1da27e7e1a08a1caa6f", "sha256": "2360a7b2683f6e0b8e9a8c1bdb5323f75849d03657ae35a14b68988cab6105a9" }, "downloads": -1, "filename": "py_sdag2-1.0.1-py3.4.egg", "has_sig": false, "md5_digest": "88f25d85b741d1da27e7e1a08a1caa6f", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 9962, "upload_time": "2014-06-16T18:44:20", "url": "https://files.pythonhosted.org/packages/cc/b9/eb68971d1a36f0d6674430a73e90c57d35ad2a4ac1da04875a4a864338e7/py_sdag2-1.0.1-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "a3acb6200a9d15e3d098b396c938f52a", "sha256": "efb000f8038bc58d10b30c3a985e787b5876150b72f41dd4e71e268981c5a83e" }, "downloads": -1, "filename": "py_sdag2-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a3acb6200a9d15e3d098b396c938f52a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5633, "upload_time": "2014-06-16T18:44:16", "url": "https://files.pythonhosted.org/packages/50/09/30950184a190d35adf002ec0f48a973ff6fd294af658a9fdccd611408cc3/py_sdag2-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "596e14a80998be35a31e2a36862eddc1", "sha256": "aa87e5eb7c28cbdc07819361cad95e9bc917a4ecabb8f430e633b0963cb5e7cd" }, "downloads": -1, "filename": "py_sdag2-1.0.1-py2.7.egg", "has_sig": false, "md5_digest": "596e14a80998be35a31e2a36862eddc1", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 9629, "upload_time": "2014-06-16T18:44:13", "url": "https://files.pythonhosted.org/packages/1a/f6/cc33ef4700fdb6e8aeb6663463f8b5995641e84a0f08320557be1436df43/py_sdag2-1.0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "88f25d85b741d1da27e7e1a08a1caa6f", "sha256": "2360a7b2683f6e0b8e9a8c1bdb5323f75849d03657ae35a14b68988cab6105a9" }, "downloads": -1, "filename": "py_sdag2-1.0.1-py3.4.egg", "has_sig": false, "md5_digest": "88f25d85b741d1da27e7e1a08a1caa6f", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 9962, "upload_time": "2014-06-16T18:44:20", "url": "https://files.pythonhosted.org/packages/cc/b9/eb68971d1a36f0d6674430a73e90c57d35ad2a4ac1da04875a4a864338e7/py_sdag2-1.0.1-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "a3acb6200a9d15e3d098b396c938f52a", "sha256": "efb000f8038bc58d10b30c3a985e787b5876150b72f41dd4e71e268981c5a83e" }, "downloads": -1, "filename": "py_sdag2-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a3acb6200a9d15e3d098b396c938f52a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5633, "upload_time": "2014-06-16T18:44:16", "url": "https://files.pythonhosted.org/packages/50/09/30950184a190d35adf002ec0f48a973ff6fd294af658a9fdccd611408cc3/py_sdag2-1.0.1.tar.gz" } ] }