Skip to content

This Python module generates a Graphviz-compatible formatted graph that represents the type hierarchy of all the classes in the specified Python modules

License

Notifications You must be signed in to change notification settings

danielrozenberg/python-type-to-graphviz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Type-Hierarchy to Graphviz Generator

This Python module generates a Graphviz-compatible formatted graph that represents the type hierarchy of all the classes in the specified Python modules.

Tested on Python 3.7 and 3.10.

Usage

import type_to_graphviz

# Generate a type hierarchy graph for built in classes only.
type_to_graphviz.generate_graphviz(__builtins__)

# Generate a type hierarchy graph for built in classes and for the collections
# and abstract collections modules.
import collections
type_to_graphviz.generate_graphviz(__builtins__, collections, collections.abc)

Save the output to a file or copy and paste it into an online Graphviz renderer such as WebGraphviz.

Executing the file directly will generate a graph for built in classes, and the collections, collections.abc, and datetime modules.

Sample graph

About

This Python module generates a Graphviz-compatible formatted graph that represents the type hierarchy of all the classes in the specified Python modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages