Metadata-Version: 2.4
Name: garment-bundle-id
Version: 1.0.0
Summary: Standard bundle ID generator and parser for QR-based garment factory production tracking. Format: STYLE-LOT-COLOR-SIZE-BUNDLE#-COMPONENT. Built and used in production by Scan ERP.
Author-email: Santosh Rijal <santoshrijal41@gmail.com>
License: MIT
Project-URL: Homepage, https://scan-erp.web.app/blog/qr-code-production-tracking-garment-factory.html
Project-URL: Documentation, https://drmcoder.github.io/scan-erp-docs/calculators.html
Project-URL: Repository, https://github.com/drmcoder/cmt-factory-toolkit
Project-URL: Bug Tracker, https://github.com/drmcoder/cmt-factory-toolkit/issues
Keywords: garment,bundle-id,bundle-tracking,qr-code,sewing,apparel,cmt-factory,production-tracking,manufacturing,scan-erp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# garment-bundle-id

> Standard bundle ID generator and parser for QR-based garment factory production tracking. Built and used in production by [Scan ERP](https://scan-erp.web.app/).

[![PyPI version](https://img.shields.io/pypi/v/garment-bundle-id.svg)](https://pypi.org/project/garment-bundle-id/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Install

```bash
pip install garment-bundle-id
```

## Usage

```python
from garment_bundle_id import generate_bundle_id, parse_bundle_id, generate_qr_payload

# Generate a bundle ID
bid = generate_bundle_id(
    style="S27", lot="8082", color="BLUE",
    size="M", bundle_number=1, component="FRT"
)
print(bid)  # → 'S27-8082-BLUE-M-001-FRT'

# Parse an existing bundle ID
parsed = parse_bundle_id("S27-8082-BLUE-M-001-FRT")
print(parsed)
# {
#   'style': 'S27', 'lot': '8082', 'color': 'BLUE',
#   'size': 'M', 'bundle_number': 1, 'component': 'FRT'
# }

# Generate compact QR payload for printing
qr = generate_qr_payload(
    article="S27", lot="8082", color="BLUE",
    size="M", bundle_number=1, component="FRT",
    total_pieces=50, quantity=1
)
# → '{"a":"S27","l":"8082","b":"S27-8082-BLUE-M-001-FRT",...}'
```

## Bundle ID Format

```
STYLE-LOT-COLOR-SIZE-BUNDLE#-COMPONENT
S27 - 8082 - BLUE - M - 001 - FRT
```

| Segment | Description | Example |
|---------|-------------|---------|
| STYLE | Style number | S27, S31 |
| LOT | Lot/order number | 8082, 9001 |
| COLOR | Color name (max 8 chars) | BLUE, NAVY, RED |
| SIZE | Size code | S, M, L, XL, 32 |
| BUNDLE# | Bundle sequence (zero-padded to 3 digits) | 001, 023, 100 |
| COMPONENT | Component code | FRT, BK, SLV, CLR |

## Used By

- [Scan ERP](https://scan-erp.web.app/) — QR-based ERP for CMT garment factories (115,370+ pieces tracked)

## Related Reading

- [QR Code Production Tracking in Garment Factories](https://scan-erp.web.app/blog/qr-code-production-tracking-garment-factory.html)
- [Bundle Tracking System for Garment Factory](https://scan-erp.web.app/blog/bundle-system-garment-production-tracking.html)
- [RFID vs QR Code for Garment Tracking](https://scan-erp.web.app/blog/rfid-vs-qr-code-garment-tracking.html)

## License

MIT — Built by [Santosh Rijal](https://github.com/drmcoder) of [Scan ERP](https://scan-erp.web.app/)
