Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SebastianSzturo/countries
Collection of Country Information for Elixir.
https://github.com/SebastianSzturo/countries
countries elixir hex
Last synced: 7 days ago
JSON representation
Collection of Country Information for Elixir.
- Host: GitHub
- URL: https://github.com/SebastianSzturo/countries
- Owner: SebastianSzturo
- License: mit
- Created: 2015-02-01T13:34:50.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-08-10T13:08:31.000Z (3 months ago)
- Last Synced: 2024-10-02T07:52:02.345Z (about 1 month ago)
- Topics: countries, elixir, hex
- Language: Elixir
- Homepage:
- Size: 2.37 MB
- Stars: 148
- Watchers: 7
- Forks: 65
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. (Miscellaneous)
- fucking-awesome-elixir - Countries - Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. (Miscellaneous)
- awesome-elixir - Countries - Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. (Miscellaneous)
README
# Countries
[![Build Status](https://travis-ci.org/SebastianSzturo/countries.svg?branch=master)](https://travis-ci.org/SebastianSzturo/countries)
[![Module Version](https://img.shields.io/hexpm/v/countries.svg)](https://hex.pm/packages/countries)
[![Hex Docs](https://img.shields.io/badge/hex-docs-9768d1.svg)](https://hexdocs.pm/countries/)
[![Total Download](https://img.shields.io/hexpm/dt/countries.svg)](https://hex.pm/packages/countries)
[![License](https://img.shields.io/hexpm/l/countries.svg)](https://github.com/yyy/countries/blob/master/LICENSE)
[![Last Updated](https://img.shields.io/github/last-commit/SebastianSzturo/countries.svg)](https://github.com/SebastianSzturo/countries/commits/master)Countries is a collection of all sorts of useful information for every country in the [ISO 3166](https://en.wikipedia.org/wiki/ISO_3166) standard.
It is based on the data from the Ruby Gem [Countries](https://github.com/hexorx/countries).## Installation
```elixir
defp deps do
[
{:countries, "~> 1.6"}
]
end
```After you are done, run ```mix deps.get``` in your shell to fetch and compile countries.
## Usage
Find country by attribute:
```elixir
country = Countries.filter_by(:alpha2, "DE")
# [%Countries.Country{alpha2: 'DE', alpha3: 'DEU', continent: 'Europe',
# country_code: '49', currency: 'EUR', ...]countries = Countries.filter_by(:region, "Europe")
Enum.count(countries)
# 51
```Get all countries:
```elixir
countries = Countries.all
Enum.count(countries)
# 250
```## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request## Copyright and License
Copyright (c) 2015 Sebastian Szturo
This software is licensed under [the MIT license](./LICENSE.md).