{"id":13509731,"url":"https://github.com/bydooweedoo/is","last_synced_at":"2026-03-03T00:40:09.686Z","repository":{"id":57507454,"uuid":"138375463","full_name":"bydooweedoo/is","owner":"bydooweedoo","description":"Fast, extensible and easy to use data structure validation for elixir with nested structures support.","archived":false,"fork":false,"pushed_at":"2018-06-23T06:18:33.000Z","size":21,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T08:20:43.930Z","etag":null,"topics":["elixir","is","validation","validator"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/bydooweedoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-23T05:56:45.000Z","updated_at":"2023-09-01T10:57:20.000Z","dependencies_parsed_at":"2022-09-19T05:30:31.195Z","dependency_job_id":null,"html_url":"https://github.com/bydooweedoo/is","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bydooweedoo/is","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bydooweedoo%2Fis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bydooweedoo%2Fis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bydooweedoo%2Fis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bydooweedoo%2Fis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bydooweedoo","download_url":"https://codeload.github.com/bydooweedoo/is/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bydooweedoo%2Fis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30027657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T00:31:48.536Z","status":"ssl_error","status_checked_at":"2026-03-03T00:30:56.176Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["elixir","is","validation","validator"],"created_at":"2024-08-01T02:01:12.086Z","updated_at":"2026-03-03T00:40:09.628Z","avatar_url":"https://github.com/bydooweedoo.png","language":"Elixir","funding_links":[],"categories":["Validations"],"sub_categories":[],"readme":"# Is\n\nFast, extensible and easy to use data structure validation for [elixir](https://github.com/elixir-lang/elixir) with nested structures support.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `is` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:is, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/is](https://hexdocs.pm/is).\n\n## Example\n\n```elixir\niex\u003e data = Enum.map(1..2, \u0026(%{\n...\u003e   a: 1,\n...\u003e   b: \"b\",\n...\u003e   c: {\"a\", \"b\", false},\n...\u003e   d: [[1, 2, \"3\"], [4, false, 6]],\n...\u003e   e: -1,\n...\u003e   f: \"1234567891011\",\n...\u003e   index: \u00261 - 10,\n...\u003e }))\niex\u003e schema = [list: [map: %{\n...\u003e   a: :binary,\n...\u003e   b: :boolean,\n...\u003e   c: [list: [or: [:binary, :boolean]]],\n...\u003e   d: [list: [list: :integer]],\n...\u003e   e: [and: [:optional, :binary]],\n...\u003e   index: [and: [:integer, in_range: [min: 0]]],\n...\u003e }]]\niex\u003e Is.validate(data, schema)\n[\n  {:error, [0, :a], \"must be a binary\"},\n  {:error, [0, :b], \"must be a boolean\"},\n  {:error, [0, :c], \"must be a list\"},\n  {:error, [0, :d, 0, 2], \"must be an integer\"},\n  {:error, [0, :d, 1, 1], \"must be an integer\"},\n  {:error, [0, :e], \"must be a binary\"},\n  {:error, [0, :index], \"must at least be 0\"},\n  {:error, [1, :a], \"must be a binary\"},\n  {:error, [1, :b], \"must be a boolean\"},\n  {:error, [1, :c], \"must be a list\"},\n  {:error, [1, :d, 0, 2], \"must be an integer\"},\n  {:error, [1, :d, 1, 1], \"must be an integer\"},\n  {:error, [1, :e], \"must be a binary\"},\n  {:error, [1, :index], \"must at least be 0\"},\n]\n```\n\nValidations\n-----------\n\n### Basic types\n\n#### :atom\n\nTest if data is an atom or not\n\n```elixir\niex\u003e Is.validate(:value, :atom)\n[]\n\niex\u003e Is.validate(:value, atom: true)\n[]\n\niex\u003e Is.validate(1, :atom)\n[{:error, [], \"must be a atom\"}]\n\niex\u003e Is.validate(:value, atom: false)\n[{:error, [], \"must not be a atom\"}]\n```\n\n#### :binary\n\nTest if data is a binary or not\n\n```elixir\niex\u003e Is.validate(\"value\", :binary)\n[]\n\niex\u003e Is.validate(\"value\", binary: true)\n[]\n\niex\u003e Is.validate(1, :binary)\n[{:error, [], \"must be a binary\"}]\n\niex\u003e Is.validate(\"value\", binary: false)\n[{:error, [], \"must not be a binary\"}]\n```\n\n#### :boolean\n\nTest if data is a boolean or not\n\n```elixir\niex\u003e Is.validate(true, :boolean)\n[]\n\niex\u003e Is.validate(true, boolean: true)\n[]\n\niex\u003e Is.validate(1, :boolean)\n[{:error, [], \"must be a boolean\"}]\n\niex\u003e Is.validate(true, boolean: false)\n[{:error, [], \"must not be a boolean\"}]\n```\n\n#### :equals\n\nTest if data equals given value\n\n```elixir\niex\u003e Is.validate(true, equals: true)\n[]\n\niex\u003e Is.validate(\"str\", equals: \"str\")\n[]\n\niex\u003e Is.validate(1, equals: true)\n[{:error, [], \"must equals true\"}]\n```\n\n#### :fn\n\nTest if data equals given value\n\n```elixir\niex\u003e Is.validate(1, fn: \u0026is_number/1)\n[]\n\niex\u003e Is.validate(true, fn: \u0026is_number/1)\n[{:error, [], \"must satisfies \u0026:erlang.is_number/1\"}]\n\niex\u003e starts_with? = fn(value, prefix) -\u003e\n...\u003e   if String.starts_with?(value, prefix) do\n...\u003e     :ok\n...\u003e   else\n...\u003e     {:error, \"must start with #{inspect prefix}\"}\n...\u003e   end\n...\u003e end\niex\u003e Is.validate(\"https://elixir-lang.org\", fn: [starts_with?, \"http\"])\n[]\niex\u003e Is.validate(\"elixir-lang.org\", fn: [starts_with?, \"http\"])\n[{:error, [], \"must start with \\\"http\\\"\"}]\n\niex\u003e Is.validate(12, fn: {1, 2})\n[{:error, [], \"fn: options are invalid\"}]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbydooweedoo%2Fis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbydooweedoo%2Fis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbydooweedoo%2Fis/lists"}