{"id":26194266,"url":"https://github.com/active-group/active-data-translate","last_synced_at":"2026-02-18T02:04:46.045Z","repository":{"id":259464513,"uuid":"874784758","full_name":"active-group/active-data-translate","owner":"active-group","description":"A library to define data translations based on realms.","archived":false,"fork":false,"pushed_at":"2025-02-28T09:12:46.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-26T20:32:43.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/active-group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-10-18T13:05:53.000Z","updated_at":"2025-02-28T09:12:50.000Z","dependencies_parsed_at":"2024-10-25T18:19:54.247Z","dependency_job_id":"7a88f82a-7610-4c30-a06d-221e9ece8918","html_url":"https://github.com/active-group/active-data-translate","commit_stats":null,"previous_names":["active-group/active-data-translate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/active-group/active-data-translate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-data-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-data-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-data-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-data-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/active-group","download_url":"https://codeload.github.com/active-group/active-data-translate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/active-group%2Factive-data-translate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271093053,"owners_count":24697921,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"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":[],"created_at":"2025-03-12T01:55:59.492Z","updated_at":"2025-10-16T13:29:42.082Z","avatar_url":"https://github.com/active-group.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/v/de.active-group/active-data-translate.svg)](https://clojars.org/de.active-group/active-data-translate)\n[![cljdoc badge](https://cljdoc.org/badge/de.active-group/active-data-translate)](https://cljdoc.org/d/de.active-group/active-data-translate/CURRENT)\n\nThis goal of this library is to facilitate translating back and forth\nbetween data in a form described by [[realms]] and a different form,\nusually EDN or Transit.\n\n[Latest Version](https://clojars.org/de.active-group/active-data-translate)\n\n[API Docs](https://cljdoc.org/d/de.active-group/active-data-translate/CURRENT)\n\n## Introduction\n\nGiven some data described by realms, for example a record:\n\n```clojure\n(require '[active.data.record :as r])\n(require '[active.data.realm :as realm])\n\n(r/def-record user\n  [user-id realm/integer\n   user-name realm/string])\n```\n\nWe can define a format that translates between instances of the record\nan EDN compatible map representation of the record, and identity\ntranslations for strings and integers:\n\n```clojure\n(require '[active.data.translate.format :as format])\n(require '[active.data.translate.formatter :as formatter])\n\n(def my-edn-format\n  (format :my-edn-format\n          {realm/string formatter/id\n           realm/integer formatter/id\n           user (formatter/record-map user {user-id :id\n                                            user-name :name})}))\n```\n\nUsing the format, we can create functions that translate between the\ntwo:\n\n```clojure\n(require '[active.data.translate.core :as translate])\n\n(def edn-from-user (translate/translator-from user my-edn-format))\n(def edn-to-user (translate/translator-to user my-edn-format))\n\n(= {:id 1 :name \"Alice\"}\n   (edn-from-user (user user-id 1 user-name \"Alice\"))\n\n(= (user user-id 1 user-name \"Alice\")\n   (edn-to-user {:id 1 :name \"Alice\"})\n```\n\n## License\n\nCopyright © 2024 Active Group GmbH\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factive-group%2Factive-data-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factive-group%2Factive-data-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factive-group%2Factive-data-translate/lists"}