Monorepo for parsing airline boarding pass barcodes and QR codes that conform to the IATA Bar Coded Boarding Pass (BCBP) standard (Resolution 792, Version 8).
| Package | Path | Install / notes |
|---|---|---|
| Swift | packages/swift |
Swift Package Manager / CocoaPods |
| Node.js | packages/node |
npm install boarding-pass-kit |
| Rust | packages/rust |
Canonical core crate (boarding-pass-kit) |
| Python | packages/python |
PyO3 bindings via maturin |
| Go | packages/go |
cgo bindings over the C FFI |
| PHP | packages/php |
PHP FFI bindings (ext-ffi) |
| C FFI | packages/ffi |
Shared C ABI used by Go and PHP |
Python, Go, and PHP share the Rust core. Swift and Node remain independent ports with the same public field names and demo fixtures.
- Parse IATA BCBP v8 ASCII payloads (single and multi-leg)
- Extract bag tags, frequent flyer info, and security data
- Convert Julian day-of-year to calendar dates (with year inference)
- Configurable trimming and empty-string handling
- Built-in demo data for testing
- Shared golden fixtures under
testdata/
BoardingPassKit/
βββ packages/
β βββ rust/ # Canonical Rust decoder
β βββ ffi/ # C ABI (JSON decode results)
β βββ python/ # PyO3 / maturin package
β βββ go/ # Go cgo package
β βββ php/ # PHP FFI package
β βββ swift/ # BoardingPassKit Swift library
β βββ node/ # boarding-pass-kit npm package
βββ testdata/ # Shared barcodes + expected JSON
βββ apps/
β βββ BoardingPassKitDemo/
βββ Cargo.toml # Rust workspace
βββ Package.swift # Root SPM manifest (backward compatible)
βββ IATA_COMPLIANCE.md
- iOS 15.0+ / macOS 10.15+
- Swift 5.7+
Swift Package Manager β add the repository URL in Xcode or Package.swift:
dependencies: [
.package(url: "https://github.com/anomaddev/BoardingPassKit.git", from: "2.1.2")
]CocoaPods:
pod 'BoardingPassParser'import BoardingPassKit
let decoder = BoardingPassDecoder()
decoder.debug = false
let pass = try decoder.decode(code: barcodeString)
print(pass.passengerName)
print(pass.boardingPassLegs.first?.origin ?? "")
// Julian day-of-year β calendar date
if let flightDate = pass.boardingPassLegs.first?.flightDate() {
print(flightDate)
}BCBP stores flight date as a 3-digit day-of-year (001β366). Use JulianDateConverter or BoardingPassLeg.flightDate():
// Explicit year
let date = try JulianDateConverter.toCalendarDate(dayOfYear: 14, year: 2025)
// Infer year from scan date (handles year-boundary flights)
let date = try JulianDateConverter.toCalendarDate(dayOfYear: 14, relativeTo: Date())See packages/node/README.md for full documentation.
import { BoardingPassDecoder, DemoData, julianToCalendarDate } from 'boarding-pass-kit';
const decoder = new BoardingPassDecoder();
decoder.debug = false;
const pass = decoder.decode(DemoData.Simple);
console.log(pass.passengerName);
const flightDate = pass.boardingPassLegs[0]!.flightDate();
// or: julianToCalendarDate(14, 2025)Build the Rust workspace and FFI library from the repo root:
cargo test -p boarding-pass-kit
cargo build -p boarding-pass-kit-ffi --releaseThen follow each package README:
# Node.js
npm install
npm run build
npm test
# Rust core + FFI
cargo test -p boarding-pass-kit
cargo build -p boarding-pass-kit-ffi --release
# Python
python3 -m venv .venv && . .venv/bin/activate
pip install maturin pytest
cd packages/python && maturin develop && pytest
# Go
cd packages/go && go test ./...
# PHP
cd packages/php && composer install && composer test
# Swift (macOS)
swift build
swift testAll language packages include the same fixtures: Simple, Historical, MultiLeg, and International. Canonical golden expectations live in testdata/.
MIT β see LICENSE.
Justin Ackermann