{"id":15633035,"url":"https://github.com/jamesscottbrown/pyyed","last_synced_at":"2025-04-05T23:10:30.483Z","repository":{"id":44035846,"uuid":"91018139","full_name":"jamesscottbrown/pyyed","owner":"jamesscottbrown","description":"A simple Python library to export networks to yEd","archived":false,"fork":false,"pushed_at":"2024-08-07T09:04:34.000Z","size":137,"stargazers_count":85,"open_issues_count":12,"forks_count":38,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T22:07:42.966Z","etag":null,"topics":["hacktoberfest","network","python-libraries","visualization","yed"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesscottbrown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-11T19:56:32.000Z","updated_at":"2025-02-21T21:01:27.000Z","dependencies_parsed_at":"2024-06-19T00:24:19.024Z","dependency_job_id":"543038b0-aff1-4130-b477-aa94c7cd09f2","html_url":"https://github.com/jamesscottbrown/pyyed","commit_stats":{"total_commits":58,"total_committers":9,"mean_commits":6.444444444444445,"dds":"0.27586206896551724","last_synced_commit":"3ce06a073ab3547f8de130c5cf1eb7dc283b20b0"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesscottbrown%2Fpyyed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesscottbrown%2Fpyyed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesscottbrown%2Fpyyed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesscottbrown%2Fpyyed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesscottbrown","download_url":"https://codeload.github.com/jamesscottbrown/pyyed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411235,"owners_count":20934653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","network","python-libraries","visualization","yed"],"created_at":"2024-10-03T10:46:31.224Z","updated_at":"2025-04-05T23:10:30.426Z","avatar_url":"https://github.com/jamesscottbrown.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI](https://img.shields.io/pypi/v/pyyed)](https://pypi.org/project/pyyed)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/pyyed)](https://pypi.org/project/pyyed)\n\n# yEd Py\n\nA simple Python library to export networks to [yEd](http://www.yworks.com/en/products_yed_about.html).\n\nIs is [available from PyPI](https://pypi.org/project/pyyed/).\n\nThe [yEd Graph Editor](https://www.yworks.com/products/yed) supports the [GraphML](http://graphml.graphdrawing.org/) ([GraphML Primer](http://graphml.graphdrawing.org/primer/graphml-primer.html)) file format. \nThis is an open standard based on XML, and is supported by Python libraries such as [NetworkX](https://networkx.github.io/).\nHowever, the details of formatting (rather than network topology) are handled by yEd specific extensions to the standard, which are not supported by other libraries.\n \nI therefore wrote this library to provide an easy interface that lets you specify how a graph should look, and generates corresponding graphML that can be opened in yEd.\n\n## Usage\nThe interface is similar to that of NetworkX:\n\n```python\nimport pyyed\n\ng = pyyed.Graph()\n\ng.add_node('foo', font_family=\"Zapfino\")\ng.add_node('foo2', shape=\"roundrectangle\", font_style=\"bolditalic\", underlined_text=\"true\")\n\ng.add_edge('foo1', 'foo2')\ng.add_node('abc', font_size=\"72\", height=\"100\", shape_fill=\"#FFFFFF\")\n\ng.add_node('bar', label=\"Multi\\nline\\ntext\")\ng.add_node('foobar', label=\"\"\"Multi\n    Line\n    Text!\"\"\")\n\ng.add_edge('foo', 'foo1', label=\"EDGE!\", width=\"3.0\", color=\"#0000FF\", \n               arrowhead=\"white_diamond\", arrowfoot=\"standard\", line_type=\"dotted\")\n\nprint(g.get_graph())\n\n# To write to file:\nwith open('test_graph.graphml', 'w') as fp:\n    fp.write(g.get_graph())\n\n# Or:\ng.write_graph('example.graphml')\n\n# Or, to pretty-print with whitespace:\ng.write_graph('pretty_example.graphml', pretty_print=True)\n\n```\n\nSaving this to a file with a ``.graphml`` extension, opening in yEd, applying  ``Tools -\u003e Fit Node to Label`` and ``Layout -\u003e One-click layout`` produces something like the following:\n\n![](example.png)\n\n### UML\nThe file [``examples/demo-uml.py``](./examples/demo-uml.py), includes an example UML diagram:\n\n![](example-UML.png)\n\nThe arrowheads used in UML class diagrams correspond to ``crows_foot_one_optional`` (association or dependency), ``white_delta`` (inheritance or implementation), ``white_diamond`` (aggregation), and ``diamond`` (composition).\n\n The ``line_type`` is either ``line`` or ``dashed``.\n\n\n\n\n## Options\n\nValid ``node shapes`` are: \"rectangle\", \"rectangle3d\", \"roundrectangle\", \"diamond\", \"ellipse\", \"fatarrow\", \"fatarrow2\", \"hexagon\", \"octagon\", \"parallelogram\", \"parallelogram2\", \"star5\", \"star6\", \"star6\", \"star8\", \"trapezoid\", \"trapezoid2\", \"triangle\", \"trapezoid2\", \"triangle\"\n\nValid ``line_types`` are: \"line\", \"dashed\", \"dotted\", \"dashed_dotted\"\n\nValid ``font_styles`` are: \"plain\", \"bold\", \"italic\", \"bolditalic\"\n\nValid ``arrow_types`` are: \"none\", \"standard\", \"white_delta\", \"diamond\", \"white_diamond\", \"short\", \"plain\", \"concave\", \"concave\", \"convex\", \"circle\", \"transparent_circle\", \"dash\", \"skewed_dash\", \"t_shape\", \"crows_foot_one_mandatory\", \"crows_foot_many_mandatory\", \"crows_foot_many_optional\", \"crows_foot_many_optional\", \"crows_foot_one\", \"crows_foot_many\", \"crows_foot_optional\"\n\n## Development\n\nRequirements:\n\n    $ pip install pytest\n\nRun the tests:\n\n    $ PYTHONPATH=. pytest tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesscottbrown%2Fpyyed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesscottbrown%2Fpyyed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesscottbrown%2Fpyyed/lists"}