{"id":23579870,"url":"https://github.com/elixir-unicode/unicode_guards","last_synced_at":"2025-05-06T18:29:32.742Z","repository":{"id":51083160,"uuid":"223292955","full_name":"elixir-unicode/unicode_guards","owner":"elixir-unicode","description":"Unicode Set based guards for Elixir","archived":false,"fork":false,"pushed_at":"2025-03-14T02:40:58.000Z","size":82,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-18T02:47:54.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/elixir-unicode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-11-22T00:48:19.000Z","updated_at":"2025-03-14T02:41:00.000Z","dependencies_parsed_at":"2025-03-14T03:37:31.724Z","dependency_job_id":null,"html_url":"https://github.com/elixir-unicode/unicode_guards","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-unicode%2Funicode_guards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-unicode%2Funicode_guards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-unicode%2Funicode_guards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-unicode%2Funicode_guards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-unicode","download_url":"https://codeload.github.com/elixir-unicode/unicode_guards/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252744074,"owners_count":21797540,"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":[],"created_at":"2024-12-26T23:13:06.744Z","updated_at":"2025-05-06T18:29:32.719Z","avatar_url":"https://github.com/elixir-unicode.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unicode Guards\n\nProvides a set of function guards that can be used to match Unicode codepoints.  Based upon [ex_unicode](https://hex.pm/packages/ex_unicode) and [unicode_set](https://hex.pm/packages/unicode_set).\n\n## Usage\n\nEach guard operates on a UTF8 codepoint since the permitted operators in a guard clause are restricted to simple comparisons that do not include strings.\n\nThe data that underpins these guards is generated from the Unicode character database and therefore\nincludes a broad range of scripts well beyond the basic ASCII definitions.\n\nSome examples follow defining functions using the pre-defined guards. Note that since guards operate on codepoints (not strings) we use binary pattern matching to extract the first codepoint for these example.\n\n```elixir\ndefmodule Guards do\n  import Unicode.Guards\n\n  def upper(\u003c\u003c x :: utf8, _rest :: binary \u003e\u003e) when is_upper(x), do: :upper\n  def lower(\u003c\u003c x :: utf8, _rest :: binary \u003e\u003e) when is_lower(x), do: :lower\n  def digit(\u003c\u003c x :: utf8, _rest :: binary \u003e\u003e) when is_digit(x), do: :digit\n  def whitespace(\u003c\u003c x :: utf8, _rest :: binary \u003e\u003e) when is_whitespace(x), do: :whitespace\n  def currency(\u003c\u003c x :: utf8, _rest :: binary \u003e\u003e) when is_currency_symbol(x), do: :currency\nend\n```\n## Installation\n\nThe package can be installed by adding `unicode_guards` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:unicode_guards, \"~\u003e 1.0\"}\n  ]\nend\n```\n\nThe docs can be found at [https://hexdocs.pm/unicode_guards](https://hexdocs.pm/unicode_guards).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-unicode%2Funicode_guards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-unicode%2Funicode_guards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-unicode%2Funicode_guards/lists"}