https://github.com/jbjulia/mcc-mnc
A published Python package for country network queries, used for mobile subscriber identification.
https://github.com/jbjulia/mcc-mnc
beautifulsoup cc cdma gsm imsi mcc mcc-mnc mnc mobile plmn tqdm umts
Last synced: 2 months ago
JSON representation
A published Python package for country network queries, used for mobile subscriber identification.
- Host: GitHub
- URL: https://github.com/jbjulia/mcc-mnc
- Owner: jbjulia
- License: mit
- Created: 2021-06-19T21:43:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-13T04:58:23.000Z (about 3 years ago)
- Last Synced: 2025-08-23T13:52:30.700Z (10 months ago)
- Topics: beautifulsoup, cc, cdma, gsm, imsi, mcc, mcc-mnc, mnc, mobile, plmn, tqdm, umts
- Language: Python
- Homepage: https://pypi.org/project/mccmnc/3.3/
- Size: 51.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```bash
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:
```bash
# 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:
```python
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](https://choosealicense.com/licenses/mit/). Feel free to use, modify, and
distribute this project under the terms of this license.