{ "info": { "author": "Ahmed Ali", "author_email": "ahmed@ajaali.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Cython", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Libraries" ], "description": "# Leafy Graph Library\nLeafy is a python graph library written in cython. This mix gives the speed of writing\nthe library in c with the benefit of python bindings.\n\n## Usage\n\n### Graph Objects\nLeafy supports two types of graphs: Dense and Sparse. These are represented by the \nclasses `leafy.graph.Graph` and `leafy.graph.SparseGraph`.\n\nTo instantiate a graph object we need to know the number of nodes (verticies) in the\ngraph, and if the graph is directed. Graphs defualt to undirected.\n\n```python\n>>> from leafy.graph import Graph\n>>> g = Graph(4)\n>>> g.add_edge(0, 1)\n>>> g.add_edge(2, 3)\n>>> g.add_edge(2, 1)\n>>> g.matrix\narray([[0, 1, 0, 0],\n [1, 0, 1, 0],\n [0, 1, 0, 1],\n [0, 0, 1, 0]], dtype=int32)\n```\n\nthe same edges can be defined as a directed `SparseGraph`\n\n```python\n>>> from leafy.graph import SparseGraph\n>>> g = SparseGraph(4, True)\n>>> g.add_edge(0, 1)\n>>> g.add_edge(2, 3)\n>>> g.add_edge(2, 1)\n>>> g.list\n[[1], [], [3, 1], []]\n```\n\n### Search\n\nLeafy can run Depth First Search (DFS) and Breadth First Search (BFS) on a graph and\nreturn the graph search properties.\n\nTo run a search we need to define the graph to search and the node to start from.\nBefore you can view the properties we must call `.run()`.\n\n```python\n>>> from leafy.search import DFS\n>>> graph = small_graph(request.param)\n>>> dfs = DFS(graph, 0)\n>>> dfs.run()\n>>> dfs.simple_path(12)\n[0, 1, 2, 11, 12]\n>>> dfs.bridges\n[(1, 3), (3, 4), (3, 5), (2, 11), (11, 12)]\n```\n\n### Digraphs\n\nFor diagraphs leafy supports DFS which can be imported from `leafy.digraph`\n\n```python\n>>> from leafy.digraph import DFS\n>>> dag = small_dag()\n>>> dfs = DFS(dag, 0)\n>>> dfs.run()\n>>> dfs.is_dag\nTrue\n>>> dfs.topological_order()\n[0, 6, 2, 3, 5, 4, 9, 11, 12, 10, 1]\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ajaali/leafy", "keywords": "graph dag algorithm library", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "leafy", "package_url": "https://pypi.org/project/leafy/", "platform": "", "project_url": "https://pypi.org/project/leafy/", "project_urls": { "Homepage": "https://github.com/ajaali/leafy" }, "release_url": "https://pypi.org/project/leafy/0.1.0a2/", "requires_dist": [ "numpy (>=1.16.1)", "cython (>=0.29.4)" ], "requires_python": ">=3.6", "summary": "Another fast graph algorithms library", "version": "0.1.0a2" }, "last_serial": 4873478, "releases": { "0.1.0a1": [ { "comment_text": "", "digests": { "md5": "90cfaf0df2fb48798ee4f48e23cd6fa7", "sha256": "46bfef3d91903984decb89fe07dab2357789286c05a9a86d7e4090e557eb5998" }, "downloads": -1, "filename": "leafy-0.1.0a1-cp36-cp36m-macosx_10_6_intel.whl", "has_sig": false, "md5_digest": "90cfaf0df2fb48798ee4f48e23cd6fa7", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=3.6", "size": 663601, "upload_time": "2019-02-23T13:28:53", "url": "https://files.pythonhosted.org/packages/1c/11/e4d7b38e5a27a8aae2cf98b715f7296aa184c74551b56aaef2fe905acf20/leafy-0.1.0a1-cp36-cp36m-macosx_10_6_intel.whl" }, { "comment_text": "", "digests": { "md5": "36875e90d4ec09cdb4d947534bc594c8", "sha256": "111053b114d8256c95d7f640f338333120511e15188d7941ba80843d7a83ccc8" }, "downloads": -1, "filename": "leafy-0.1.0a1-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "36875e90d4ec09cdb4d947534bc594c8", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=3.6", "size": 1306001, "upload_time": "2019-02-27T09:04:29", "url": "https://files.pythonhosted.org/packages/65/b3/9c26850f2dbe484dca49ad5ac222b21f6bd53278dc8c3a05a35524aaace9/leafy-0.1.0a1-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "e5848fb2d3c283be7cbc07ac6a448dc2", "sha256": "33508d035fc8048548c163e3ed6a188fef1b0fe4feb81be55e67657c9632f6b4" }, "downloads": -1, "filename": "leafy-0.1.0a1-cp37-cp37m-macosx_10_9_x86_64.whl", "has_sig": false, "md5_digest": "e5848fb2d3c283be7cbc07ac6a448dc2", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": ">=3.6", "size": 329544, "upload_time": "2019-02-27T09:12:09", "url": "https://files.pythonhosted.org/packages/50/62/f298d57269213ed159174e37446ea16196fbf71ea990df515cd481b1c8c8/leafy-0.1.0a1-cp37-cp37m-macosx_10_9_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3f48864f530eba5dd56667a44ceffc8e", "sha256": "9d9a8179dbaadaa49d6b1505ebd959eaa8ddc2a34026768d136ebec7da31b1b2" }, "downloads": -1, "filename": "leafy-0.1.0a1-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "3f48864f530eba5dd56667a44ceffc8e", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": ">=3.6", "size": 1301185, "upload_time": "2019-02-27T09:04:35", "url": "https://files.pythonhosted.org/packages/8c/5b/2168d4b4e07d23fc77a1caf944e8e48f6d0438d5ae4894356c7c9f7e5533/leafy-0.1.0a1-cp37-cp37m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "84bf7064d3976d6dc1822867208f490a", "sha256": "12480b5879c4b945017065b032a59e5fecfedbce48791ade13ce9044246a7953" }, "downloads": -1, "filename": "leafy-0.1.0a1.tar.gz", "has_sig": false, "md5_digest": "84bf7064d3976d6dc1822867208f490a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 512069, "upload_time": "2019-02-23T13:28:58", "url": "https://files.pythonhosted.org/packages/89/c3/fe2fb57f66d5bbce5e3be068ed52eb4a0ab486e3b7f2902fa1fcb220344c/leafy-0.1.0a1.tar.gz" } ], "0.1.0a2": [ { "comment_text": "", "digests": { "md5": "0123199650470ebf695166e25adea7cc", "sha256": "0e344f22cf4920bc542de9a72f81999f3e7dd4becb1f2c8e737800b678cc0e6f" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp36-cp36m-macosx_10_6_intel.whl", "has_sig": false, "md5_digest": "0123199650470ebf695166e25adea7cc", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=3.6", "size": 664386, "upload_time": "2019-02-27T10:07:08", "url": "https://files.pythonhosted.org/packages/a5/1b/8d26abb284602141eba59e9e112ac34259223503e84514d8d7635f7b4636/leafy-0.1.0a2-cp36-cp36m-macosx_10_6_intel.whl" }, { "comment_text": "", "digests": { "md5": "504c9e18640a7013888060c7d3e35bc7", "sha256": "f5f0bfdd18d231fa1be211366da3a56285a6676c4d806ea29a529f947184939b" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "504c9e18640a7013888060c7d3e35bc7", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=3.6", "size": 1306827, "upload_time": "2019-02-27T10:07:11", "url": "https://files.pythonhosted.org/packages/ae/11/59baf289d3c89e3cd3697bc753d64e24da657c8093f94e4b5ccd9b7a263d/leafy-0.1.0a2-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3db213e3f8190bf12bce91b6e882b79b", "sha256": "4dce3a81f356f5dd1f98d0f3ae92d756f3a2bee0e6b98e23129ee183aba81a59" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp37-cp37m-macosx_10_9_x86_64.whl", "has_sig": false, "md5_digest": "3db213e3f8190bf12bce91b6e882b79b", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": ">=3.6", "size": 330252, "upload_time": "2019-02-27T10:07:13", "url": "https://files.pythonhosted.org/packages/11/d3/11f00ed2310594d45c72c99e88e704abce78e29ca255bd5859688ab8fab4/leafy-0.1.0a2-cp37-cp37m-macosx_10_9_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a3b1004701a25a58cc28c2b8db4c2ac8", "sha256": "c3885fb78f7bc80e3faa2aae83a848aa73c1ffa538923f410ebc974a06eeb2de" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "a3b1004701a25a58cc28c2b8db4c2ac8", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": ">=3.6", "size": 1302069, "upload_time": "2019-02-27T10:07:16", "url": "https://files.pythonhosted.org/packages/a8/d6/b7408b181b25877c8636589d2cc08b96e4a6839c5d162218e8edd83961e0/leafy-0.1.0a2-cp37-cp37m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "31cf27e7e97708cb6b949da843f6d4c7", "sha256": "6244a2e7607e1d19c0dee105c19d9e78269663faecc7fcfe6e945e94aaeb7960" }, "downloads": -1, "filename": "leafy-0.1.0a2.tar.gz", "has_sig": false, "md5_digest": "31cf27e7e97708cb6b949da843f6d4c7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 513906, "upload_time": "2019-02-27T10:07:19", "url": "https://files.pythonhosted.org/packages/e2/31/a0c612557ade3d7c94442fcee95c9dad240df2294381c3d101a148847441/leafy-0.1.0a2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0123199650470ebf695166e25adea7cc", "sha256": "0e344f22cf4920bc542de9a72f81999f3e7dd4becb1f2c8e737800b678cc0e6f" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp36-cp36m-macosx_10_6_intel.whl", "has_sig": false, "md5_digest": "0123199650470ebf695166e25adea7cc", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=3.6", "size": 664386, "upload_time": "2019-02-27T10:07:08", "url": "https://files.pythonhosted.org/packages/a5/1b/8d26abb284602141eba59e9e112ac34259223503e84514d8d7635f7b4636/leafy-0.1.0a2-cp36-cp36m-macosx_10_6_intel.whl" }, { "comment_text": "", "digests": { "md5": "504c9e18640a7013888060c7d3e35bc7", "sha256": "f5f0bfdd18d231fa1be211366da3a56285a6676c4d806ea29a529f947184939b" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "504c9e18640a7013888060c7d3e35bc7", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=3.6", "size": 1306827, "upload_time": "2019-02-27T10:07:11", "url": "https://files.pythonhosted.org/packages/ae/11/59baf289d3c89e3cd3697bc753d64e24da657c8093f94e4b5ccd9b7a263d/leafy-0.1.0a2-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3db213e3f8190bf12bce91b6e882b79b", "sha256": "4dce3a81f356f5dd1f98d0f3ae92d756f3a2bee0e6b98e23129ee183aba81a59" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp37-cp37m-macosx_10_9_x86_64.whl", "has_sig": false, "md5_digest": "3db213e3f8190bf12bce91b6e882b79b", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": ">=3.6", "size": 330252, "upload_time": "2019-02-27T10:07:13", "url": "https://files.pythonhosted.org/packages/11/d3/11f00ed2310594d45c72c99e88e704abce78e29ca255bd5859688ab8fab4/leafy-0.1.0a2-cp37-cp37m-macosx_10_9_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a3b1004701a25a58cc28c2b8db4c2ac8", "sha256": "c3885fb78f7bc80e3faa2aae83a848aa73c1ffa538923f410ebc974a06eeb2de" }, "downloads": -1, "filename": "leafy-0.1.0a2-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "a3b1004701a25a58cc28c2b8db4c2ac8", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": ">=3.6", "size": 1302069, "upload_time": "2019-02-27T10:07:16", "url": "https://files.pythonhosted.org/packages/a8/d6/b7408b181b25877c8636589d2cc08b96e4a6839c5d162218e8edd83961e0/leafy-0.1.0a2-cp37-cp37m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "31cf27e7e97708cb6b949da843f6d4c7", "sha256": "6244a2e7607e1d19c0dee105c19d9e78269663faecc7fcfe6e945e94aaeb7960" }, "downloads": -1, "filename": "leafy-0.1.0a2.tar.gz", "has_sig": false, "md5_digest": "31cf27e7e97708cb6b949da843f6d4c7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 513906, "upload_time": "2019-02-27T10:07:19", "url": "https://files.pythonhosted.org/packages/e2/31/a0c612557ade3d7c94442fcee95c9dad240df2294381c3d101a148847441/leafy-0.1.0a2.tar.gz" } ] }