{"id":32195231,"url":"https://github.com/invetica/uri","last_synced_at":"2025-10-22T02:10:15.755Z","repository":{"id":62432990,"uuid":"88433598","full_name":"invetica/uri","owner":"invetica","description":"Specs, generators, and common utilities for URIs.","archived":false,"fork":false,"pushed_at":"2017-08-03T11:09:28.000Z","size":21,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-19T21:49:05.814Z","etag":null,"topics":["clojure","generative-testing","spec","specification","uri"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/invetica.png","metadata":{"files":{"readme":"README.org","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":"2017-04-16T18:16:15.000Z","updated_at":"2023-08-07T08:16:05.000Z","dependencies_parsed_at":"2022-11-01T20:45:46.615Z","dependency_job_id":null,"html_url":"https://github.com/invetica/uri","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/invetica/uri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Furi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Furi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Furi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Furi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invetica","download_url":"https://codeload.github.com/invetica/uri/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invetica%2Furi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280365621,"owners_count":26318385,"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-10-22T02:00:06.515Z","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":["clojure","generative-testing","spec","specification","uri"],"created_at":"2025-10-22T02:04:51.429Z","updated_at":"2025-10-22T02:10:15.750Z","avatar_url":"https://github.com/invetica.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+STARTUP: showall\n\n*URI* makes working with URIs a little more convenient, without duplicating the\nexisting functionality provided by Java.\n\n#+BEGIN_HTML\n\u003ca href=\"https://circleci.com/gh/invetica/uri\"\u003e\n  \u003cimg src=\"https://circleci.com/gh/invetica/uri.svg\"\u003e\u003c/img\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://clojars.org/invetica/uri\"\u003e\n  \u003cimg src=\"https://img.shields.io/clojars/v/invetica/uri.svg\"\u003e\u003c/img\u003e\n\u003c/a\u003e\n#+END_HTML\n\n* Contents                                                              :TOC:\n- [[#warning-data-readers-included][Warning! Data readers included]]\n- [[#usage][Usage]]\n  - [[#manipulation][Manipulation]]\n  - [[#specs][Specs]]\n- [[#license][License]]\n\n* Warning! Data readers included\nThis library includes a reader literal that will affect the way Clojure writes\ninstances of ~java.net.URI~. If your do not want a URI to end up looking like\nthe example below, do not add this to your codebase.\n\n#+begin_src clojure\n  {:user/name \"Charlie Collie\"\n   :user/website #invetica/uri \"https://myspace.com/charlie.223\"}\n#+end_src\n\n* Usage\n** Manipulation\nTo make is easier to modify URIs we have a ~invetica.uri/parse~ function that\nwill convert something URI-like into a persistent hash map.\n\n#+begin_src clojure\n  (require '[invetica.uri :as uri])\n\n  (uri/parse \"https://rich:S3creT@example.com:9999/foo?a=1\u0026a=2\")\n  ;; =\u003e #:invetica.uri{:absolute? true\n  ;;                   :host \"example.com\"\n  ;;                   :password \"S3creT\"\n  ;;                   :path \"/foo\"\n  ;;                   :port 9999\n  ;;                   :query-string \"a=1\u0026a=2\"\n  ;;                   :scheme \"https\"\n  ;;                   :user \"rich\"\n  ;;                   :user-info \"rich:S3creT\"}\n#+end_src\n\nTo convert a URI map back into a URI you can use ~invetica.uri/unparse~.\n\n#+begin_src clojure\n  (uri/unparse #:invetica.uri{:absolute? true\n                              :host \"example.com\"\n                              :password \"S3creT\"\n                              :path \"/foo\"\n                              :port 9999\n                              :query-string \"a=1\u0026a=2\"\n                              :scheme \"https\"\n                              :user \"rich\"\n                              :user-info \"rich:S3creT\"})\n  ;; =\u003e #invetica/uri \"https://rich:S3creT@example.com:9999/foo?a=1\u0026a=2\"\n#+end_src\n\nThis makes it's easy to change any part of the URI using familiar Clojure\nfunctions like ~assoc~, ~merge~, ~update~, etc. An example of changing the path\nin a URI looks like this:\n\n#+begin_src clojure\n  (-\u003e \"https://example.com/foo?bar=baz#quux\"\n      uri/parse\n      (assoc ::uri/path \"/WOOT\")\n      uri/unparse)\n  ;; =\u003e #invetica/uri \"https://example.com/WOOT?bar=baz#quux\"\n#+end_src\n\nDon't forget to use the ~:invetica.uri~ namespace! ~:path~ would not work in the\nabove example.\n\n** Specs\nSee the example in ~dev/invetica/uri/example.clj~.\n\nThe following specs are included:\n\n#+begin_src clojure :exports none\n  (-\u003e\u003e (clojure.spec.alpha/registry)\n       keys\n       (filter keyword?)\n       (filter #(= \"invetica.uri\" (namespace %)))\n       sort)\n#+end_src\n\n- ~:invetica.uri/absolute-uri~\n- ~:invetica.uri/absolute-uri-str~\n- ~:invetica.uri/absolute?~\n- ~:invetica.uri/authority~\n- ~:invetica.uri/domain-part~\n- ~:invetica.uri/fragment~\n- ~:invetica.uri/host~\n- ~:invetica.uri/hostname~\n- ~:invetica.uri/ipv4~\n- ~:invetica.uri/ipv6~\n- ~:invetica.uri/octet~\n- ~:invetica.uri/password~\n- ~:invetica.uri/path~\n- ~:invetica.uri/port~\n- ~:invetica.uri/query-string~\n- ~:invetica.uri/relative-uri~\n- ~:invetica.uri/relative-uri-str~\n- ~:invetica.uri/scheme~\n- ~:invetica.uri/uri-map~\n- ~:invetica.uri/user~\n- ~:invetica.uri/user-info~\n\n* License\nThe MIT License (MIT)\n\nCopyright © 2017 Invetica Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvetica%2Furi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvetica%2Furi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvetica%2Furi/lists"}