yml2dot - Turn YAML into beautiful Graph

yml2dot - Turn YAML into beautiful Graph

Use Cases

  • Visualize your YAML files as Graph
  • Generate additional info from your source code (simply define a YAML block and use this tool)

How yml2dot works?

Takes in input:

  • any YAML file
  • any text file that has YAML between comments (like front matter)

Generates a dot script for Graphviz.

Examples

Visualize a docker-compose YAML file

Given a sample docker-compose.yml file:

version: "3.9"
services:
  redis:
    image: redis:latest
    deploy:
      replicas: 1
    configs:
      - source: my_config
        target: /redis_config
        uid: '103'
        gid: '103'
        mode: 0440
configs:
  my_config:
    file: ./my_config.txt
  my_other_config:
    external: true

Run yml2dot like this:

$ yml2dot docker-compose-sample.yml | dot -Tpng > docker-compose-sample.yml.png

and create this graph:

Grab YAML info embedded in your source code

/*** 
Box:
  Object:
    - set
    - get
***/

public class Box {
    private Object object;

    public void set(Object object) {
        this.object = object;
    }
    public Object get() {
        return object;
    }
}

Use the -from and -to flags to mark your YAML block.

Run yml2dot like this:

$ yml2dot -from '/***' -to '***/' Box.java | dot -Tpng > Box.java.png

and create this graph:

How to install?

In order to use the yml2dot command, compile it using the following command:

go get -u github.com/lucasepe/yml2dot

This will create the executable under your $GOPATH/bin directory.

Ready-To-Use Releases

If you don't want to compile the sourcecode yourself, Here you can find the tool already compiled for:

  • MacOS
  • Linux
  • Windows
Owner
Luca Sepe
𝕋𝕖𝕔𝕙 - Golang | C | [Java]. Design multi-platform pipelines, web scrapers, data ingestion tools.
Luca Sepe
Similar Resources

The DGL Operator makes it easy to run Deep Graph Library (DGL) graph neural network training on Kubernetes

DGL Operator The DGL Operator makes it easy to run Deep Graph Library (DGL) graph neural network distributed or non-distributed training on Kubernetes

Dec 19, 2022

Turn Nginx logs into Prometheus metrics

Nginx log parser and Prometheus exporter This service parses incoming syslog messages from Nginx sent over UDP and converts them into Prometheus metri

Dec 13, 2022

Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.

websocketd websocketd is a small command-line tool that will wrap an existing command-line interface program, and allow it to be accessed via a WebSoc

Dec 31, 2022

turn a directory into a GUI, slash example of VNC-based GUI

dirgui @rsnous on Jan 11, 2021: "idea: filesystem-GUI adapter, where a directory turns into a form, executable files inside that directory turn into

May 3, 2022

Turn shell commands into web services

Turn shell commands into web services

webify Turn functions and commands into web services For a real world example, see turning a Python function into a web service. Overview webify is a

Dec 22, 2022

Turn asterisk-indented text lines into mind maps

Turn asterisk-indented text lines into mind maps

Crumbs Turn asterisk-indented text lines into mind maps. Organize your notes in a hierarchical tree structure, using a simple text editor. an asterisk

Jan 8, 2023

A CLI to turn Go's benchmark output into pictures

benchdraw benchdraw allows you to make easy to read picture plots from data in Go's benchmark format, implemented in pure Go. Benchdraw does not try t

Nov 28, 2022

GoPrisma - A Go wrapper for prisma to turn databases into GraphQL APIs using Go.

GoPrisma - a Go wrapper for the Prisma Engines What's this? Introspect a database and use it as a GraphQL API using Go. Supported Databases: SQLite Po

Dec 20, 2022

webify - Turn functions and commands into web services

webify - Turn functions and commands into web services

webify is a very basic CGI server which forwards all requests to a single script. A design goal is to be as zero-config as possible.

Dec 22, 2022

Turn any key/value index into a high-performance two-dimensional spatial index

Turn any key/value index into a high-performance two-dimensional spatial index

modular-spatial-index For the demo that this animated gif was generated from

Mar 6, 2022

Turn a Spotify playlist into a YouTube playlist

Turn a Spotify playlist into a YouTube playlist

spotlist Turn a Spotify playlist into a YouTube playlist How to use: Download latest version from Releases. (Quick Links: Mac/Windows) Run it Enter Sp

Sep 8, 2022

A plugin that turn hashicorp vault into blockchain wallet.

A plugin that turn hashicorp vault into blockchain wallet.

dq-vault - Hashicorp vault BTC/ETH plugin This vault plugin stores a user's mnemonic inside vault in an encrypted manner. The plugin uses this stored

Dec 7, 2022

Turn a heterogeneous pile of text docs into a single web page with good search.

Turn a heterogeneous pile of text docs into a single web page with good search.

Codex Codex turns an unstructured pile of heterogeneous documents into a single interactive web document. Your input documents maybe in markdown, TeX,

Jan 2, 2022

Turn a grid of frames (stored in a single image) into a video file

Turn a grid of frames (stored in a single image) into a video file

reel2vid Convert a video that is encoded into one large image as many images sid

Dec 19, 2021

Totem - A Go library that can turn a single gRPC stream into bidirectional unary gRPC servers

Totem is a Go library that can turn a single gRPC stream into bidirectional unar

Jan 6, 2023

Turn your Go program(s) into an appliance running on the Raspberry Pi 3 or 4 (or on amd64 PCs!)

Overview gokrazy packs your Go application(s) into an SD card image for the Raspberry Pi 3 or 4 which — aside from the Linux kernel and proprietary Ra

Jan 3, 2023

Turn repo with markdown files into a nice looking blog

Chameleon Chameleon is web application (blog engine) that reflects content from markdown files from a git repository. Powers articles.orsinium.dev. Fe

Oct 30, 2022

Simple DB using yaml. A project for managing the content of yaml files.

DB Yaml Simple DB using yaml. A project for managing the content of yaml files. Table of Contents DB Yaml Features Usage Write to DB Query DB Get Firs

Dec 27, 2022

Go-yaml - Yaml parsing Toolkit For Golang

go-yaml 介绍 gopkg.in/yaml.v3 已经是个非常好用的包,但是在实际开发中总有类型转换带来的麻烦,go-yaml只是在它的基础上,简单的一层

Jan 13, 2022
Comments
  • Any chance for a Jupyternotebook GO sample

    Any chance for a Jupyternotebook GO sample

    hi, I am trying to see if it's possible to convert this into a jupyter notebook based example? Any chance you can share a notebook in your repo? Thanks

  • feature request: accept a yaml string from stdin

    feature request: accept a yaml string from stdin

    Learned about this project recently, very cool!

    In combining with other unix-style commands, I'd love to be able to pipe in a well-formed YAML file as an input, rather than a file, like so:

    cat foo.yaml | yml2dot | dot -Tpng ....
    

    In this example, I have a real yaml file, but I can imagine where I may emit a YAML from some other program to STDOUT, to have another process read it from STDIN.

Slice graph uses graphviz in order to pretty print slices for you.

slicegraph Slice graph uses graphviz in order to make you understand what happens underneath your slices.

Sep 22, 2022
entviz is an ent extension that provides visualization of the schema graph
entviz is an ent extension that provides visualization of the schema graph

entviz entviz is an ent extension that creates visual graph (html file) of your ent's schema. install go get github.com/hedwigz/entviz add this exten

Dec 9, 2022
Graph a histogram from a stream of timestamps 📈📊

Histogram Timestamps You ever find yourself working with a dataset and you want to graph a particular aspect of that data over time, but because you'r

Dec 4, 2021
Tool to visualize the graph of embedded structs in Go projects
Tool to visualize the graph of embedded structs in Go projects

Visualize a hierarchy of embedded Go structs This tool scans a directory of Go source code files to create a visualization of struct embedding in the

Nov 27, 2022
Interactive dependency graph visualization tool for golang
Interactive dependency graph visualization tool for golang

Interactive dependency graph visualization tool for golang using the awesome cytoscape graph visualizer.

Sep 1, 2022
Tool that can parse Go files into an abstract syntax tree and translate it to several programming languages.
Tool that can parse Go files into an abstract syntax tree and translate it to several programming languages.

GoDMT GoDMT, the one and only Go Data Model Translator. The goal of this project is to provide a tool that can parse Go files that include var, const,

Nov 28, 2022
converts text-formats from one to another, it is very useful if you want to re-format a json file to yaml, toml to yaml, csv to yaml, ... etc

re-txt reformates a text file from a structure to another, i.e: convert from json to yaml, toml to json, ... etc Supported Source Formats json yaml hc

Sep 23, 2022
Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

Dec 29, 2022
Split multiple Kubernetes files into smaller files with ease. Split multi-YAML files into individual files.

kubectl-slice: split Kubernetes YAMLs into files kubectl-slice is a neat tool that allows you to split a single multi-YAML Kubernetes manifest into mu

Jan 3, 2023
JSONL graph tools - Graph is represented as JSONL of nodes and edges.

JSONL graph tools - Graph is represented as JSONL of nodes and edges.

Sep 27, 2022