Skip to main content

convert decimal mcc mnc network id to heximal string used in 3GPP AVP like cases; and vise versa

Reason this release was yanked:

bad readme file

Project description

Certainly! Below is a comprehensive README.md file for your plmn2mccmnc package, including instructions on how to run the CLI using python -m plmn2mccmnc.bitscoder --help.

# PLMN to MCC and MNC Converter

This package provides tools to encode and decode PLMN (Public Land Mobile Network) identifiers to and from MCC (Mobile Country Code) and MNC (Mobile Network Code). The package includes a command-line interface (CLI) for easy usage.


## Installation

You can install the `plmn2mccmnc` package using `pip`. It is recommended to use a virtual environment to avoid conflicts with other packages.

```sh
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

# Install the package
pip install plmn2mccmnc

Usage

Encoding

To encode MCC and MNC to a 3-byte hexadecimal PLMN, you can use the encode_mcc_mnc function.

from plmn2mccmnc.bitscoder import encode_mcc_mnc

mcc = "405"
mnc = "01"
plmn = encode_mcc_mnc(mcc, mnc)
print(plmn.hex())  # Output: 40f510

Decoding

To decode a 3-byte hexadecimal PLMN to MCC and MNC, you can use the decode_mcc_mnc function.

from plmn2mccmnc.bitscoder import decode_mcc_mnc

plmn = bytes.fromhex("40f510")
mcc, mnc = decode_mcc_mnc(plmn)
print(mcc, mnc)  # Output: 405 01

CLI Usage

The package includes a command-line interface (CLI) for encoding and decoding PLMN identifiers.

Encoding with CLI

To encode MCC and MNC using the CLI, run the following command:

python -m plmn2mccmnc encode 405 01

This will output:

40f510

Decoding with CLI

To decode a 3-byte hexadecimal PLMN using the CLI, run the following command:

python -m plmn2mccmnc decode 40f510

This will output:

405 01

CLI Help

To see the available options and usage instructions, use the --help flag:

python -m plmn2mccmnc --help

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your changes to your fork.
  5. Create a pull request to the main repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

plmn2mccmnc-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

plmn2mccmnc-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file plmn2mccmnc-0.1.0.tar.gz.

File metadata

  • Download URL: plmn2mccmnc-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.8

File hashes

Hashes for plmn2mccmnc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bc3902bd324f8e7030e58afbe8ce43511f4c0912af1f2d1556a40e06b71b061e
MD5 13d0d4a7aae1a02cf34e92c881308951
BLAKE2b-256 98a669260cdc9d03551ac2a83968f428a7612f82cd95b46cd27d4d796a4262ec

See more details on using hashes here.

File details

Details for the file plmn2mccmnc-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plmn2mccmnc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5664c290304cecbdf4b904d3955ef3c3b831be05f0b8f145c033c2d885e5c323
MD5 032d5a92886309847662995998bf8c29
BLAKE2b-256 2d5e2fa5e9ede590379d1071b8358b615fc154b652df91a1fb3d4a6f3782c6fe

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