Git Product home page Git Product logo

mcc-mnc-list's Introduction

mcc-mnc-list

npm

List of MCC and MNC codes from up-to-date Wikipedia page

Source: https://en.wikipedia.org/wiki/Mobile_country_code

Definition

The ITU-T Recommendation E.212 defines mobile country codes as well as mobile network codes. The mobile country code consists of 3 decimal digits and the mobile network code consists of 2 or 3 decimal digits (for example: MNC of 001 is not the same as MNC of 01). The first digit of the mobile country code identifies the geographic region as follows (the digits 1 and 8 are not used):

  • 0 - Test networks
  • 2 - Europe
  • 3 - North America and the Caribbean
  • 4 - Asia and the Middle East
  • 5 - Oceania
  • 6 - Africa
  • 7 - South and Central America
  • 9 - World-wide (Satellite, Air - aboard aircraft, Maritime - aboard ships, Antarctica)

A mobile country code (MCC) is used in combination with a mobile network code (MNC) (also known as a "MCC / MNC tuple") to uniquely identify a mobile network operator (carrier) using the GSM (including GSM-R), UMTS, and LTE public land mobile networks. (source: Wikipedia)

Install

$ npm install mcc-mnc-list

Data

mcc-mnc-list.json

This file contains all the records fetched from the Wikipedia page.

Structure of a single record:

{
  "type": <String> - 'Test' / 'National' / 'International'
  "countryName": <String> - country name
  "countryCode": <String> - ISO 3166-1 country code
  "mcc": <String> - mobile country code
  "mnc": <String> - mobile network code
  "brand": <String|null>
  "operator": <String|null>
  "status": <String> - status code ( see status-codes.json )
  "bands": <String|null>
  "notes": <String|null>
}

status-codes.json

List ( Array ) of all the different Status Codes from MCC/MNC list.

Usage

.all() : Array

Returns the full record list

.statusCodes() : Array

Returns the status code list

.filter(filters) : Array

Returns a filtered record list. filters is an object.

// get all the Operational mobile networks
let filters = { statusCode: 'Operational' }

// get all the records from Hungary
let filters = { mcc: '216' }

// get a specific network item ( specified with two keys )
let filters = { mcc: '216', mnc: '30' }

// get a specific network item ( specified with a joined key )
let filters = { mccmnc: '21630' }

// get all the Operational mobile networks from Hungary
let filters = { statusCode: 'Operational', mcc: '216' }

// get all the Operational mobile networks from US countryCode
let filters = { statusCode: 'Operational', countryCode: 'US' }

// get all the records
let filters = {}

.find(filters) : Record | undefined

Returns the value of the first record in the array that satisfies the provided filters. Otherwise undefined is returned. Filters are identical to the filters described in .filter(filters).

Example

const mcc_mnc_list = require('mcc-mnc-list');

let records = mcc_mnc_list.all();
let statusCodes = mcc_mnc_list.statusCodes();

console.log(records.length);
// 2189

console.log(statusCodes.length);
// 12

console.log(mcc_mnc_list.filter({ mccmnc: '21630' }));
// [{
//   "type": "National",
//   "countryName": "Hungary",
//   "countryCode": "HU",
//   "mcc": "216",
//   "mnc": "30",
//   "brand": "T-Mobile",
//   "operator": "Magyar Telekom Plc",
//   "status": "Operational",
//   "bands": "GSM 900 / GSM 1800 / UMTS 2100 / LTE 800 / LTE 1800 / LTE 2600",
//   "notes": "Former WESTEL, Westel 900; MNC has the same numerical value as the area code"
// }]

License

mcc-mnc-list is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.

mcc-mnc-list's People

Contributors

coderbyheart avatar eladhayun avatar omerts avatar pbakondy avatar

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

mcc-mnc-list's Issues

CSV format support ?

Thank you for creating and maintaining this - it's incredibly useful 👍

mcc-mnc-list.json is fairly large and verbose but can be used independently. Is it possible to also store it in CSV format for external consumption ? Similar to https://github.com/musalbas/mcc-mnc-table/blob/master/mcc-mnc-table.csv

