Mapping supplier inventory columns to B2BPaper product attributes
First entries from the Excel file showing all 6 product types across the 7 columns.
| Product | BW | RW | Max DIA | KGS | Qty(LBS) | UNIT |
|---|---|---|---|---|---|---|
| RIVERSIDE LOGISTICS INC. | ||||||
| LINER XP | 112 GSM | 215.6 CM | 147 CM | 7,855 | 17,317 | 3 |
| LINER XP | 127 GSM | 215 CM | 147 CM | 2,526 | 5,569 | 1 |
| LINER XP | 146 GSM | 101.6 CM | 147 CM | 1,221 | 2,692 | 1 |
| MEDIUM | 112 GSM | 183 CM | 147 CM | 2,251 | 4,963 | 1 |
| MEDIUM | 146 GSM | 195 CM | 147 CM | 19,094 | 42,095 | 8 |
| MEDIUM | 161 GSM | 201 CM | 147 CM | 26,986 | 59,494 | 11 |
| RECYCLED LINERBOARD | 127 GSM | 265.4 CM | 147 CM | 19,120 | 42,152 | 6 |
| RECYCLED LINERBOARD | 146 GSM | 272.4 CM | 147 CM | 20,601 | 45,417 | 6 |
| RECYCLED LINERBOARD - FSC | 170 GSM | 101.6 CM | 147 CM | 2,472 | 5,449 | 2 |
| RECYCLED MEDIUM | 112 GSM | 256.2 CM | 147 CM | 30,098 | 66,354 | 10 |
| RECYCLED MEDIUM | 176 GSM | 263.8 CM | 147 CM | 6,118 | 13,488 | 2 |
| RECYCLED MEDIUM - FSC MIX CREDIT CERTIFIED | 161 GSM | 108 CM | 147 CM | 9,166 | 20,207 | 7 |
| Total | 367,780 kg | |||||
What each column means in the containerboard industry, verified against CEPI and FEFCO standards.
The containerboard type, combining grade (linerboard vs. medium), fiber source (virgin vs. recycled), brand name, and certifications into a single string.
Mass per unit area in GSM (grams per square meter), also called "grammage" per ISO 536. The fundamental measure of paper weight/density. North America also uses lbs/MSF but GSM is the global trading standard.
Product.gsm (integer)
The width of the paper roll in centimeters. Determined by the paper machine's deckle width and trim optimization. Corrugators accept reels from ~180 cm to ~285 cm. Non-standard widths (like 87.6 cm) indicate side trims or custom orders — exactly what surplus markets trade.
Product.width_mm (integer, cm × 10)
Outer diameter of the wound paper roll. All rows show 147 CM (1,470 mm), aligning with the CEPI standard maximum of 1,450 mm. The 20mm overage reflects a supplier/customer agreement. Diameter determines logistics fit (container, truck, crane clamp capacity) and corrugator reel-stand limits.
Product.diameter_mm (integer, cm × 10)
Combined weight of all reels in the line item. Paper is priced and sold by weight (per metric ton). Divide by UNIT count to get per-reel weight. Typical containerboard reels weigh 1,000 - 10,000+ kg depending on width, diameter, and GSM.
Same weight as KGS, converted for US domestic buyers (1 kg = 2.20462 lbs). This column is redundant with KGS and serves as a convenience for the North American market where pounds are still used in domestic trade.
Number of physical paper reels (rolls) in the lot. Each reel has a unique mill identification number for traceability. The count determines logistics: a 40ft container holds ~20-24 MT of containerboard.
How each raw product name maps to B2BPaper's paper_type, fiber_type, and other model fields.
Cascades Inc. branded high-performance recycled linerboard. "XP" = Extra Performance. Made from 100% recycled fiber (90% post-consumer) at Bear Island, Virginia. Designed to match virgin kraftliner strength at recycled weights. Chlorine-free process.
Semi-Chemical Fluting (SCF). Virgin hardwood fiber processed via NSSC (Neutral Sulfite Semi-Chemical) pulping. The wavy corrugated layer inside cardboard. When listed without "recycled" qualifier, this is virgin-fiber medium. Superior flat crush resistance and moisture resistance vs. recycled.
Standard testliner — linerboard made from >20% recycled fiber (typically 100%). Classified as Testliner 2 (T2) or Testliner 3 (T3) in CEPI terminology. Must be ~10-15% heavier than kraftliner to achieve equivalent strength. Lower cost, suitable for most domestic shipping.
Same as Recycled Linerboard above, but carrying FSC (Forest Stewardship Council) certification. Commands a price premium due to sustainability requirements in buyer supply chains and ESG reporting.
Recycled fluting / Wellenstoff (WBF). Corrugating medium made from >25% recycled fiber (typically 100%). Lower cost than semi-chemical fluting. Adequate for domestic shipping. European designation: "Wellenstoff" (WS).
Recycled fluting with FSC Mix Credit certification. "Mix Credit" means the mill tracks FSC-certified input volumes vs. total inputs using a credit/mass-balance accounting system. Min 70% FSC-certified or post-consumer recycled, remainder is "controlled wood" from acceptable sources.
Where each product's basis weight falls in the containerboard GSM spectrum.
Product column resolves the ambiguity — not the GSM alone. This is why the product name must drive paper_type classification, with GSM as a supporting attribute.
Forest Stewardship Council certifications found in this inventory, and how they should be stored.
All material from FSC-certified forests. 100% virgin fiber from certified sources. Highest tier.
Store as: "FSC 100%"
In this file: Not present
Minimum 70% FSC-certified or post-consumer recycled. Remainder is "controlled wood" from non-controversial sources.
Store as: "FSC Mix"
In this file: Not present (but "Mix Credit" is)
Same rules as FSC Mix, but uses credit/mass-balance accounting: the mill tracks certified input volumes vs. total inputs. When enough certified material enters, an equivalent output volume can be labeled FSC Mix Credit. The actual fibers in any specific roll may vary.
Store as: "FSC Mix Credit"
In this file: RECYCLED MEDIUM - FSC MIX CREDIT CERTIFIED
All material from recycled sources. Minimum 85% post-consumer waste.
Store as: "FSC Recycled"
In this file: Not present
"FSC" and let the admin refine it during review. The certifications JSON array can hold the precise label once confirmed.
Complete mapping from Excel columns to B2BPaper Product model fields with transformation rules.
| Excel Column | Industry Term | B2BPaper Field | Type | Transform | Example |
|---|---|---|---|---|---|
| Product | Paper grade | paper_type |
CharField(50) | Lowercase → strip cert suffix → alias lookup | "LINER XP" → testliner |
| Product | Fiber source | fiber_type |
CharField(20) | Infer: "recycled" keyword → recycled; else by paper_type default | "RECYCLED MEDIUM" → recycled |
| Product | Certification | certifications |
JSONField | Extract FSC/PEFC suffix before stripping | "...FSC MIX CREDIT..." → ["FSC Mix Credit"] |
| Product | Brand | brand |
CharField(150) | Known brand lookup (XP → Cascades) | "LINER XP" → "Cascades XP" |
| BW | Basis Weight | gsm |
IntegerField | Strip " GSM" suffix, parse integer | "146 GSM" → 146 |
| RW | Reel Width | width_mm |
IntegerField | Parse float, multiply by 10, round to int | "215.6 CM" → 2156 mm |
| Max DIA | Max Diameter | diameter_mm |
IntegerField | Parse float, multiply by 10, round to int | "147 CM" → 1470 mm |
| KGS | Weight (kg) | derived | — | total_kg / UNIT = per-reel weight for inventory | 7855 / 3 = ~2618 kg/reel |
| Qty(LBS) | Weight (lbs) | not stored | — | Redundant — validation only (KGS × 2.205) | Used for cross-check |
| UNIT | Roll count | quantity | — | Number of reels per surplus lot | 3 → 3 rolls available |
roll (reels). food_contact: Default false. currency: Default USD (US supplier).
What the current paper_type_aliases.py handles vs. what's missing.
paper_type resolution for all 6 product namesfiber_type should be virginfiber_type should be recycledProposed rules to close the parser gaps and enrich imported products automatically.
Derive fiber_type from the raw product name before alias lookup. Two-step rule:
# Step 1: keyword match on raw product name (before suffix stripping)
if "recycled" in raw_name.lower():
fiber_type = "recycled"
# Step 2: default by paper_type (if no keyword match)
FIBER_DEFAULTS = {
"kraftliner": "virgin", # >80% virgin kraft pulp by definition
"testliner": "recycled", # recycled fiber by definition
"fluting": "virgin", # unqualified "medium" = semi-chemical (virgin)
"white_top_testliner": "recycled",
"sack_kraft": "virgin",
"mg_kraft": "virgin",
}
fiber_type = fiber_type or FIBER_DEFAULTS.get(paper_type, None)
Capture the certification info from the suffix before stripping it for paper_type lookup. Return both the cleaned name and extracted certifications.
import re
CERT_PATTERNS = [
(re.compile(r'FSC\s+MIX\s+CREDIT(?:\s+CERTIFIED)?', re.I), "FSC Mix Credit"),
(re.compile(r'FSC\s+MIX(?:\s+CERTIFIED)?', re.I), "FSC Mix"),
(re.compile(r'FSC\s+RECYCLED', re.I), "FSC Recycled"),
(re.compile(r'FSC\s+100%?', re.I), "FSC 100%"),
(re.compile(r'FSC', re.I), "FSC"), # bare FSC = generic
(re.compile(r'PEFC', re.I), "PEFC"),
]
def extract_certifications(raw_name: str) -> list[str]:
certs = []
for pattern, label in CERT_PATTERNS:
if pattern.search(raw_name):
certs.append(label)
break # most specific match wins
return certs
Derive the Harmonized System code from paper_type + fiber_type + gsm:
HS_CODES = {
("kraftliner", "virgin"): "4804.11", # >80% virgin sulfate, >115 g/m2
("testliner", "recycled"): lambda gsm: "4805.24" if gsm <= 150 else "4805.25",
("fluting", "virgin"): "4805.11", # semi-chemical fluting
("fluting", "recycled"): "4805.24", # recycled fluting
("white_top_testliner", "recycled"): lambda gsm: "4805.24" if gsm <= 150 else "4805.25",
}
Known branded product names that should populate the brand field:
BRAND_MAP = {
"liner xp": "Cascades XP",
"top kl": None, # placeholder for future brands
}
# Apply after paper_type resolution:
brand = BRAND_MAP.get(cleaned_name.lower(), None)
Instead of returning just the paper_type string, return a rich result with all derived fields:
@dataclass
class PaperClassification:
paper_type: str | None # "fluting"
fiber_type: str | None # "recycled"
certifications: list[str] # ["FSC Mix Credit"]
brand: str | None # "Cascades XP"
hs_code: str | None # "4805.24"
def classify_paper(raw_value: str) -> PaperClassification:
"""Full classification from a raw product name string."""
certs = extract_certifications(raw_value)
fiber = infer_fiber_type(raw_value)
paper_type = normalize_paper_type(raw_value)
brand = BRAND_MAP.get(clean(raw_value), None)
hs = derive_hs_code(paper_type, fiber, gsm=None)
return PaperClassification(paper_type, fiber, certs, brand, hs)
Harmonized System codes for containerboard products in this inventory.
| HS Code | Description | Products in Inventory | Fiber |
|---|---|---|---|
| 4804.11 | Unbleached kraftliner, >80% virgin sulfate fiber, >115 g/m² | Not in this file | Virgin |
| 4805.11 | Semi-chemical fluting, >65% unbleached hardwood, semi-chemical process | MEDIUM | Virgin |
| 4805.24 | Testliner (recycled), Mullen burst ≥2 kPa·m²/g, ≤150 g/m² | LINER XP (112-146 GSM) REC. LINERBOARD (127 GSM) REC. MEDIUM | Recycled |
| 4805.25 | Testliner (recycled), Mullen burst ≥2 kPa·m²/g, >150 g/m² | LINER XP (161-170 GSM) REC. LINERBOARD (146 GSM) | Recycled |
Aggregated view of the full inventory file by product type.
| Product | B2B paper_type | B2B fiber_type | GSM Range | Width Range (cm) | Total KG | Total Rolls | Avg kg/roll |
|---|---|---|---|---|---|---|---|
| LINER XP | testliner | recycled | 112 - 170 | 101.6 - 223 | 24,532 | 10 | ~2,453 |
| MEDIUM | fluting | virgin | 112 - 176 | 121.9 - 230.8 | 165,005 | 68 | ~2,427 |
| RECYCLED LINERBOARD | testliner | recycled | 127 - 170 | 101.6 - 272.4 | 58,544 | 19 | ~3,081 |
| RECYCLED MEDIUM | fluting | recycled | 112 - 176 | 159.4 - 263.8 | 103,010 | 31 | ~3,323 |
| REC. MEDIUM - FSC MIX CREDIT | fluting | recycled | 161 | 87.6 - 108 | 16,690 | 14 | ~1,192 |
| TOTAL | 367,780 | 142 | ~2,590 | ||||