{"id":25085900,"url":"https://github.com/lomin/spectree","last_synced_at":"2025-09-07T06:05:49.068Z","repository":{"id":62433590,"uuid":"134769110","full_name":"lomin/spectree","owner":"lomin","description":"This library for both Clojure and ClojureScript provides an 'each' selector to use in combination with specter and tree-like data structures. It also provides the macros '+\u003e\u003e' and 'each+\u003e\u003e' to chain specter transformations.","archived":false,"fork":false,"pushed_at":"2018-06-26T17:19:39.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T09:20:28.188Z","etag":null,"topics":["clojure","clojurescript","specter"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lomin.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}},"created_at":"2018-05-24T21:09:32.000Z","updated_at":"2023-01-07T22:38:40.000Z","dependencies_parsed_at":"2022-11-01T21:01:51.677Z","dependency_job_id":null,"html_url":"https://github.com/lomin/spectree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lomin%2Fspectree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lomin%2Fspectree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lomin%2Fspectree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lomin%2Fspectree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lomin","download_url":"https://codeload.github.com/lomin/spectree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246651216,"owners_count":20811989,"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","clojurescript","specter"],"created_at":"2025-02-07T08:30:35.069Z","updated_at":"2025-04-01T13:42:30.026Z","avatar_url":"https://github.com/lomin.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spectree\n\nThis library for both Clojure and ClojureScript provides an 'each' selector to use in combination with specter and tree-like data structures.\nIt also provides the macros '+\u003e\u003e' and 'each+\u003e\u003e' to chain specter transformations.\n\n## Leiningen\n\n*spectree* is available from Clojars. Add the following dependency to your *project.clj*:\n\n[![Clojars Project](https://img.shields.io/clojars/v/me.lomin.spectree.svg)](https://clojars.org/me.lomin.spectree)\n\n## Usage\n\n```clojure\n...\n(require '[me.lomin.spectree.hiccup])\n\n(deftest hiccup-test\n  (is (= [\"bash\" \"top\"]\n         (specter/select (spectree/each [:hiccup/CMD :hiccup/word 1])\n                         [:PS\n                          [:HEADER [:word \"header\"]]\n                          [:LINE\n                           [:UID [:number \"501\"]]\n                           [:PID [:number \"45427\"]]\n                           [:CMD [:word \"bash\"]]]\n                          [:LINE\n                           [:UID [:number \"502\"]]\n                           [:PID [:number \"45428\"]]\n                           [:CMD [:word \"top\"]]]]))))\n                           \n(deftest generic-examples-test\n  (is (= {:a [:x [:c 2]] :e \"add-if-not-here\"}\n           (each+\u003e\u003e specter/transform\n                    :hiccup/b (constantly :x)\n                    :e (constantly \"add-if-not-here\")\n                    :must/f (constantly \"not-here\")\n                    {:a [[:b 1] [:c 2]]})))\n\n  (is (= {:a 6 :b 4}\n         (+\u003e\u003e specter/transform\n              [:a] inc\n              [:b] dec\n              {:a 5 :b 5})))\n\n  (is (= {:a 6 :b 4 :c {:d 6 :e 4 :f [0 2 2]}}\n         ((+\u003e\u003e specter/transform\n               [:a] inc\n               [:c] (+\u003e\u003e specter/transform\n                         [:d] inc\n                         [:e] dec\n                         [:f] (+\u003e\u003e specter/transform\n                                   1 inc))\n               [:b] dec)\n           {:a 5 :b 5 :c {:d 5 :e 5 :f [0 1 2]}}))))       \n                                                          \n```\n\n## License\n\nCopyright © 2018 Steven Collins\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flomin%2Fspectree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flomin%2Fspectree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flomin%2Fspectree/lists"}