If I knew js well, I'd have sent a PR to do this. I understand that json to csv conversion can be made on the client end and this request can possibly be beyond the scope of this project. If that's the case, feel free to close this issue. Cheers!

Ranges are not expanded into separate records

Ranges are not expanded into separate records and therefore the MNCs cannot be found. For example, a filter of { mcc: 313, mnc: 111 } will not return the following record:

  {
    "type": "National",
    "countryName": "United States of America",
    "countryCode": "US",
    "mcc": "313",
    "mnc": "110 - 190",
    "brand": "FirstNet",
    "operator": "700 MHz Public Safety Broadband",
    "status": "Unknown",
    "bands": "LTE",
    "notes": "D Block for future use"
  },

returns en dash (–) ?

Hello.
Your code is very helpful.
Thank you for developing and maintaining.

When I've downloaded your source and run the following command, mcc-mnc-list.json is updated.

node fetch.js

But countryName and countryCode are null.
The reason seems like the WIKI page has en dash (–) but your code checks hyphen(-).
https://github.com/PodgroupConnectivity/mcc-mnc-list/blob/master/fetch.js#L55 returns en dash (–)

Is this expected? Or did I've done something wrong?

Thank you in advance.

Regards,
Jun

module pharse failed

Hi,
i got the error when installed this module.

Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #!/usr/bin/env node
|
| 'use strict';

could you please help

MCC parsing error

  {
    "type": "National",
    "countryName": "United States of America",
    "countryCode": "US",
    "mcc": "United States of America - US - 313\n313",
    "mnc": "000",
    "brand": null,
    "operator": "Tennessee Wireless",
    "status": "Operational",
    "bands": "Unknown",
    "notes": null
  },

Duplicate MCC MNC pairs

It is my understanding that an MNC and MCC combination should be considered unique. Upon inspecting the data, I have found 41 instances where an MCC and MNC pair share more than one entry. Attached is a CSV that denotes the identified MCC and MNC and how many times the pair occurs within the JSON file.

duplicate_mcc_mnc.csv

Is the license correct?

Based on the statement

"List of MCC and MNC codes from up-to-date Wikipedia page Source: https://en.wikipedia.org/wiki/Mobile_country_code

This indicates that the file mcc-mnc-list.json should be licensed under the terms of the Creative Commons Attribution-ShareAlike License. "under the same, similar or a compatible license"

From the Wikipedia page "Text is available under the Creative Commons Attribution-ShareAlike License;"

The other files in the repository can be under the MIT license. But, the data file itself must be released under a license compatible with the CCA-SA license. As far as I know the MIT license is not compatible with the CCA-SA license since the CCA-SA requires attribution but the MIT license does not.

I suggests that you update the LICENSE file to be 1) CCA-SA or if you really want to keep the other files as MIT then a dual LICENSE where the .js and other files are MIT and the data file is CCA-SA.

Wrong format of mcc

Hello,

I found a wrong mcc in https://raw.githubusercontent.com/PodgroupConnectivity/mcc-mnc-list/master/mcc-mnc-list.json

Wrong value

"mcc": "United Kingdom - GB - 235\n235",
"mnc": "00",
"mcc": "Japan - JP - 441\n441",
"mnc": "00",

Correct value

mcc : 235
mnc : 00
mcc : 441
mnc : 00

possible cause

<tr>
<td><div style="overflow:hidden;width:0;height:0;margin:-1ex;float:right">
<h3><span class="mw-headline" id="United_Kingdom_-_GB_-_235">United Kingdom - GB - 235</span></h3>
</div>235
</td>
<tr>
<td><div style="overflow:hidden;width:0;height:0;margin:-1ex;float:right">
<h3><span class="mw-headline" id="Japan_-_JP_-_441">Japan - JP - 441</span></h3>
</div>441
</td>

Access point names - APN?

I've been looking for something like this, but with access point names for the different networks where it applies.
I almost installed it before noticing that there are no APN.

What are people using a package like this for, without the APN?
I need to present the user with a nice list of carriers and then use the selection to set the APN.

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.