{"id":15010112,"url":"https://github.com/jfacorro/eden","last_synced_at":"2025-12-11T23:32:31.770Z","repository":{"id":33343460,"uuid":"36988260","full_name":"jfacorro/Eden","owner":"jfacorro","description":"edn (extensible data notation) encoder/decoder for Elixir","archived":false,"fork":false,"pushed_at":"2024-03-22T12:59:07.000Z","size":235,"stargazers_count":38,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T09:42:24.423Z","etag":null,"topics":["clojure","edn","elixir","serialization"],"latest_commit_sha":null,"homepage":"http://jfacorro.github.io/Eden/","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/jfacorro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-06T17:11:07.000Z","updated_at":"2024-10-10T00:14:53.000Z","dependencies_parsed_at":"2024-05-01T18:27:25.397Z","dependency_job_id":null,"html_url":"https://github.com/jfacorro/Eden","commit_stats":{"total_commits":87,"total_committers":6,"mean_commits":14.5,"dds":"0.22988505747126442","last_synced_commit":"317194d42c252450852fac3d6b97d23b1dc4949c"},"previous_names":["jfacorro/exedn"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfacorro%2FEden","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfacorro%2FEden/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfacorro%2FEden/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfacorro%2FEden/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfacorro","download_url":"https://codeload.github.com/jfacorro/Eden/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244829554,"owners_count":20517329,"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":["clojure","edn","elixir","serialization"],"created_at":"2024-09-24T19:30:20.122Z","updated_at":"2025-12-11T23:32:31.731Z","avatar_url":"https://github.com/jfacorro.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"Eden\n=====\n\n[![GitHub](https://github.com/jfacorro/Eden/workflows/Build/badge.svg)](https://github.com/jfacorro/Eden/actions?query=workflow%3ABuild)\n[![Hex.pm](https://img.shields.io/hexpm/v/eden.svg?style=flat-square)](https://hex.pm/packages/eden)\n[![Hexdocs.pm](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/eden/)\n[![Hex.pm](https://img.shields.io/hexpm/dt/eden.svg?style=flat-square)](https://hex.pm/packages/eden)\n[![Hex.pm](https://img.shields.io/hexpm/l/eden.svg?style=flat-square)](https://hex.pm/packages/eden)\n[![GitHub](https://img.shields.io/github/last-commit/jfacorro/Eden.svg)](https://github.com/jfacorro/Eden/commits/master)\n\n[edn](https://github.com/edn-format/edn) (extensible data notation) encoder/decoder implemented in Elixir.\n\n## Usage\n\nInclude Eden as a dependency in your Elixir project by adding it in your `deps` list:\n\n```elixir\ndef deps do\n  [{:eden, \"~\u003e 0.1.2\"}]\nend\n```\n\nEden is a library application and as such doesn't specify an application callback module. Even so, if you would like to build a release that includes Eden, you need to add it as an application dependency in your `mix.exs`:\n\n```elixir\n  def application do\n    [applications: [:eden]]\n  end\n```\n\n## Examples\n\n```elixir\niex\u003e Eden.encode([1, 2])\n{:ok, \"(1, 2)\"}\n\niex\u003e Eden.encode(%{a: 1, b: 2, c: 3})\n{:ok, \"{:a 1, :b 2, :c 3}\"}\n\niex\u003e Eden.encode({:a, 1})\n{:error, Protocol.UndefinedError}\n\niex\u003e Eden.decode(\"{:a 1 :b 2}\")\n{:ok, %{a: 1, b: 2}}\n\niex\u003e Eden.decode(\"(hello :world \\\\!)\")\n{:ok, [%Eden.Symbol{name: \"hello\"}, :world, %Eden.Character{char: \"!\"}]\n\niex\u003e Eden.decode(\"[1 2 3 4]\")\n{:ok, #Array\u003c[1, 2, 3, 4], fixed=false, default=nil\u003e}\n\niex\u003e Eden.decode(\"nil true false\")\n{:ok, [nil, true, false]}\n\niex\u003e Eden.decode(\"nil true false .\")\n{:error, Eden.Exception.UnexpectedInputError}\n```\n\n## Data Structures Mapping: **edn** \u003c-\u003e **Elixir**\n\n|  Edn | Elixir   |\n|---|---|\n| `nil`      | `:nil = nil` |\n| `true`   | `:true = true` |\n| `false`  | `:false = false` |\n| `string` | `String` |\n| `character` | `Eden.Character` |\n| `symbol`  | `Eden.Symbol` |\n| `keyword`  | `Atom` |\n| `integer`  | `Integer` |\n| `float`  | `Float` |\n| `list`  | `List`  |\n| `vector`  | `Array`  |\n| `map`  | `Map` |\n| `set`  | `MapSet` |\n| `#inst`  | `Timex.DateTime` |\n| `#uuid`  | `Eden.UUID` |\n\n## Further Considerations\n\n### `Character`\n\nThere is no way of distinguishing a common integer from the representation of a character in a `String` or in `Char lists`. This forces the creation of a new representation for this type so it can be correctly translated from and to **edn**.\n\n### Arbitrary Precision `Integer` and `Float`\n\nThe Erlang VM (EVM) only provides arbitrary precision integers so all integers will be of this type this and the `N` modifier will be ignored when parsing an **edn** integer.\n\nOn the other hand native arbitrary precision floating point numbers are not provided by the EVM so all values of type `float` will be represented according to what the EVM supports.\n\n### `Keyword` and `Symbol` Representation\n\nOn one hand the decision to translate **edn** `keyword`s as Elixir `atom`s comes from the fact these two data types are given a similar usage on both languages. On the other, it might get awkward really fast using a new `Eden.Symbol` struct as the representation for **edn**'s `symbol`s so this might change.\n\n### `vector`\n\nThere is no constant lookup or nearly constant indexed data structure like **edn**'s `vector` other than the `:array` data structure implemented in one of Erlang's standard library modules. Until there is a better implementation for this `Eden` will use [`Array`](https://github.com/takscape/elixir-array), an Elixir wrapper library for Erlang's array.\n\n## **edn** grammar\n\n```\nexpr -\u003e literal | map | list | vector | tagged_value\n\nliteral -\u003e nil | true | false | keyword | symbol | integer | float | string\n\nmap -\u003e { pair* }\npair -\u003e expr expr\n\nlist -\u003e ( expr* )\n\nvector -\u003e [ expr* ]\n\ntagged_value -\u003e tag expr\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfacorro%2Feden","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfacorro%2Feden","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfacorro%2Feden/lists"}