# npnp
<p align="center">
<img src="assets/npnp.png" alt="npnp app logo" width="360">
</p>
<p align="center">
<a href="Cargo.toml"><img src="https://img.shields.io/badge/version-0.1.3-e05d44?style=flat-square" alt="version 0.1.3"></a>
<a href="LICENSE.md"><img src="https://img.shields.io/badge/license-PolyForm--NC%201.0-f08c5a?style=flat-square" alt="license PolyForm NC 1.0"></a>
<a href=".github/workflows/windows-release.yml"><img src="https://img.shields.io/badge/platform-Windows-2ea44f?style=flat-square" alt="platform Windows"></a>
<a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/rust-edition%202024-f28d1a?style=flat-square" alt="rust edition 2024"></a>
</p>
Normalize Pin Net Pad (`npnp`) is an LCEDA/EasyEDA downloader and Altium library exporter written in pure Rust.
`npnp` searches LCEDA/LCSC components, downloads upstream EasyEDA source data and 3D models, and exports Altium-compatible schematic and PCB footprint libraries.
## Features
- Search LCEDA/LCSC components by keyword, part name, or LCSC ID.
- Download 3D models as STEP or OBJ/MTL.
- Export raw EasyEDA symbol and footprint JSON for inspection.
- Export Altium schematic libraries (`.SchLib`).
- Export Altium PCB footprint libraries (`.PcbLib`).
- Embed STEP models into PCB libraries when upstream STEP data is available.
- Batch export many LCSC IDs from a text file.
- Export either one file per component or merged library pairs.
- Append new components into an existing merged `npnp` library pair without duplicating existing LCSC IDs.
- Show live batch progress with counts, active workers, elapsed time, and the most recently processed component.
- Resume non-merged batch exports with checkpoint files.
- Retry transient LCEDA/EasyEDA request failures automatically.
Overview:

Schematic library screenshots:
<p align="center">
<img src="imgs/sch_01.png" alt="Merged schematic screenshot 1" width="32%">
<img src="imgs/sch_02.png" alt="Merged schematic screenshot 2" width="32%">
<img src="imgs/sch_03.png" alt="Merged schematic screenshot 3" width="32%">
</p>
PCB library screenshots:
<p align="center">
<img src="imgs/pcb_01.png" alt="Merged PCB screenshot 1" width="32%">
<img src="imgs/pcb_02.png" alt="Merged PCB screenshot 2" width="32%">
<img src="imgs/pcb_03.png" alt="Merged PCB screenshot 3" width="32%">
</p>
## Requirements
- Rust toolchain for building from source.
- Network access to LCEDA/EasyEDA APIs when searching, downloading, or exporting.
- Altium Designer is recommended for final visual verification of generated `.SchLib` and `.PcbLib` files.
Install Rust from <https://rustup.rs/> if you do not already have it.
## License
`npnp` now uses the closest standard license to the current project intent: `PolyForm-Noncommercial-1.0.0` in `LICENSE.md`.
- Non-commercial use, research, evaluation, and personal experimentation are allowed.
- Commercial use, paid redistribution, paid service use, or use inside a commercial workflow requires separate permission from the author.
- If you redistribute the project, keep the license text and required notices.
- The PolyForm license does not legally require pull requests. This project still asks anyone publishing modified versions to mention the original `npnp` project and, when possible, send changes back as a pull request.
- This is source-available and non-commercial, not an OSI open-source license.
## How to use
In fact, you only need type `npnp` in terminal, and then `copy` some reay to use command lines to execute as follows.
Generally speaking, all you need to copy is the last two lines, which could export `shclib` and `pcblib` in batch to a taget output directory and also could append new components to the existing `libs` generated by `npnp`.
```bash
Admin@linkyourbin MINGW64 /c/Users/Admin
$ npnp
Normalize Pin Net Pad (npnp) - Pure Rust LCEDA downloader and bundle exporter
Usage: npnp [OPTIONS] [COMMAND]
Commands:
search Search components by keyword
download-step Search by keyword and download STEP by result index
download-obj Search by keyword and download OBJ/MTL by result index
export-source Export EasyEDA symbol / footprint JSON sources only
export-schlib Export a pure Rust Altium schematic library (.SchLib)
export-pcblib Export a pure Rust Altium PCB footprint library (.PcbLib)
bundle Export a pure-Rust input bundle: sources + STEP + manifest
batch Batch export Altium libraries from a text file of LCSC IDs
help Print this message or the help of the given subcommand(s)
Options:
--prompt Show ready-to-run example commands
-h, --help Print help
-V, --version Print version
Admin@linkyourbin MINGW64 /c/Users/Admin
$ npnp --prompt
Normalize Pin Net Pad (npnp) ready-to-run commands:
Search a component
npnp search C2040 --limit 5
Export one schematic library
npnp export-schlib C2040 --index 1 --output schlib --force
Export one PCB library
npnp export-pcblib C2040 --index 1 --output pcblib --force
Export EasyEDA source JSON plus STEP bundle
npnp bundle C2040 --index 1 --output bundle --force
Batch export both libraries from ids.txt
npnp batch --input ids.txt --output generated\quick_check --full --force --continue-on-error
Merge both libraries into one pair of outputs
npnp batch --input ids.txt --output generated\merged --merge --library-name MyLib --full --continue-on-error
Append new parts into an existing merged library
npnp batch --input new_ids.txt --output generated\merged --merge --append --library-name MyLib --full --continue-on-error
```
Another easy way is to use `GUI TOOL` <###> [`SeEx`](https://github.com/linkyourbin/seex). And it is STRONGLY recommended. ENJOY, 😊.
You are welcome to issue.