{"id":17193265,"url":"https://github.com/asummers/erlex","last_synced_at":"2025-10-18T13:02:54.050Z","repository":{"id":50911591,"uuid":"141860537","full_name":"asummers/erlex","owner":"asummers","description":"Convert Erlang style structs and error messages to equivalent Elixir.","archived":false,"fork":false,"pushed_at":"2024-04-26T15:32:49.000Z","size":79,"stargazers_count":34,"open_issues_count":6,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T03:04:37.851Z","etag":null,"topics":["dialyxir","dialyzer","elixir","elixir-lang","erlang"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/asummers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-22T02:42:00.000Z","updated_at":"2023-06-16T20:24:13.000Z","dependencies_parsed_at":"2022-09-14T01:14:20.163Z","dependency_job_id":null,"html_url":"https://github.com/asummers/erlex","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asummers%2Ferlex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asummers%2Ferlex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asummers%2Ferlex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asummers%2Ferlex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asummers","download_url":"https://codeload.github.com/asummers/erlex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710439,"owners_count":21149188,"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":["dialyxir","dialyzer","elixir","elixir-lang","erlang"],"created_at":"2024-10-15T01:43:40.377Z","updated_at":"2025-10-18T13:02:54.027Z","avatar_url":"https://github.com/asummers.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Hex version badge](https://img.shields.io/hexpm/v/erlex.svg)](https://hex.pm/packages/erlex)\n[![Hex docs badge](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/erlex/)\n[![Total download badge](https://img.shields.io/hexpm/dt/erlex.svg)](https://hex.pm/packages/erlex)\n[![License badge](https://img.shields.io/hexpm/l/erlex.svg)](https://github.com/asummers/erlex/blob/master/LICENSE.md)\n[![Build status badge](https://img.shields.io/circleci/project/github/asummers/erlex/master.svg)](https://circleci.com/gh/asummers/erlex/tree/master)\n[![Code coverage badge](https://img.shields.io/codecov/c/github/asummers/erlex/master.svg)](https://codecov.io/gh/asummers/erlex/branch/master)\n[![Last Updated badge](https://img.shields.io/github/last-commit/asummers/erlex.svg)](https://github.com/asummers/erlex/commits/master)\n\n# Erlex\n\nConvert Erlang style structs and error messages to equivalent Elixir.\n\nUseful for pretty printing things like Dialyzer errors and Observer\nstate. NOTE: Because this code calls the Elixir formatter, it requires\nElixir 1.6+.\n\n## Documentation\n[Hex Docs](https://hexdocs.pm/erlex).\n\n## Changelog\n\nCheck out the [Changelog](https://github.com/asummers/erlex/blob/master/CHANGELOG.md).\n\n## Installation\n\nThe package can be installed from Hex by adding `erlex` to your list\nof dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:erlex, \"~\u003e 0.2\"},\n  ]\nend\n```\n\n## Usage\n\nInvoke `Erlex.pretty_print/1` with the input string.\n\n```elixir\niex\u003e str = ~S\"('Elixir.Plug.Conn':t(),binary() | atom(),'Elixir.Keyword':t() | map()) -\u003e 'Elixir.Plug.Conn':t()\"\niex\u003e Erlex.pretty_print(str)\n(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()\n```\n\nWhile the lion's share of the work is done via invoking\n`Erlex.pretty_print/1`, other higher order functions exist for further\nformatting certain messages by running through the Elixir formatter.\nBecause we know the previous example is a type, we can invoke the\n`Erlex.pretty_print_contract/1` function, which would format that\nappropriately for very long lines.\n\n```elixir\niex\u003e str = ~S\"('Elixir.Plug.Conn':t(),binary() | atom(),'Elixir.Keyword':t() | map(), map() | atom(), non_neg_integer(), binary(), binary(), binary(), binary(), binary()) -\u003e 'Elixir.Plug.Conn':t()\"\niex\u003e Erlex.pretty_print_contract(str)\n(\n  Plug.Conn.t(),\n  binary() | atom(),\n  Keyword.t() | map(),\n  map() | atom(),\n  non_neg_integer(),\n  binary(),\n  binary(),\n  binary(),\n  binary(),\n  binary()\n) :: Plug.Conn.t()\n```\n\n## Contributing\n\nWe welcome contributions of all kinds! To get started, click [here](https://github.com/asummers/erlex/blob/master/CONTRIBUTING.md).\n\n## Code of Conduct\n\nBe sure to read and follow the [code of conduct](https://github.com/asummers/erlex/blob/master/code-of-conduct.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasummers%2Ferlex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasummers%2Ferlex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasummers%2Ferlex/lists"}