Functions to validate National Metering Identifiers (NMIs)
Project description
NMI-Checksum
A library to validate National Metering Identifiers (NMIs)
The validation rules are as per the Australian National Metering Identifier Procedure.
Usage
from nmicheck import nmi_checksum
checksum = nmi_checksum("QAAAVZZZZZ")
print(checksum) # 3
from nmicheck import nmi_checksum_valid
print(nmi_checksum_valid("QAAAVZZZZZ3")) # True
print(nmi_checksum_valid("QAAAVZZZZZ0")) # False
from nmicheck import long_nmi, short_nmi
print(long_nmi("NMI00012345")) # NMI000123458
print(short_nmi("NMI000123458")) # NMI00012345
from nmicheck import obfuscate_nmi
print(obfuscate_nmi("NMI00012345", salt="secret")) # 0E6816DCBA334A7B2DEF
print(obfuscate_nmi("NMI00012345", salt="secret", length=10)) # 0E6816DCBA
You can also look up the participant code for a particular NMI (which DNSP or TNSP) based on the NMI Allocation List.
from nmicheck import nmi_participant
participant = nmi_participant("6102000000")
print(participant) # CITIPP
participant = nmi_participant("3202000000")
print(participant) # PLINKP
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nmicheck-0.3.0.tar.gz.
File metadata
- Download URL: nmicheck-0.3.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75aa58d3fb971d03cc3d43a6ed9781cef017f15571f3840927a52e6fd660bf49
|
|
| MD5 |
9ea2aecf300945e0c614babe4951033d
|
|
| BLAKE2b-256 |
223a29a870ca4cd964398058797b45e98c8a76727b85019cb83fed20d079d7fe
|
File details
Details for the file nmicheck-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nmicheck-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc1258478447165d2b1e718cfd66d184d6933863af0554c2b6477628fa4cecbd
|
|
| MD5 |
700b6af5b3c150fbd795febf1d385b0b
|
|
| BLAKE2b-256 |
41b0f1b45811676a0b21f071c38c1a05011e684ff350ea530e03e9311b048e1f
|