{"id":13508592,"url":"https://github.com/navinpeiris/countriex","last_synced_at":"2025-04-13T15:26:33.497Z","repository":{"id":57485962,"uuid":"72507726","full_name":"navinpeiris/countriex","owner":"navinpeiris","description":"All sorts of useful information about every country. A pure elixir port of the ruby Countries gem","archived":false,"fork":false,"pushed_at":"2019-03-11T11:51:28.000Z","size":81,"stargazers_count":31,"open_issues_count":1,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T06:22:35.736Z","etag":null,"topics":["countries","country-data","elixir"],"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/navinpeiris.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":"2016-11-01T05:49:20.000Z","updated_at":"2024-10-17T09:15:37.000Z","dependencies_parsed_at":"2022-09-18T18:04:05.719Z","dependency_job_id":null,"html_url":"https://github.com/navinpeiris/countriex","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/navinpeiris%2Fcountriex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navinpeiris%2Fcountriex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navinpeiris%2Fcountriex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navinpeiris%2Fcountriex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navinpeiris","download_url":"https://codeload.github.com/navinpeiris/countriex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688684,"owners_count":21145788,"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":["countries","country-data","elixir"],"created_at":"2024-08-01T02:00:55.300Z","updated_at":"2025-04-13T15:26:33.474Z","avatar_url":"https://github.com/navinpeiris.png","language":"Elixir","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"readme":"# Countriex\n\n[![Build Status](https://travis-ci.org/navinpeiris/countriex.svg?branch=master)](https://travis-ci.org/navinpeiris/countriex)\n[![Hex version](https://img.shields.io/hexpm/v/countriex.svg \"Hex version\")](https://hex.pm/packages/countriex)\n[![Hex downloads](https://img.shields.io/hexpm/dt/countriex.svg \"Hex downloads\")](https://hex.pm/packages/countriex)\n[![Deps Status](https://beta.hexfaktor.org/badge/all/github/navinpeiris/countriex.svg)](https://beta.hexfaktor.org/github/navinpeiris/countriex)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)\n\nA pure elixir port of the ruby [countries](https://github.com/hexorx/countries) gem that provides all sorts of useful information about every country packaged as convenient little country structs. It includes data from ISO 3166 (countries and states/subdivisions), ISO 4217 (currency), and E.164 (phone numbers).\n\n## Installation\n\nAdd `countriex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:countriex, \"~\u003e 0.4\"}]\nend\n```\n\n## Usage\n\nTo get all country information:\n\n```elixir\nCountriex.all\n```\n\nThe `get_by/2` method can be used to retrieve the first matching country for any given criteria, for example:\n\n```elixir\nCountriex.get_by(:alpha2, \"US\")           # %Countriex.Country{name: \"United States of America\", alpha2: \"US\", alpha3: \"USA\", ...}\nCountriex.get_by(:name, \"United Kingdom\") # %Countriex.Country{alpha2: \"GB\", alpha3: \"GBR\", ...}\n```\n\nThe `filter/2` method can be used to retrieve all countries matching the given criteria:\n\n```elixir\nCountriex.get_by(:region, \"Oceania\") # [%Countriex.Country{name: \"Kiribati\", ...}, %Countriex.Country{name: \"American Samoa\", ...}, ...]\nCountriex.get_by(:eu_member, true)   # [%Countriex.Country{name: \"Luxembourg\", ...}, %Countriex.Country{name: \"Poland\", ...}, ...]\n```\n\nSee the fields in the `Countriex.Country` struct for all possible field names that can be used for the above methods.\n\n## Development\n\n### Regenerating country data\n\nRun the following mix task to re-generate the country data.\n\n```\nmix countriex.generate_data\n```\n\n## License\n\nThe MIT License\n\nCopyright (c) 2016-present Navin Peiris\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies 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,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavinpeiris%2Fcountriex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavinpeiris%2Fcountriex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavinpeiris%2Fcountriex/lists"}