Giter Site home page Giter Site logo

country-data's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

country-data's Issues

Name Popularity Index

Assuming that multiple versions of country names become available, it would be nice to include a popularity index, e.g. http://www.google.com/trends/explore#q=%22Lithuania%22%2C%20%22Republic%20of%20Lithuania%22&cmpt=q&tz=.

Knowing which name is more popular, together with language property, would be useful when determining which name to choose to display in which language. This index could be updated once a week or so using an automated script.

I am happy to contribute a library that would abstract querying of the data (assuming such does not exist already).

'Flemish' language entry is overriding 'Dutch' language

import countryData from 'country-data';
console.log(countryData.languages.nl.name); //outputs Flemish instead of Dutch

This is because the languages.csv file has the entries Dutch and Flemish with identical values

alpha2=nl
alpha3=nld
bibliographic=dut

I suggest removing the Flemish entry since Flemish it's considered not a language but rather an adjective/thesaurus to define Dutch dialects.

Dutch is the correct English word to define the Dutch language spoken in both The Netherlands and Belgium.

I can prepare a Pull Request with the Flemish entry removed from the languages.csv file.

Could you add some info as to how to use it with React JS?

the full question on: http://stackoverflow.com/questions/43144036/in-react-how-to-convert-country-code-to-country-name-using-country-data

It is:

I thought I could do

npm install --save country-data

and then in the code:

import CountryData from "country-data";

and use

CountryData.countries["TW"]

to get the country data, and

CountryData.countries["TW"].name

to get the name. But CountryData.countries["TW"] gets undefined already. How can it be done?

Usage with webpack?

Hi,
I am not getting how to use it with webpack&c:

import CountryData from 'country-data';
CountryData.lookup.countries({currencies: 'EUR'});

generates:
Uncaught (in promise) TypeError: data.filter is not a function(…)

Am I doing something wrong?

work-in-progress

Hi there,

I took a look at the WIP to see if I could notch it off the list and it raised a q's.

How can you have a dialing code for a region?
Are the codes correct? I could not correlate the data to any meaningful source. Could you provide this?

There are also also a few regions missing.

Happy to contrib if I can get some data.

Region grouping removed?

Hey why did you guys remove the grouping by region such as Europe ?
It was really handy grabbing all European countries at once...

Malaysia Country not on the List

I just found out maybe Malaysia is not on the ALL list, but available in the object.
You may consider as well some countries other than malaysia.

So far so good this library is awesome.

Get all languages

Hello,
I am working on a translation management system and therefore I need all available languages and it's ISO codes. However this list var languageList = languages.all contains entries like:

alpha2=, alpha3=zxx, bibliographic=, name=No linguistic content

alpha2=, alpha3=zxx, bibliographic=, name=Not applicable

alpha2=, alpha3=und, bibliographic=, name=Undetermined

alpha2=, alpha3=gmh, bibliographic=, name=German, Middle High (ca.1050-1500)

All these entries are obviously very irrelevant for my purpose. Instead I want to get English (USA), English (GB) and such. Is there a way to get only the official languages including differences like American vs British English?

Rename 'Greek, Modern (1453-)' to 'Greek'

import countryData from 'country-data';
console.log(countryData.languages.el.name); //outputs Greek, Modern (1453-) instead of Greek

The name of the modern Greek language should simply be Greek instead of Greek, Modern (1453-).

All other languages have modern and ancient versions of them. We do not constantly specify Modern English, Modern German when we refer to English and German. The same should be true for Greek.

United Kingdom listed twice (but different country codes)

United Kingdom,GB,GBR,,+44,GBP,🇬🇧,GBR,"eng,cor,gle,gla,cym",assigned
United Kingdom,UK,,.uk,,GBP,,,"eng,cor,gle,gla,cym",reserved

Also, I believe the official name is "United Kingdom of Great Britain". Perhaps you can assign this name to the "GB" country code, so users who search for "Great Britain" will still get a result.

add continents

currently the root of the data is region. id like to add continent data as the root but think I should run it by you before making a PR

Saint Barthélemy

Hello,

Why this country has é symbol?
Usually, we have Saint Barthelemy spelling every time.

Maybe we need to improve the system and add another name.

Thx, Vitaly

obsolete countries

