{"id":16779593,"url":"https://github.com/mikolak-net/travesty","last_synced_at":"2026-03-11T05:01:22.880Z","repository":{"id":57737437,"uuid":"116332013","full_name":"mikolak-net/travesty","owner":"mikolak-net","description":"Diagram- and graph-generating library for Akka Streams","archived":false,"fork":false,"pushed_at":"2021-05-10T15:23:00.000Z","size":142,"stargazers_count":95,"open_issues_count":4,"forks_count":7,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-07T23:52:57.219Z","etag":null,"topics":["akka","akka-streams","scala","utility-library"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikolak-net.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2018-01-05T02:39:55.000Z","updated_at":"2024-10-25T19:10:30.000Z","dependencies_parsed_at":"2022-08-24T14:59:42.006Z","dependency_job_id":null,"html_url":"https://github.com/mikolak-net/travesty","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mikolak-net/travesty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolak-net%2Ftravesty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolak-net%2Ftravesty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolak-net%2Ftravesty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolak-net%2Ftravesty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikolak-net","download_url":"https://codeload.github.com/mikolak-net/travesty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolak-net%2Ftravesty/sbom","scorecard":{"id":646426,"data":{"date":"2025-08-11","repo":{"name":"github.com/mikolak-net/travesty","commit":"251f823850772234dcd9579e468ac5c72c8034b9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T12:15:37.667Z","repository_id":57737437,"created_at":"2025-08-21T12:15:37.667Z","updated_at":"2025-08-21T12:15:37.667Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30372125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["akka","akka-streams","scala","utility-library"],"created_at":"2024-10-13T07:30:51.471Z","updated_at":"2026-03-11T05:01:22.856Z","avatar_url":"https://github.com/mikolak-net.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Travesty\n:repoBaseUrl: https://github.com/mikolak-net/travesty\n:fileBrowseBaseUrl: {repoBaseUrl}/blob/master/\n:issueBaseUrl: {repoBaseUrl}/issues/\n:toc:\n:icons: font\n\nimage:https://travis-ci.org/mikolak-net/travesty.svg?branch=master[\"Build Status\", link=\"https://travis-ci.org/mikolak-net/travesty\"]image:https://maven-badges.herokuapp.com/maven-central/net.mikolak/travesty_2.13/badge.svg[\"Latest 2.13 version\", link=\"https://maven-badges.herokuapp.com/maven-central/net.mikolak/travesty_2.13\"]\nimage:https://maven-badges.herokuapp.com/maven-central/net.mikolak/travesty_2.12/badge.svg[\"Latest 2.12 version\", link=\"https://maven-badges.herokuapp.com/maven-central/net.mikolak/travesty_2.12\"]\n\n== What is it?\n\nTravesty is a utility library for Akka Streams. It has two uses:\n\n - generating structural diagrams of your Akka Streams, both as graphics and text (the latter\n useful for logging). Example:\n\nimage::doc/example_graph.svg[]\n\n - generating https://tinkerpop.apache.org/[Tinkerpop 3 / Gremlin^] graph data structures - usable for e.g. writing tests that check stage sequencing in dynamically constructed Streams.\n\n== What's new?\n\n=== 0.9.2\n\n- Switched to Scala 2.13 and updated dependencies (also relased support for  2.6.10 to 2.6.14 for Scala 2.12, as 0.9.1)\n\n=== 0.9.1\n\n- Fixed issue with graph not generating when some of the stages have no names (thanks to @FXHibon for the fix).\n\n=== 0.9\n\n- Added support for partial graphs (see below for example),\n- Added support for Akka 2.5.10-11.\n\n=== 0.8\n\n- Added \"manual support\" for typed diagrams/graphs (see link:#typed-diagrams[Typed diagrams]),\n- made Graphviz engine selection configurable for better speed/compatibility ({issueBaseUrl}3[#3^]),\n- fixed {issueBaseUrl}4[#4^],\n- extended Akka version support up to 2.5.9 .\n\n== How to use it\n\n=== Include in your project\n\nAdd to your `build.sbt`\n\n[source,scala]\n----\n//repo of dependency used for text rendering\nresolvers += \"indvd00m-github-repo\" at \"https://raw.githubusercontent.com/indvd00m/maven-repo/master/repository\"\n\n\"net.mikolak\" %% \"travesty\" % \"0.9_AKKAVERSION\"\n//for example \"net.mikolak\" %% \"travesty\" % \"0.9_2.5.11\"\n----\n\nWhere `AKKAVERSION` is the version of Akka (Streams) you're using in your project. Currently supported\nare versions `2.5.[4-11]`, and Scala `2.12`.\n\nYou can review all available versions on link:http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22net.mikolak%22%20AND%20a%3A%22travesty_2.12%22[Maven Central^].\n\n=== Diagram generation\n\n[source,scala]\n----\nimport net.mikolak.travesty\nimport net.mikolak.travesty.OutputFormat\n\nval graph = ??? //your graph here\n\n//render as image to file, PNG is supported as well\ntravesty.toFile(graph, OutputFormat.SVG)(\"/tmp/stream.svg\")\n\n//render as text \"image\"\nlog.info(travesty.toString(graph)) //take care NOT to wrap the text\n----\n\n==== Example text output\n\nHere's how a typical `travesty.toString(graph)` may look like:\n\n[source]\n----\n                 *********                                                                                                                                  *******                \n              ****       ****                                                                                                                             **       **              \n             *               *                                                                                                                                                     \n                  *INLET*                                                                                                                               *   seqSink   *            \n             *               *                                                                                                                                                     \n              ****       ****                                                                                                                  ●●●        **       **              \n                 *********         ●●●                                                                                                        ●●  ●●        *******                \n                                      ●●●●●                                                                                                 ●●   ●●                                \n                                           ●●●●●●  ●                                                                                   ●●●●●    ●                                  \n                                                 ●●●●●           *********                                  *********             ●●●●●                                            \n                                                   ●●●●       ****       ****                             ***       ***        ●●●                                                 \n                                                             *               *               ●●          *             *                                                           \n                                                                 ZipWith2            ●●●●●●●●● ●●       *   broadcast   *                                                          \n                                                             *               *                ●●         *             *                                                           \n                                                              ****       ****                ●            ***       ***                                                            \n                                                   ●●●●          *********                                  *********          ●●                                                  \n                                            ●●●●●●●●●●                                                                           ●●●●       ●                                      \n                                        ●●●●       ●                                                                                 ●●●●●   ●●                                    \n               *************          ●●                                                                                                  ●●●●●●         *************             \n            *******************                                                                                                            ●●          *******   *******           \n           **                 **                                                                                                                      *                 *          \n               singleSource                                                                                                                          *     *OUTLET*      *         \n           **                 **                                                                                                                      *                 *          \n            *******************                                                                                                                        *******   *******           \n               *************                                                                                                                             *************             \n                                                                                                                                                                                   \n                                                                                                                                                                                   \n                                                                                                                                                                                   \n                                                                                                                                                                                   \n                                                                                                                                                                                   \n                                                                                                                                                                                   \n                                                                          Flow[String,String,akka.NotUsed] \n----\n\nAnd here's the same example in a vertical orientation, i.e. `travesty.toString(graph, direction = BottomToTop)`:\n\n[source]\n----\n               *************                               *********           \n            *******************                         ****       ****        \n           **                 **                       *               *       \n               singleSource                                 *INLET*            \n           **                 **                       *               *       \n            *******************                         ****       ****        \n               *************                               *********           \n                                                                               \n                                                                               \n                          ●                              ●                     \n                           ●                            ●                      \n                           ●                            ●                      \n                            ●                          ●                       \n                             ●                        ●                        \n                              ●                      ●                         \n                              ●                      ●                         \n                               ●                    ●                          \n                                ●                  ●                           \n                                 ● ●            ● ●                            \n                                  ●●           ● ●                             \n                                 ● ●           ● ●●                            \n                                  ●●●         ●●●                              \n                                    ●         ●                                \n                                                                               \n                                     *********                                 \n                                  ****       ****                              \n                                 *               *                             \n                                     ZipWith2                                  \n                                 *               *                             \n                                  ****       ****                              \n                                     *********                                 \n                                                                               \n                                                                               \n                                         ●                                     \n                                         ●                                     \n                                         ●                                     \n                                         ●                                     \n                                         ●                                     \n                                         ●                                     \n                                         ●                                     \n                                         ●                                     \n                                         ●                                     \n                                        ●● ●                                   \n                                        ● ●                                    \n                                         ●●                                    \n                                         ●                                     \n                                                                               \n                                                                               \n                                     *********                                 \n                                   ***       ***                               \n                                  *             *                              \n                                 *   broadcast   *                             \n                                  *             *                              \n                                   ***       ***                               \n                                     *********                                 \n                                                                               \n                                                                               \n                                     ●        ●                                \n                                    ●          ●                               \n                                   ●           ●                               \n                                  ●             ●                              \n                                 ●               ●                             \n                                ●                 ●                            \n                               ●                   ●                           \n                              ●                     ●                          \n                              ●                      ●                         \n                            ●●                        ●●                       \n                            ● ●                      ● ●                       \n                           ●●●                        ●●●                      \n                           ●                            ●                      \n                                                                               \n                                                                               \n                *************                             *******              \n              *******   *******                         **       **            \n             *    *OUTLET*     *                          seqSink              \n            *                   *                     *             *          \n             *                 *                                               \n              *******   *******                         **       **            \n                *************                             *******              \n                                                                               \n                                                                               \n                                                                               \n                                                                               \n                                                                               \n                        Flow[String,String,akka.NotUsed] \n----\n\n=== Naming stages\n\nTravesty uses the `name` attribute, which all graph stages have, to label the nodes of the graphs. This means you can\neasily override the naming by invoking `.named` on the relevant stage.\n\nThis example:\n\n[source,scala]\n----\nSource.single(\"t\").named(\"beginning\") \u003c1\u003e\n .map(_ + \"a\")\n .to(Sink.ignore.named(\"end\")) \u003c2\u003e\n----\n\u003c1\u003e custom name\n\u003c2\u003e another custom name\n\nwill render as:\n\nimage::doc/example_named.svg[]\n\nAlternatively, if you're making a one-shot sketch, you can render the image as an SVG, and edit the names as text in any SVG editor such as Inkscape.\n\n\n=== Partial graphs\n\nTravesty now supports Akka Stream graphs with any shape.\n\nFor example, this:\n\n[source,scala]\n----\nFlow[String].map(_ + \"a\").to(Sink.ignore)\n----\n\nwill render as:\n\nimage::doc/example_partial_graph.svg[]\n\nThe labels for open inlets and outlets are configurable via the `partial-names` section of the config:\n\n[source,hocon]\n----\ntravesty.partial-names {\n        inlet  = \"*INLET*\"\n        outlet = \"*OUTLET*\"\n}\n----\n\n=== Typed diagrams\n\nCurrently, it works like this:\n\n[source,scala]\n----\nimport net.mikolak.travesty\nimport net.mikolak.travesty.OutputFormat\nimport registry._ //adds special .↓ and .register methods to stages\n\nval graph = Source.single(\"1\").↓.via(Flow[String].map(_.toInt).↓).to(Sink.seq)\n\n//render as image to file, PNG is supported as well\ntravesty.toFile(graph, OutputFormat.SVG)(\"/tmp/stream.svg\")\n----\n\nimage::doc/example_typed_graph.svg[]\n\n`register`, aliased to `↓`, is a special pass-through extension method that allows Travesty to recognize the types going through your stream. Append `.register`/`.↓` to every stage you need type labels for.\n\nAutomatic support is coming, but unfortunately is a non-trivial problem to solve. For more details, see issue {issueBaseUrl}1[#1^].\n\n=== Graph testing\n\n[source,scala]\n----\nimport net.mikolak.travesty\nimport gremlin.scala._ //traversal operations\n\nval graph = ??? //your graph here\n\nval tested = travesty.toAbstractGraph(graph)\n\n//checks whether the only path through the stream has length two\ntested.E().simplePath().toList() must have size 2\n----\n\nFor more examples, see e.g. link:blob/master/src/test/scala/net/mikolak/travesty/TravestyToGraphSpec.scala[`TravestyToGraphSpec`^].\n\nFor general examples of what you can do with Gremlin in Scala, see the appropriately named\nhttps://github.com/mpollmeier/gremlin-scala[gremlin-scala project^].\n\n=== Advanced usage\n\nFor further tweaking the rendering, you can use `LowLevelApi`:\n\n[source,scala]\n----\nval vizGraph = LowLevelApi.toVizGraph(travesty.toAbstractGraph(graph))\n\n//use the instance to change splines, node shapes, etc. etc.\n\n//and finally, use the Java API to render\nvizGraph.render(Format.PNG)\n----\n\n== How does it work?\n\nGenerally, creating a graph of an Akka Stream is *hard*. This is because it's difficult to \"get to\"\nthe internals of a Stream and infer its structure. There definitely is no easy solution.\n\nTravesty \"cheats\" by using https://github.com/akka/akka/blob/master/akka-stream/src/main/scala/akka/stream/impl/TraversalBuilder.scala[the internal `Traversal` API^]. The `Traversal` is a stack-like structure containing instructions on how to construct a running `Stream`.\n\nThis stack is parsed and converted into a Gremlin graph, convenient for annotating, pre-processing (e.g. additional decoration of Sources and Sinks), and testing.\n\nThe Gremlin graph is converted into a https://graphviz.gitlab.io/[Graphviz^] graph, using https://github.com/nidi3/graphviz-java[graphviz-java^].\n\nFinally, the Graphviz graph is rendered into the required output format.\n\n== Caveats\n\n=== No materialization annotations (for now)\n\nCompletely doable, but not present in the current version. Track {issueBaseUrl}2[#2^] to be notified when this gets added.\n\n=== Represents the graph \"blueprint\", not running stream\n\nThe graph/diagram generated from the `Traversal` object does not correspond 1:1 to what will be present in the running Stream. There are at least two reasons for this:\n\n - the default materializer uses https://doc.akka.io/docs/akka/current/stream/stream-flows-and-basics.html?language=scala#operator-fusion[fusing^] to join stages that can be processed synchronously;\n - there can be other optimizations used by the materializer, such as ignoring stages, adding new stages, etc. Currently, the most prominent are the \"virtual\" `Sink` stages that can appear in some scenarios.\n\n=== Slooooow\n\n`graphviz-java` provides several implementations of Graphviz to use. However, the one selected as default\nby `travesty`, for maximum portability, is also the slowest one. While generating the graph is always fast,\nrendering the diagram may take up to ~10 seconds.\n\n*If you would like to try switching to a faster engine, see {fileBrowseBaseUrl}src/main/resources/reference.conf[`reference.conf`] for more info.*\n\n=== Tight coupling with Akka Stream's internals\n\nAs mentioned before, `travesty` uses the internal API for graph/diagram generation. This is why the\nversion number follows Akka's versioning scheme.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolak-net%2Ftravesty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikolak-net%2Ftravesty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolak-net%2Ftravesty/lists"}