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.
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
Example
>>> 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.)
Author
2024 Damien Bezborodov
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.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad20f693a61e9e02a504032af69c044585bc6de1a5337f89b4cfea4796dffb02 |
|
MD5 | 63290ea190c295f790460367ae2d77d4 |
|
BLAKE2b-256 | 7d6e6112d5c3081b73ec457792b515548abd92383c11be38b8d92e8601f7ef29 |