aglundahl
Place - A library and dataset of countries, states and cities around the world
Hi everyone!
I needed some geographical data and started out with the Countries library. But I realized I needed some data that Countries doesn’t provide, so I started looking for other datasets.
I found the countries-states-cities-database project, which seems pretty well-maintained and the data it provides seems complete.
After building an integration for the dataset, I figured I might as well open source it.
Examples
Get a country:
iex> Place.get_country(country_code: "US")
%Place.Country{
capital: "Washington",
csc_id: 233,
csc_region_id: "2",
csc_subregion_id: "6",
currency: "USD",
currency_name: "United States dollar",
currency_symbol: "$",
emoji: "🇺🇸",
emojiU: "U+1F1FA U+1F1F8",
iso2: "US",
iso3: "USA",
latitude: "38.00000000",
longitude: "-97.00000000",
name: "United States",
nationality: "American",
native: "United States",
numeric_code: "840",
phone_code: "1",
... # and more
}
Get all countries:
iex> Place.get_countries() |> Enum.count()
250
Get all cities in a state:
iex> Place.get_cities(country_code: "US", state_code: "CA") |> Enum.count()
1124
See the Place module for the rest of the API.
Links
Popular in Announcing
In short
Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
Hello everyone!
I want to share with you something that I’m really proud of: https://stillstatic.io/
Still is a static site builder for...
New
Presenting Aviacommerce, open source e-commerce platform in Elixir
Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below.
Hi everyone,
We a...
New
Dear Elixir community,
After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project.
Unicode released CLDR ...
New
Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
New
Hello everyone!
I am excited to share our heart project Backpex with you.
After building several Phoenix applications, we realized that...
New
Lexical
Lexical is a next-generation language server for the Elixir programming language.
Features
Context aware code completion
As-you...
New
Hey everyone
i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
Other popular topics
lets say i have a sample like
a = 20; b = 10;
if (a > b) do
{:ok, "a"}
end
if (a < b) do
{:ok, b}
end
if (a == b) do
{:ok, "equa...
New
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help.
Where are they similar?
Where do they differ the m...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
What learn first? Rust or Elixir
Hi Elixir community!
I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
Got a question about when to concat vs. prepending items to list then reversing to achieve appending.
So i know lists boil down to [1 | ...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









