ISO 6346 Freight containers: Coding, identification and marking.
Reason this release was yanked:
Checkdigit calculation incorrect.
Project description
ISO 6346 Freight Containers: Coding, Identification and Marking
Synopsis
CSC owner codes.
>>> import iso6346
>>> iso6346.format('CHEG1231232')
'CHEG 123123 2'
>>> iso6346.format('CHEG1231232', box=True)
'CHEG 123123 [2]'
>>> iso6346.normalize('CHEG 123123 [2]')
'CHEG1231232'
>>> iso6346.checkdigit('CHEG1231232')
2
>>> iso6346.validate('CHEG1231232')
True
>>> iso6346.validate('CHEG1231238')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/dbezborodov/src/iso6346py/src/iso6346/__init__.py", line 46, in validate
raise ValueError(f'Invalid ISO 6346 container owner number (checkdigit mismatch: expected {d}; got {e}.)')
ValueError: Invalid ISO 6346 container owner number (checkdigit mismatch: expected 2; got 8.)
The calculation is based upon:
- How is the check digit of a container calculated? — Grand View Container Trading
- ISO 6346:2022 Freight containers — Coding, identification and marking
Installation
See the PyPI package iso6346-containers
:
pip install iso6346-containers
See Also
langerheiko/Calc-ILU-check-digit
(JavaScript)
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
Close
Hashes for iso6346_containers-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1a5f6f4764307b4164c01fb677e354397b29c814fbb1cc51395dd88aec6d344 |
|
MD5 | 0ce1d736aca2a76e683b674e614078b4 |
|
BLAKE2b-256 | d03c09841813c5dadaaded68453f30db8a3800e2f60a299e08df7b9d102c69fb |