Skip to main content

A tool for matching and retrieving information about MCC-MNC combinations.

Project description

mcc-mnc

mcc-mnc is a tool for matching and retrieving information about Mobile Country Codes (MCC) and Mobile Network Codes ( MNC). It allows you to search for MCC-MNC combinations, Country Codes (CC), Public Land Mobile Network (PLMN), or individual MCC, MNC, or CC values to retrieve details about the corresponding mobile network provider. The tool uses a JSON database that maps the MCC-MNC combinations to their associated information such as ISO country codes, country names, and network names.

Installation

You can install mcc-mnc using pip, the Python package manager.

pip install mccmnc

Usage

You can use mcc-mnc to search for MCC-MNC combinations, Country Codes (CC), PLMNs, or individual MCC, MNC, or CC values. Here are some usage examples:

# Search by Country Code (CC)
mccmnc -cc XXX

# Search by Mobile Country Code (MCC)
mccmnc -mcc XXX

# Search by MCC and MNC
mccmnc -mcc XXX -mnc XXX

# Search by CC, MCC, and MNC
mccmnc -cc XXX -mcc XXX -mnc XXX

# Search by PLMN
mccmnc -plmn XXXXX

# Update the mcc-mnc database
mccmnc -update

The -update option allows you to download and refresh the local JSON file that mcc-mnc uses for matching.

Python Usage

You can also use mccmnc within your Python programs. First, make sure it's installed in your Python environment, then you can import it and use its functions. Here's an example:

from mccmnc import find_matches, print_matches, update

# Example of searching by MCC and MNC
matches = find_matches(user_mcc="123", user_mnc="45")
if matches:
    print_matches(matches)
else:
    print("No match found.")

# Example of updating the database
update()

These examples demonstrate how to use find_matches to search for MCC-MNC combinations and print_matches to print out the details of the matches. The update function is used to update the MCC-MNC database.

Contributing

Contributions, bug reports, and feature requests are welcome! If you would like to contribute to mcc-mnc, please open an issue to discuss your ideas or submit a pull request with your changes.

Please ensure that you update or add relevant tests for your changes.

License

mcc-mnc is licensed under the MIT License. Feel free to use, modify, and distribute this project under the terms of this license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mccmnc-3.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mccmnc-3.3-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mccmnc-3.3.tar.gz.

File metadata

  • Download URL: mccmnc-3.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for mccmnc-3.3.tar.gz
Algorithm Hash digest
SHA256 ed66e526100ba79728f855b93374437b539e8541fd91327911b1d897613c3a73
MD5 0277ff2cb96ac6a72975ec797a672726
BLAKE2b-256 f467ecf595cc96f1b0635a942e389a188c70072bd8547bdcee23dc8a4bbf5eac

See more details on using hashes here.

File details

Details for the file mccmnc-3.3-py2.py3-none-any.whl.

File metadata

  • Download URL: mccmnc-3.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for mccmnc-3.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 19f8934745bd1a59f479227a68d57501f7c7b0e8f93e01f54f09eab44def3df1
MD5 36ce3a8e1e0eaa03f254be7e34986e61
BLAKE2b-256 9057af3f488d5694b2299a10c096a9cfdcce62d7f9398c97f039fe16068508ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page