Skip to main content

DHU (Defects Per Hundred Units) calculator for garment industry quality control. Daily QC metric used across the garment industry. Includes defect-type breakdown and daily aggregation across multiple checkers. Built and used in production by Scan ERP.

Project description

garment-dhu-calculator

DHU (Defects Per Hundred Units) calculator for garment industry quality control.

The standard daily QC metric used across CMT factories worldwide. Built and used in production by Scan ERP.

Install

pip install garment-dhu-calculator

What is DHU?

DHU = (Total defects found / Total garments inspected) × 100

CRITICAL distinction: DHU counts defects, not defective pieces. One garment can have multiple defects — all are counted.

Example: A checker inspects 250 garments, finds 20 defective pieces with 35 total defects. DHU = (35 / 250) × 100 = 14

Usage

from garment_dhu_calculator import (
    calculate_dhu,
    calculate_dhu_by_type,
    aggregate_daily_dhu,
    classify_dhu,
)

# Basic DHU
calculate_dhu(defects_found=35, garments_inspected=250)
# → 14.0

# DHU broken down by defect type
calculate_dhu_by_type(
    defects_by_type={"broken-stitch": 12, "sizing": 8, "color-shade": 15},
    garments_inspected=250,
)
# → {"total": 14.0, "by_type": {"broken-stitch": 4.8, "sizing": 3.2, "color-shade": 6.0}, ...}

# Daily aggregate across multiple checkers
aggregate_daily_dhu([
    {"defects_found": 12, "garments_inspected": 80, "checker": "Sita"},
    {"defects_found": 18, "garments_inspected": 120, "checker": "Ram"},
    {"defects_found": 5, "garments_inspected": 50, "checker": "Gita"},
])
# → {"total_defects": 35, "total_garments": 250, "dhu": 14.0,
#    "by_checker": {"Sita": 15.0, "Ram": 15.0, "Gita": 10.0}}

# Industry benchmark classification
classify_dhu(14)  # → 'ACCEPTABLE'
classify_dhu(3)   # → 'EXCELLENT'
classify_dhu(30)  # → 'CRITICAL'

Industry benchmarks

DHU range Classification
≤ 5% EXCELLENT
≤ 10% GOOD
≤ 15% ACCEPTABLE
≤ 25% POOR
> 25% CRITICAL

Related

License

MIT © Santosh Rijal / Scan ERP

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

garment_dhu_calculator-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

garment_dhu_calculator-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file garment_dhu_calculator-1.0.0.tar.gz.

File metadata

  • Download URL: garment_dhu_calculator-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.1

File hashes

Hashes for garment_dhu_calculator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 67e88319ad3cebec99eabdb5d7e0ed607bc78149a4f57bafd5a01c45da0fe940
MD5 516e1cac96b670d1bbd0958100e5599f
BLAKE2b-256 ddd2b6bfbd185203806d4ee56e739694d164820cd2fcededda50d2e4215af836

See more details on using hashes here.

File details

Details for the file garment_dhu_calculator-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for garment_dhu_calculator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41d5775eb171f0e92a729771952b1061f2957c69db28d190f731b45d0c7a04f1
MD5 2eb27b33ad1cef432a2ee889f76d3ce9
BLAKE2b-256 645343a6dfeac931ee74184ae103d513bf0288f3da2a49a503e02e504fdbc13f

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