Skip to content

Repository files navigation

ISO Container

PyPI Python License CI Downloads

A Python package based on ISO 6346 Container Codes.
This package provides functionalities to search for container information using ISO codes and to validate container numbers.

Installation

Install the package using pip:

pip install iso-container

Usage

Search Container Information

You can retrieve detailed container information using an ISO code:

from iso_container import get_container_info

# Example usage
container_info = get_container_info('22GP')
print(container_info)
# -> {'class': '20 GENERAL PURPOSE CONTAINER', 'type': 'STANDARD DRY', 'length': 20, 'height': 8.5}

Validate Container Numbers

Validate whether a container number is compliant with the ISO 6346 standard:

from iso_container import validate_container

# Example usage
is_valid = validate_container('CSQU3054383')
print('Valid Container Number' if is_valid else 'Invalid Container Number')
# -> Valid Container Number

API Reference

Function Returns
get_container_info(code) A dict with container details, or None if the code is unknown. The lookup is case-insensitive.
validate_container(number) True if the 11-character number passes the ISO 6346 check-digit rule, otherwise False.

Dataset

The dataset used in this package is derived from the ISO-Container-Codes repository, processed to enhance usability.

License

This project is licensed under the MIT License.

Releases

Used by

Contributors

Languages