Metadata-Version: 2.4
Name: inventree-part-importer-ui
Version: 0.2.0
Summary: InvenTree plugin for importing electronic components from DigiKey and Mouser with pricing, stock, parameters and variations support.
Author-email: Tyroonis <info@tyroonis.de>
License-Expression: MIT
Project-URL: Homepage, https://blog.tyroonis.de
Keywords: inventree,inventree-plugin,plugin,Digikey,Mouser
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Framework :: InvenTree
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# PartImporterUI – InvenTree Plugin

Import electronic components directly from **DigiKey** and **Mouser** into the InvenTree UI.

---

## 🚀 Features

### 🔎 Integrated Search

* Search parts directly inside InvenTree
* Supports multiple MPNs at once (bulk search / BOM import)
* Real-time progress:

  * `Searching 7 of 50 items`
  * Progress bar with percentage

---

### ⚡ Smart Auto-Import

* Automatically imports parts when:

  * exact MPN match
  * or only one valid result
* Handles multiple MPNs in one run
* Provides summary:

  * `13 searched`
  * `11 auto-imported`
  * `1 manual selection`
  * `1 no match`

---

### 🧠 Primary Supplier Concept

* Configurable default:

  * `DigiKey` or `Mouser`
* Primary supplier provides:

  * description
  * parameters
  * datasheet
  * image
  * category
* Other suppliers still imported for:

  * pricing
  * stock
  * additional supplier parts

---

### 📦 Multi-Supplier Import

* Imports:

  * Part
  * ManufacturerPart
  * multiple SupplierParts
* Automatically merges suppliers when possible
* Secondary suppliers:

  * auto-selected if unambiguous
  * otherwise selectable in UI

---

### 📊 Price & Stock Handling

* Imports:

  * price breaks
  * availability / stock
  * MOQ
* `availability_updated` handled correctly
* Pack quantity handled safely:

  * ignored if invalid (e.g. CT packaging)

---

### 🔁 Variation Handling (DigiKey & Mouser)

* Variants (CT / TR / Digi-Reel etc.) are:

  * grouped as **one part**
  * shown as selectable options
* Prevents duplicate parts for packaging variants

---

### 🗂️ Category Mapping System

* Automatically maps supplier categories to InvenTree categories
* Supports full category paths:

  * `Resistors / Chip Resistors`
* Features:

  * recursive category creation
  * mapping persistence
  * reuse across imports
* Smart matching:

  * exact path
  * suffix match
  * leaf match

---

### 🧩 Category Workflow Improvements

* Category selected once → reused automatically for similar parts
* Optional:

  * ✅ **Create missing categories automatically**
* Reduces repeated prompts in BOM imports

---

### 🧾 Clean UI Workflow

* Only shows selection when needed:

  * ambiguous results
* Auto-import skips UI entirely
* Sequential handling of unresolved items

---

### 📈 Progress & Feedback

* Real search progress (no fake loading)
* Import progress summary
* Final result screen:

  * clean and compact

---

### 🐞 Debug Mode (optional)

* Toggle via plugin settings:

  * `Show Debug Output`
* When enabled:

  * shows API responses
  * shows errors and warnings
* When disabled:

  * clean production UI

---

## ⚙️ Configuration

### Plugin Settings

| Setting             | Description                                            |
| ------------------- | ------------------------------------------------------ |
| `PRIMARY_SUPPLIER`  | Default supplier for main data (`digikey` or `mouser`) |
| `SHOW_DEBUG_OUTPUT` | Enable debug output in UI                              |

---

## 🧪 Supported Suppliers

* DigiKey
* Mouser

---

## 📦 Imported Data

The plugin imports:

* Part
* ManufacturerPart
* SupplierPart(s)
* PriceBreaks
* Stock / Availability
* Parameters (from primary supplier)
* Datasheet
* Image

---

## 🧠 How It Works

1. Search multiple MPNs
2. System evaluates matches per supplier
3. Auto-import when possible
4. Ask user only when needed
5. Apply category mapping
6. Import part + suppliers

---

## 🎯 Goals

* Minimize manual work
* Keep InvenTree clean and structured
* Enable fast BOM imports
* Provide full supplier data in one step

---

## ⚠️ Notes

* Large BOM imports may take longer due to real-time progress tracking
* Category mapping improves over time with usage

---

## 🛠️ Development Status

Active development
Focused on usability, automation and data quality

---

## 💡 Roadmap (Next Steps)

* Improved variation selection UI
* Category mapping manager
* Background import mode
* Additional suppliers (e.g. Reichelt)

---

## 📄 License

MIT (or your chosen license)

---

## 🙌 Credits

Built to improve the InvenTree workflow for electronics development.

---
