{ "info": { "author": "Anneya Golob", "author_email": "anneyagolob@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pySankey\n\nUses matplotlib to create simple \nSankey diagrams flowing only from left to right.\n\n## Requirements\n\nRequires python-tk (for python 2.7) or python3-tk (for python 3.x) you can\ninstall the other requirements with:\n\n``` bash\n pip install -r requirements.txt\n```\n\n## Example\n\nWith fruits.txt :\n\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
truepredicted
0blueberryorange
1limeorange
2blueberrylime
3appleorange
.........
996limeorange
997blueberryorange
998orangebanana
999applelime
\n

1000 rows \u00d7 2 columns

\n
\n\nYou can generate a sankey's diagram with this code:\n\n```python\nimport sankey\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\npd.options.display.max_rows=8\n%matplotlib inline\n\ndf = pd.read_csv('fruits.txt',sep = ' ',names=['true','predicted'])\ncolorDict = {'apple':'#f71b1b','blueberry':'#1b7ef7','banana':'#f3f71b',\n 'lime':'#12e23f','orange':'#f78c1b'}\nsankey.sankey(df['true'], df['predicted'], aspect=20, colorDict=colorDict,\n fontsize=1, figure_name=\"fruit\")\n```\n\n![Fruity Alchemy](fruits.png)\n\nYou could also use weight:\n\n```\n,customer,good,revenue\n0,John,fruit,5.5\n1,Mike,meat,11.0\n2,Betty,drinks,7.0\n3,Ben,fruit,4.0\n4,Betty,bread,2.0\n5,John,bread,2.5\n6,John,drinks,8.0\n7,Ben,bread,2.0\n8,Mike,bread,3.5\n9,John,meat,13.0\n```\n\n```python\nimport sankey\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\npd.options.display.max_rows=8\n%matplotlib inline\ndf = pd.read_csv('customers-goods.csv',sep = ',',names=['id', 'customer','good','revenue'])\n# actual call is left as an exercice to the reader but it could be something like\n#\u00a0sankey.sankey(left=df['customer'], right=df['good'], rightWeight=df['revenue'],\n# aspect=20, colorDict=colorDict, fontsize=20,\n# figure_name=\"customer-good\")\n```\n\n![Customer goods](customers-goods.png)\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/anazalea/pySankey", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pySankey", "package_url": "https://pypi.org/project/pySankey/", "platform": "", "project_url": "https://pypi.org/project/pySankey/", "project_urls": { "Homepage": "https://github.com/anazalea/pySankey" }, "release_url": "https://pypi.org/project/pySankey/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Make simple, pretty Sankey Diagrams", "version": "0.0.1" }, "last_serial": 4005702, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "994e10f9b9c09e293fca14dde17679f2", "sha256": "71e5a3cb3c840cf0d8c4056d53f337c7e833f3c98cff05b9e53fbc79f3c5a0b1" }, "downloads": -1, "filename": "pySankey-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "994e10f9b9c09e293fca14dde17679f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4912, "upload_time": "2018-06-27T02:01:47", "url": "https://files.pythonhosted.org/packages/ad/fc/c2823db63e0efe3652759a4de2859ed02fe5479bb1ba720605cd789121e5/pySankey-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29ec302761d4deafc06c3914ef539294", "sha256": "0c50e02242926883ad7a26664b2a79f87111460b6989a8ad090b7d95deb474c0" }, "downloads": -1, "filename": "pySankey-0.0.1.tar.gz", "has_sig": false, "md5_digest": "29ec302761d4deafc06c3914ef539294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4757, "upload_time": "2018-06-27T02:01:49", "url": "https://files.pythonhosted.org/packages/b3/f2/0a9f3de3ee054fddb1354c5c4a93d72b611d8c5b4dde34f664f1caeeb384/pySankey-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "994e10f9b9c09e293fca14dde17679f2", "sha256": "71e5a3cb3c840cf0d8c4056d53f337c7e833f3c98cff05b9e53fbc79f3c5a0b1" }, "downloads": -1, "filename": "pySankey-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "994e10f9b9c09e293fca14dde17679f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4912, "upload_time": "2018-06-27T02:01:47", "url": "https://files.pythonhosted.org/packages/ad/fc/c2823db63e0efe3652759a4de2859ed02fe5479bb1ba720605cd789121e5/pySankey-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29ec302761d4deafc06c3914ef539294", "sha256": "0c50e02242926883ad7a26664b2a79f87111460b6989a8ad090b7d95deb474c0" }, "downloads": -1, "filename": "pySankey-0.0.1.tar.gz", "has_sig": false, "md5_digest": "29ec302761d4deafc06c3914ef539294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4757, "upload_time": "2018-06-27T02:01:49", "url": "https://files.pythonhosted.org/packages/b3/f2/0a9f3de3ee054fddb1354c5c4a93d72b611d8c5b4dde34f664f1caeeb384/pySankey-0.0.1.tar.gz" } ] }