Skip to main content

freightid

AI agents can look up every port on Earth. Not one can check a container number. Now they can.

Pure-function validators for the identifier formats that move global freight — with the arithmetic shown, not just the verdict.

pip install freightid
from freightid import validate_container, explain_container

validate_container("csqu 305438-3")["valid"]      # True
explain_container("CSQU3054383")["detail"]["worked_example"]
# 'C(13)x1 + S(30)x2 + Q(28)x4 + U(32)x8 + 3(3)x16 + 0(0)x32 + 5(5)x64
#  + 4(4)x128 + 3(3)x256 + 8(8)x512 = 6185; 6185 mod 11 = 3 -> check digit 3'

Or from the shell — kind auto-detected, JSON out:

freightid CSQU3054383
freightid --kind imo 9321483
freightid --explain "IMO 9074729"

What it validates

Identifier Depth
ISO 6346 container numbers full check-digit math + worked explanation
IMO ship numbers full check-digit math + worked explanation
SCAC carrier codes format + suffix-convention metadata
UN/LOCODE place codes format + ISO 3166-1 country check
USDOT numbers format (no check digit exists)
MC docket numbers format (no check digit exists)

freightid checks math, not registration

A mathematically valid container number is not evidence that the container exists. freightid can prove a check digit; it cannot prove registration — so every result says so explicitly:

{"valid": True, ..., "registration": "not_checked"}

That field is always "not_checked". If you need registry truth, ask a registry. freightid will never blur the line for you.

Honest edges

The standards have designed-in blind spots, and freightid's test suite asserts them rather than hiding them:

  • ISO 6346: letter substitutions whose value difference is a multiple of 11 (A↔K, B↔L, …) are undetectable — the weighted sum doesn't move. Separately, mod-11 remainders 0 and 10 both fold to check digit 0, so mutations moving the remainder between those two are invisible; this is why the standard discourages remainder-10 serials.
  • IMO: the position weights (7..2) aren't all coprime to 10, so certain digit deltas at certain positions slip through by design.

Roadmap

Not in v0.1, on the list: UN/LOCODE location lookup (needs the UNECE dataset), IMO company numbers, BIC owner-registry awareness, AWB/BOL/GS1.


Built by Novacrest · from the team behind OmniOrders · MIT © 2026 Shipedge Inc.

Download files

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

Source Distribution

freightid-0.1.0.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

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

freightid-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file freightid-0.1.0.tar.gz.

File metadata

  • Download URL: freightid-0.1.0.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for freightid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 55bec36c7cb2f797062126f54f31bea9531fb6e0bdb73de37e510784c63ef37e
MD5 bc64d7cbe583937bef6e71046f89a57f
BLAKE2b-256 76f2fc634c3dcd12ccc6249c0dd8d306fe4258f6357b9e049896120ee90fb4ff

See more details on using hashes here.

File details

Details for the file freightid-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: freightid-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for freightid-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a63afad39bdf7f4e743edd42291437dcbabe8485a9ef64aa55dbaf4ff7503b7
MD5 66ecfd037163dd4cfc2099aaa606bbdf
BLAKE2b-256 284f58eab8b0570bc63ece42baf6f64f0fcbe671094f635b0d880d9ce1516c64

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 Sentry Error logging StatusPage Status page