{ "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", "Topic :: Utilities" ], "description": "============================================\nSDAG2 - Python Simple Directed Acyclic Graph\n============================================\n\nThe Python Simple Directed Graph whith Cicle Detector and TopoloGical sorter utilities.\n\nProject Home Page\n=================\n\nThis project was be hosted on `Github`_.\n\nAuthors\n-------\n\n- `Moises P. Sena`_\n\nInstall\n-------\n\nInstall it using the `Python PIP Project`_.\n\n.. code:: bash\n\n pip install sdag2\n\n\nScripts\n-------\n\ntsort.py\n~~~~~~~~\n\nSources from Standard Input:\n\n.. code:: bash\n\n echo -e 'C A\\nA B\\nB D\\nC D' | tsort.py\n\n\nSources from another file:\n\n.. code:: bash\n\n echo -e 'C A\\nA B\\nB D\\nC D' > verticies.txt\n tsort.py verticies.txt\n\nMore Options:\n\n.. code:: bash\n\n tsort.py --help\n Usage: tsort.py [options] [FILE [OUT_FILE]]\n\n Options:\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\nTests\n-----\n\n.. code:: python\n\n import unittest\n from sdag2 import DAG, CycleDetectedException\n\n class 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\n def main():\n unittest.main()\n\n if __name__ == \"__main__\":\n main()\n\n.. _Moises P. Sena: http://moisespsena.com\n.. _Github: https://github.com/moisespsena/py_sdag\n.. _Python PIP Project: https://pypi.python.org/pypi/pip", "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": "sdag2", "package_url": "https://pypi.org/project/sdag2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sdag2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/moisespsena/py_sdag2" }, "release_url": "https://pypi.org/project/sdag2/1.0.4/", "requires_dist": null, "requires_python": null, "summary": "Python Simple Directed Acyclic Graph whith Cicle Detector and TopoloGical sorter utilities.", "version": "1.0.4" }, "last_serial": 2257846, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "f834b11c53c80329c1c08d79282c15b5", "sha256": "24033e0c55844fee34d672879b486a73a0abbff55ae6ad79516950208fb8fc66" }, "downloads": -1, "filename": "sdag2-1.0.2-py2.7.egg", "has_sig": false, "md5_digest": "f834b11c53c80329c1c08d79282c15b5", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 14628, "upload_time": "2014-11-24T20:05:37", "url": "https://files.pythonhosted.org/packages/f9/85/1e4f22cf31c9affc454b1de4f383d500df25829186b34b2eb03ff66dadb9/sdag2-1.0.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "a991d08543b997becd14926b5d1fa44b", "sha256": "9548195d10332900105243751160feede047ecbe036f037b9d8fa24069abd5d5" }, "downloads": -1, "filename": "sdag2-1.0.2-py3.4.egg", "has_sig": false, "md5_digest": "a991d08543b997becd14926b5d1fa44b", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 15259, "upload_time": "2014-11-24T20:05:43", "url": "https://files.pythonhosted.org/packages/1e/bb/967d41c0a1ba03cddb6c7ffc6266ef1b35892e8ade8438e32219b19d7403/sdag2-1.0.2-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "adb7ed1f7cb9b8b0a528790d6956ccc8", "sha256": "2d468879d456fe0b9d2095ccba37599c3c270fae9e5cc7531c0751317338c2b6" }, "downloads": -1, "filename": "sdag2-1.0.2.tar.gz", "has_sig": false, "md5_digest": "adb7ed1f7cb9b8b0a528790d6956ccc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6603, "upload_time": "2014-11-24T20:05:40", "url": "https://files.pythonhosted.org/packages/49/fd/21d40002bcfd7b1034c41ce61638e53508d363ad9d19e2645b99f7d0b171/sdag2-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "20663e4025e7a2dc72bcc84c1a743f78", "sha256": "f253a87da2e8bc63eec38e549f771d6bca222f7fe25bc75e86b27707b9ce7653" }, "downloads": -1, "filename": "sdag2-1.0.3-py2.7.egg", "has_sig": false, "md5_digest": "20663e4025e7a2dc72bcc84c1a743f78", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 14607, "upload_time": "2016-08-02T13:35:05", "url": "https://files.pythonhosted.org/packages/27/25/04dbd21874d1709e638b72ded26cfaa8db3cd668072eb02f33fa6cdcb54c/sdag2-1.0.3-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "e39744b91ff44ab196b772b9b1938b9b", "sha256": "e9648076b3d524969168164103e48a3ccca0876650927569804e48e88a63b37f" }, "downloads": -1, "filename": "sdag2-1.0.3-py3.4.egg", "has_sig": false, "md5_digest": "e39744b91ff44ab196b772b9b1938b9b", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 15248, "upload_time": "2016-08-02T13:35:17", "url": "https://files.pythonhosted.org/packages/a4/e7/5d3186559061d6956dc04d2520d9e900845ea9b94daa6d4e70f0c9f5eac1/sdag2-1.0.3-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "3a3ad3fd1fa78099c9343c79ffa79eb8", "sha256": "469efae610bac01f6312ef9f004bb40c541a74c6bea7b31c0f7c5f1d527fb5f4" }, "downloads": -1, "filename": "sdag2-1.0.3.tar.gz", "has_sig": false, "md5_digest": "3a3ad3fd1fa78099c9343c79ffa79eb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7137, "upload_time": "2016-08-02T11:47:39", "url": "https://files.pythonhosted.org/packages/eb/af/01b0aff5245d2db41c9c6941c639acef46ebdd7b6f400657b011148f4a7f/sdag2-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "dfe4e0c46eeff4eef9539a8f49cbbd7c", "sha256": "39c1cae94eb7e0fdb723394d9c26236547eb804747c250eec58cdfc97e31726f" }, "downloads": -1, "filename": "sdag2-1.0.4-py2.7.egg", "has_sig": false, "md5_digest": "dfe4e0c46eeff4eef9539a8f49cbbd7c", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 14608, "upload_time": "2016-08-02T13:53:37", "url": "https://files.pythonhosted.org/packages/5c/3b/e76d3f0ac6aa47307beeb52e2fac20fa6e8f1b0b7adbc6159736ecf5d837/sdag2-1.0.4-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "135cfa11163c8d720041c07a255d1ebe", "sha256": "1b7065108485a269e2362172369bc23386e2b334ccef05c28fcbd76cb67f96a6" }, "downloads": -1, "filename": "sdag2-1.0.4-py3.4.egg", "has_sig": false, "md5_digest": "135cfa11163c8d720041c07a255d1ebe", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 15249, "upload_time": "2016-08-02T13:53:43", "url": "https://files.pythonhosted.org/packages/7f/b4/ee7bba78b25bc17a157ff856567b26691d4668744b1f30b7e4cf79f1c332/sdag2-1.0.4-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "8155e89afb6fdc64b01231856b77a14a", "sha256": "4f07a836931d20af91686d84243d35900e3e51768d3a78fbd2d201d354b6b5d1" }, "downloads": -1, "filename": "sdag2-1.0.4.tar.gz", "has_sig": false, "md5_digest": "8155e89afb6fdc64b01231856b77a14a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7143, "upload_time": "2016-08-02T13:53:40", "url": "https://files.pythonhosted.org/packages/36/08/ed2af129493606ec15df891860f76b3a139edc9522c816b7861e797d7363/sdag2-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dfe4e0c46eeff4eef9539a8f49cbbd7c", "sha256": "39c1cae94eb7e0fdb723394d9c26236547eb804747c250eec58cdfc97e31726f" }, "downloads": -1, "filename": "sdag2-1.0.4-py2.7.egg", "has_sig": false, "md5_digest": "dfe4e0c46eeff4eef9539a8f49cbbd7c", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 14608, "upload_time": "2016-08-02T13:53:37", "url": "https://files.pythonhosted.org/packages/5c/3b/e76d3f0ac6aa47307beeb52e2fac20fa6e8f1b0b7adbc6159736ecf5d837/sdag2-1.0.4-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "135cfa11163c8d720041c07a255d1ebe", "sha256": "1b7065108485a269e2362172369bc23386e2b334ccef05c28fcbd76cb67f96a6" }, "downloads": -1, "filename": "sdag2-1.0.4-py3.4.egg", "has_sig": false, "md5_digest": "135cfa11163c8d720041c07a255d1ebe", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 15249, "upload_time": "2016-08-02T13:53:43", "url": "https://files.pythonhosted.org/packages/7f/b4/ee7bba78b25bc17a157ff856567b26691d4668744b1f30b7e4cf79f1c332/sdag2-1.0.4-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "8155e89afb6fdc64b01231856b77a14a", "sha256": "4f07a836931d20af91686d84243d35900e3e51768d3a78fbd2d201d354b6b5d1" }, "downloads": -1, "filename": "sdag2-1.0.4.tar.gz", "has_sig": false, "md5_digest": "8155e89afb6fdc64b01231856b77a14a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7143, "upload_time": "2016-08-02T13:53:40", "url": "https://files.pythonhosted.org/packages/36/08/ed2af129493606ec15df891860f76b3a139edc9522c816b7861e797d7363/sdag2-1.0.4.tar.gz" } ] }