Skip to main content

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


Download files

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

Source Distribution

nmicheck-0.3.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

nmicheck-0.3.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for nmicheck-0.3.0.tar.gz
Algorithm Hash digest
SHA256 75aa58d3fb971d03cc3d43a6ed9781cef017f15571f3840927a52e6fd660bf49
MD5 9ea2aecf300945e0c614babe4951033d
BLAKE2b-256 223a29a870ca4cd964398058797b45e98c8a76727b85019cb83fed20d079d7fe

See more details on using hashes here.

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

Hashes for nmicheck-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc1258478447165d2b1e718cfd66d184d6933863af0554c2b6477628fa4cecbd
MD5 700b6af5b3c150fbd795febf1d385b0b
BLAKE2b-256 41b0f1b45811676a0b21f071c38c1a05011e684ff350ea530e03e9311b048e1f

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