Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/pydot-1.4.2.dist-info/METADATA @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 Metadata-Version: 2.1 | |
2 Name: pydot | |
3 Version: 1.4.2 | |
4 Summary: Python interface to Graphviz's Dot | |
5 Home-page: https://github.com/pydot/pydot | |
6 Author: Ero Carrera | |
7 Author-email: ero.carrera@gmail.com | |
8 Maintainer: Peter Nowee | |
9 Maintainer-email: peter@peternowee.com | |
10 License: MIT | |
11 Project-URL: Changelog, https://github.com/pydot/pydot/blob/master/ChangeLog | |
12 Project-URL: Bug Tracker, https://github.com/pydot/pydot/issues | |
13 Keywords: graphviz dot graphs visualization | |
14 Platform: any | |
15 Classifier: Development Status :: 5 - Production/Stable | |
16 Classifier: Intended Audience :: Developers | |
17 Classifier: Intended Audience :: Science/Research | |
18 Classifier: License :: OSI Approved :: MIT License | |
19 Classifier: Natural Language :: English | |
20 Classifier: Operating System :: OS Independent | |
21 Classifier: Programming Language :: Python :: 2 | |
22 Classifier: Programming Language :: Python :: 2.7 | |
23 Classifier: Programming Language :: Python :: 3 | |
24 Classifier: Programming Language :: Python :: 3.4 | |
25 Classifier: Programming Language :: Python :: 3.5 | |
26 Classifier: Programming Language :: Python :: 3.6 | |
27 Classifier: Programming Language :: Python :: 3.7 | |
28 Classifier: Programming Language :: Python :: 3.8 | |
29 Classifier: Programming Language :: Python :: 3.9 | |
30 Classifier: Topic :: Scientific/Engineering :: Visualization | |
31 Classifier: Topic :: Software Development :: Libraries :: Python Modules | |
32 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* | |
33 Description-Content-Type: text/markdown | |
34 Requires-Dist: pyparsing (>=2.1.4) | |
35 | |
36 [![Build Status](https://www.travis-ci.com/pydot/pydot.svg?branch=master)](https://www.travis-ci.com/pydot/pydot) | |
37 [![PyPI](https://img.shields.io/pypi/v/pydot.svg)](https://pypi.org/project/pydot/) | |
38 | |
39 | |
40 About | |
41 ===== | |
42 | |
43 `pydot`: | |
44 | |
45 - is an interface to [Graphviz][1] | |
46 - can parse and dump into the [DOT language][2] used by GraphViz, | |
47 - is written in pure Python, | |
48 | |
49 and [`networkx`][3] can convert its graphs to `pydot`. | |
50 | |
51 Development occurs at [GitHub][11], where you can report issues and | |
52 contribute code. | |
53 | |
54 | |
55 Examples | |
56 ======== | |
57 | |
58 The examples here will show you the most common input, editing and | |
59 output methods. | |
60 | |
61 Input | |
62 ----- | |
63 | |
64 No matter what you want to do with `pydot`, it will need some input to | |
65 start with. Here are 3 common options: | |
66 | |
67 1. Import a graph from an existing DOT-file. | |
68 | |
69 Use this method if you already have a DOT-file describing a graph, | |
70 for example as output of another program. Let's say you already | |
71 have this `example.dot` (based on an [example from Wikipedia][12]): | |
72 | |
73 ```dot | |
74 graph my_graph { | |
75 bgcolor="yellow"; | |
76 a [label="Foo"]; | |
77 b [shape=circle]; | |
78 a -- b -- c [color=blue]; | |
79 } | |
80 ``` | |
81 | |
82 Just read the graph from the DOT-file: | |
83 | |
84 ```python | |
85 import pydot | |
86 | |
87 graphs = pydot.graph_from_dot_file('example.dot') | |
88 graph = graphs[0] | |
89 ``` | |
90 | |
91 2. or: Parse a graph from an existing DOT-string. | |
92 | |
93 Use this method if you already have a DOT-string describing a | |
94 graph in a Python variable: | |
95 | |
96 ```python | |
97 import pydot | |
98 | |
99 dot_string = """graph my_graph { | |
100 bgcolor="yellow"; | |
101 a [label="Foo"]; | |
102 b [shape=circle]; | |
103 a -- b -- c [color=blue]; | |
104 }""" | |
105 | |
106 graphs = pydot.graph_from_dot_data(dot_string) | |
107 graph = graphs[0] | |
108 ``` | |
109 | |
110 3. or: Create a graph from scratch using pydot objects. | |
111 | |
112 Now this is where the cool stuff starts. Use this method if you | |
113 want to build new graphs from Python. | |
114 | |
115 ```python | |
116 import pydot | |
117 | |
118 graph = pydot.Dot('my_graph', graph_type='graph', bgcolor='yellow') | |
119 | |
120 # Add nodes | |
121 my_node = pydot.Node('a', label='Foo') | |
122 graph.add_node(my_node) | |
123 # Or, without using an intermediate variable: | |
124 graph.add_node(pydot.Node('b', shape='circle')) | |
125 | |
126 # Add edges | |
127 my_edge = pydot.Edge('a', 'b', color='blue') | |
128 graph.add_edge(my_edge) | |
129 # Or, without using an intermediate variable: | |
130 graph.add_edge(pydot.Edge('b', 'c', color='blue')) | |
131 ``` | |
132 | |
133 Imagine using these basic building blocks from your Python program | |
134 to dynamically generate a graph. For example, start out with a | |
135 basic `pydot.Dot` graph object, then loop through your data while | |
136 adding nodes and edges. Use values from your data as labels, to | |
137 determine shapes, edges and so forth. This way, you can easily | |
138 build visualizations of thousands of interconnected items. | |
139 | |
140 4. or: Convert a NetworkX graph to a pydot graph. | |
141 | |
142 NetworkX has conversion methods for pydot graphs: | |
143 | |
144 ```python | |
145 import networkx | |
146 import pydot | |
147 | |
148 # See NetworkX documentation on how to build a NetworkX graph. | |
149 | |
150 graph = networkx.drawing.nx_pydot.to_pydot(my_networkx_graph) | |
151 ``` | |
152 | |
153 Edit | |
154 ---- | |
155 | |
156 You can now further manipulate your graph using pydot methods: | |
157 | |
158 - Add further nodes and edges: | |
159 | |
160 ```python | |
161 graph.add_edge(pydot.Edge('b', 'd', style='dotted')) | |
162 ``` | |
163 | |
164 - Edit attributes of graph, nodes and edges: | |
165 | |
166 ```python | |
167 graph.set_bgcolor('lightyellow') | |
168 graph.get_node('b')[0].set_shape('box') | |
169 ``` | |
170 | |
171 Output | |
172 ------ | |
173 | |
174 Here are 3 different output options: | |
175 | |
176 1. Generate an image. | |
177 | |
178 To generate an image of the graph, use one of the `create_*()` or | |
179 `write_*()` methods. | |
180 | |
181 - If you need to further process the output in Python, the | |
182 `create_*` methods will get you a Python bytes object: | |
183 | |
184 ```python | |
185 output_graphviz_svg = graph.create_svg() | |
186 ``` | |
187 | |
188 - If instead you just want to save the image to a file, use one of | |
189 the `write_*` methods: | |
190 | |
191 ```python | |
192 graph.write_png('output.png') | |
193 ``` | |
194 | |
195 2. Retrieve the DOT string. | |
196 | |
197 There are two different DOT strings you can retrieve: | |
198 | |
199 - The "raw" pydot DOT: This is generated the fastest and will | |
200 usually still look quite similar to the DOT you put in. It is | |
201 generated by pydot itself, without calling Graphviz. | |
202 | |
203 ```python | |
204 # As a string: | |
205 output_raw_dot = graph.to_string() | |
206 # Or, save it as a DOT-file: | |
207 graph.write_raw('output_raw.dot') | |
208 ``` | |
209 | |
210 - The Graphviz DOT: You can use it to check how Graphviz lays out | |
211 the graph before it produces an image. It is generated by | |
212 Graphviz. | |
213 | |
214 ```python | |
215 # As a bytes literal: | |
216 output_graphviz_dot = graph.create_dot() | |
217 # Or, save it as a DOT-file: | |
218 graph.write_dot('output_graphviz.dot') | |
219 ``` | |
220 | |
221 3. Convert to a NetworkX graph. | |
222 | |
223 Here as well, NetworkX has a conversion method for pydot graphs: | |
224 | |
225 ```python | |
226 my_networkx_graph = networkx.drawing.nx_pydot.from_pydot(graph) | |
227 ``` | |
228 | |
229 More help | |
230 --------- | |
231 | |
232 For more help, see the docstrings of the various pydot objects and | |
233 methods. For example, `help(pydot)`, `help(pydot.Graph)` and | |
234 `help(pydot.Dot.write)`. | |
235 | |
236 More [documentation contributions welcome][13]. | |
237 | |
238 | |
239 Installation | |
240 ============ | |
241 | |
242 From [PyPI][4] using [`pip`][5]: | |
243 | |
244 `pip install pydot` | |
245 | |
246 From source: | |
247 | |
248 `python setup.py install` | |
249 | |
250 | |
251 Dependencies | |
252 ============ | |
253 | |
254 - [`pyparsing`][6]: used only for *loading* DOT files, | |
255 installed automatically during `pydot` installation. | |
256 | |
257 - GraphViz: used to render graphs as PDF, PNG, SVG, etc. | |
258 Should be installed separately, using your system's | |
259 [package manager][7], something similar (e.g., [MacPorts][8]), | |
260 or from [its source][9]. | |
261 | |
262 | |
263 License | |
264 ======= | |
265 | |
266 Distributed under an [MIT license][10]. | |
267 | |
268 | |
269 Contacts | |
270 ======== | |
271 | |
272 Maintainers: | |
273 - Sebastian Kalinowski <sebastian@kalinowski.eu> (GitHub: @prmtl) | |
274 - Peter Nowee <peter@peternowee.com> (GitHub: @peternowee) | |
275 | |
276 Original author: Ero Carrera <ero.carrera@gmail.com> | |
277 | |
278 | |
279 [1]: https://www.graphviz.org | |
280 [2]: https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29 | |
281 [3]: https://github.com/networkx/networkx | |
282 [4]: https://pypi.python.org/pypi | |
283 [5]: https://github.com/pypa/pip | |
284 [6]: https://github.com/pyparsing/pyparsing | |
285 [7]: https://en.wikipedia.org/wiki/Package_manager | |
286 [8]: https://www.macports.org | |
287 [9]: https://gitlab.com/graphviz/graphviz | |
288 [10]: https://github.com/pydot/pydot/blob/master/LICENSE | |
289 [11]: https://github.com/pydot/pydot | |
290 [12]: https://en.wikipedia.org/w/index.php?title=DOT_(graph_description_language)&oldid=1003001464#Attributes | |
291 [13]: https://github.com/pydot/pydot/issues/130 | |
292 | |
293 |