Skip to main content

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

API Documentation

Synopsis

CSC owner codes.

The calculation is based upon:

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


Download files

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

Source Distribution

iso6346-containers-0.1.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

iso6346_containers-0.1.3-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page