These countries are obsolete: ["AFI","ATB","BUR","BYS","CSK","SCG","CTE","DDR","DHY","GEL","HVO","JTN","MID","NHB","ATN","NTZ","PCI","PUS","PCZ","RHO","SKM","TMP","VDR","WAK","YMD","YUG","ZAR"]

e.g. DDR - East Germany

Please update the list.

Add search helpers

It would be extremely useful to have some common lookups in the library. For instance I needed to get a alpha3 based on country name. I ended up writing something like this:

 function findAlpha3(name) {
      for(var code in countries) {
          var country = countries[code];

          if(country.name == name && code) return country.alpha3;
      }

      if(name == 'United Kingdom') return 'GBR';
  }

I would much rather write something like countries.find({name: 'Germany'}).alpha3.

Country data is missing after install

Have you ever seen this? I npm install --save country-data then var countries = require('country-data').countries;, and countries.all looks like {}.

Search by IOC code

It would be nice to implement a search by IOC code as well as the alpha2 and alpha3 code.
Maybe implement as countries.IOC.code

Add phone number length

Any plans to include valid phone number lengths by country? Are you open to contributions? My plan would be to port the data already available in node-phone to country-data.

I don't know if it would be too hard to maintain that information up to date.

Internationalization support?

Do you plan to add internationalization support to your package?
I think it may be very useful for non-english development targets.

countries.SK returning Sikkim instead of Slovakia since 0.0.25

Since 0.0.25, the 2-digit ISO code SK had changed from Slovakia to Sikkim:

0.0.24

> require('country-data').countries.SK.name
'Slovakia'

0.0.25

> require('country-data').countries.SK.name
'Sikkim'

According to Wikipedia, SK still belongs to Slovakia and SK was actually assigned to Sikkim before 1993. Maybe this change was unintentional?

Deprecate this package

As I understand this package is not maintained anymore (and the author didn't care to find a new maintainer). Still the number of stars and npm downloads can trick a user to consider this to be a reliable library.

Its a good idea for the author to mark the package as 'deprecated' and recommend another (maintained) package instead.

Country Flags?

The level of detail in this library is great! The only thing missing that I can see would be SVG flags for each country. Is this a possibility?

case insensitive lookup

Having no case preference would be nice:

e.g
lookup({name: 'Antigua and Barbuda'})
doesn't find a match because the source data uses 'And'

I have a branch cut with a fix for this if you want to incorporate it.

Alternative names

The lookup using remote sources will often fail because rarely does anyone use the official name (e.g. Russian Federation vs Russian and People's Republic of China vs China).

CountryData.lookup.countries({name: 'Russia'}); // Russian Federation
CountryData.lookup.countries({name: 'China'}); // People's Republic of China
CountryData.lookup.countries({name: 'USA'}); // The United States of America, United States, America
CountryData.lookup.countries({name: 'Iran'}); // Persia, Islamic Republic of Iran
CountryData.lookup.countries({name: 'Vietnam'}); // Socialist Republic of Vietnam

It would make sense to have "name_aka" field in JSON that would describe common variations.

Optional sorting

var countries = require('country-data').countries;
console.log( countries.all );

Should be sorted alphabetically. Now sort is uncompleted

Some corrections

Some observations to improve countries.json:

  • alpha2: "IC" and alpha2: "EA" are not countries. Canary Islands, Ceuta and Melilla are Spain's regions.
  • alpha2: "GB" and alpha2: "UK" are the same country. The correct ISO Code is GB.
  • alpha2: "EU" isn't a country (it's a politico-economic union of 28 countries).

Is this library maintained?

This is a great little library, but it's been almost a year since the last release and some issues are stacking up.

Do you still plan to maintain this library?

How to distinguish between Currency and Currency Type

Hi All,

First of all thanks for the country data which you made it . I have some css requirement which i am not able to distinguish here. My issue is as below.

I am basically from INDIA and which I saw my country has INR as currency and Currency Type is Rupees. So like Database should have this as well.

Country :- INDIA , Currency :- INR, Currency Type :- Rupee
Country :- BANGALADESH Currency :- Currency :- BDT Type :- TAKA
Country :- Pakistan Currency :- PKR, Currency Type :- Rupee

Please advise.

Thanks

Mexico Country Calling Codes

Following UIT-T E.164 Mexico Country Code is 52.

Why do you have two values 52 and 521 as countryCallingCodes in countries.json?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.