mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-31 13:41:37 +00:00
Compare commits
No commits in common. "9d438d7d9771dce10a547d75cfdfeefcf6ebbf87" and "12b53f15ba57715863bf4db7715a2cd50c8e9ac9" have entirely different histories.
9d438d7d97
...
12b53f15ba
7 changed files with 6 additions and 124 deletions
2
.github/workflows/assets_artifact_build.yml
vendored
2
.github/workflows/assets_artifact_build.yml
vendored
|
|
@ -65,7 +65,7 @@ jobs:
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v7
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
|
@ -104,7 +104,7 @@ jobs:
|
||||||
run: composer install --prefer-dist --no-progress
|
run: composer install --prefer-dist --no-progress
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v7
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,21 +109,6 @@ supplier is not specified, the price and supplier product number fields will be
|
||||||
* **`supplier_product_number`** or **`supplier_part_number`** or * **`spn`**: The supplier product number of the part.
|
* **`supplier_product_number`** or **`supplier_part_number`** or * **`spn`**: The supplier product number of the part.
|
||||||
* **`price`**: The price of the part in the base currency of the database (by default euro).
|
* **`price`**: The price of the part in the base currency of the database (by default euro).
|
||||||
|
|
||||||
The following fields set the EDA / KiCad metadata of the part (see [EDA / KiCad integration](eda_integration.md)).
|
|
||||||
These can be given either as the flat column names below, or in the nested `eda_info.*` form used by the
|
|
||||||
CSV/JSON export and the [example file](#example-data) (e.g. `eda_info.kicad_symbol`), so a file exported from
|
|
||||||
Part-DB can be re-imported without renaming its headers:
|
|
||||||
|
|
||||||
* **`eda_kicad_symbol`** or **`kicad_symbol`**: The KiCad symbol of the part, e.g. `Device:R`.
|
|
||||||
* **`eda_kicad_footprint`** or **`kicad_footprint`**: The KiCad footprint, e.g. `Resistor_SMD:R_0805_2012Metric`.
|
|
||||||
* **`eda_reference_prefix`** or **`kicad_reference`**: The schematic reference prefix, e.g. `R`, `C`, `L`.
|
|
||||||
* **`eda_value`** or **`kicad_value`**: The value shown in the EDA tool, e.g. `10k`.
|
|
||||||
* **`eda_exclude_from_bom`** (or **`eda_exclude_bom`**), **`eda_exclude_from_board`** (or **`eda_exclude_board`**),
|
|
||||||
**`eda_exclude_from_sim`** (or **`eda_exclude_sim`**): Booleans (`1`/`0`) to exclude the part from the BOM, board
|
|
||||||
or simulation.
|
|
||||||
* **`eda_visibility`**: Boolean (`1`/`0`) controlling whether the part is exposed to the EDA tool. The inverse
|
|
||||||
convenience alias **`eda_invisible`** is also accepted (so `eda_invisible=1` hides the part).
|
|
||||||
|
|
||||||
#### Example data
|
#### Example data
|
||||||
|
|
||||||
Here you can find some example data for the import of parts, you can use it as a template for your own import (
|
Here you can find some example data for the import of parts, you can use it as a template for your own import (
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated on Mon Jul 20 05:45:44 UTC 2026
|
# Generated on Mon Jul 13 05:43:59 UTC 2026
|
||||||
# This file contains all footprints available in the offical KiCAD library
|
# This file contains all footprints available in the offical KiCAD library
|
||||||
Audio_Module:Reverb_BTDR-1H
|
Audio_Module:Reverb_BTDR-1H
|
||||||
Audio_Module:Reverb_BTDR-1V
|
Audio_Module:Reverb_BTDR-1V
|
||||||
|
|
@ -7732,15 +7732,6 @@ Connector_TE-Connectivity:TE_Micro-MaTch_2-215079-0_2x10_P1.27mm_Vertical
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_215079-4_2x02_P1.27mm_Vertical
|
Connector_TE-Connectivity:TE_Micro-MaTch_215079-4_2x02_P1.27mm_Vertical
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_215079-6_2x03_P1.27mm_Vertical
|
Connector_TE-Connectivity:TE_Micro-MaTch_215079-6_2x03_P1.27mm_Vertical
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_215079-8_2x04_P1.27mm_Vertical
|
Connector_TE-Connectivity:TE_Micro-MaTch_215079-8_2x04_P1.27mm_Vertical
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_7-188275-4_2x02_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_7-188275-6_2x03_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_7-188275-8_2x04_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-0_2x05_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-2_2x06_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-4_2x07_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-6_2x08_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-8_2x09_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_Micro-MaTch_9-188275-0_2x10_P1.27mm_Vertical
|
|
||||||
Connector_TE-Connectivity:TE_T4041037031-000_M8_03_Socket_Straight
|
Connector_TE-Connectivity:TE_T4041037031-000_M8_03_Socket_Straight
|
||||||
Connector_TE-Connectivity:TE_T4041037041-000_M8_04_Socket_Straight
|
Connector_TE-Connectivity:TE_T4041037041-000_M8_04_Socket_Straight
|
||||||
Connector_USB:USB3_A_Molex_48393-001
|
Connector_USB:USB3_A_Molex_48393-001
|
||||||
|
|
@ -9159,7 +9150,6 @@ Inductor_SMD:L_APV_APH1770
|
||||||
Inductor_SMD:L_APV_APH2213
|
Inductor_SMD:L_APV_APH2213
|
||||||
Inductor_SMD:L_AVX_LMLP07A7
|
Inductor_SMD:L_AVX_LMLP07A7
|
||||||
Inductor_SMD:L_Abracon_ASPI-0425
|
Inductor_SMD:L_Abracon_ASPI-0425
|
||||||
Inductor_SMD:L_Abracon_ASPI-0628
|
|
||||||
Inductor_SMD:L_Abracon_ASPI-0630LR
|
Inductor_SMD:L_Abracon_ASPI-0630LR
|
||||||
Inductor_SMD:L_Abracon_ASPI-3012S
|
Inductor_SMD:L_Abracon_ASPI-3012S
|
||||||
Inductor_SMD:L_Abracon_ASPI-4030S
|
Inductor_SMD:L_Abracon_ASPI-4030S
|
||||||
|
|
@ -12575,8 +12565,6 @@ Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm
|
||||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm_ThermalVias
|
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm_ThermalVias
|
||||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm
|
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm
|
||||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm_ThermalVias
|
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm_ThermalVias
|
||||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.78x3.37mm
|
|
||||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.78x3.37mm_ThermalVias
|
|
||||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3x3mm_ThermalVias
|
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3x3mm_ThermalVias
|
||||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm
|
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm
|
||||||
Package_SO:HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.74x3.86mm
|
Package_SO:HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.74x3.86mm
|
||||||
|
|
@ -12931,8 +12919,6 @@ Package_SO:Texas_DYY0016A_TSOT-23-16_2x4.2mm_P0.5mm
|
||||||
Package_SO:Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm
|
Package_SO:Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm
|
||||||
Package_SO:Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm_ThermalVias
|
Package_SO:Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm_ThermalVias
|
||||||
Package_SO:Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias
|
Package_SO:Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias
|
||||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.94x3.34mm
|
|
||||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.94x3.34mm_ThermalVias
|
|
||||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm
|
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm
|
||||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm_ThermalVias
|
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm_ThermalVias
|
||||||
Package_SO:Texas_PW0020A_TSSOP-20_4.4x6.5mm_P0.65mm
|
Package_SO:Texas_PW0020A_TSSOP-20_4.4x6.5mm_P0.65mm
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated on Mon Jul 20 05:46:23 UTC 2026
|
# Generated on Mon Jul 13 05:44:30 UTC 2026
|
||||||
# This file contains all symbols available in the offical KiCAD library
|
# This file contains all symbols available in the offical KiCAD library
|
||||||
4xxx:14528
|
4xxx:14528
|
||||||
4xxx:14529
|
4xxx:14529
|
||||||
|
|
@ -951,8 +951,6 @@ Amplifier_Current:INA201D
|
||||||
Amplifier_Current:INA201DGK
|
Amplifier_Current:INA201DGK
|
||||||
Amplifier_Current:INA202D
|
Amplifier_Current:INA202D
|
||||||
Amplifier_Current:INA202DGK
|
Amplifier_Current:INA202DGK
|
||||||
Amplifier_Current:INA2180AxxDGK
|
|
||||||
Amplifier_Current:INA2180AxxDSG
|
|
||||||
Amplifier_Current:INA225
|
Amplifier_Current:INA225
|
||||||
Amplifier_Current:INA240A1D
|
Amplifier_Current:INA240A1D
|
||||||
Amplifier_Current:INA240A1PW
|
Amplifier_Current:INA240A1PW
|
||||||
|
|
@ -7682,7 +7680,6 @@ Driver_LED:IS31FL3218-GR
|
||||||
Driver_LED:IS31FL3218-QF
|
Driver_LED:IS31FL3218-QF
|
||||||
Driver_LED:IS31FL3236-TQ
|
Driver_LED:IS31FL3236-TQ
|
||||||
Driver_LED:IS31FL3236A-TQ
|
Driver_LED:IS31FL3236A-TQ
|
||||||
Driver_LED:IS31FL3242
|
|
||||||
Driver_LED:IS31FL3731-QF
|
Driver_LED:IS31FL3731-QF
|
||||||
Driver_LED:IS31FL3731-SA
|
Driver_LED:IS31FL3731-SA
|
||||||
Driver_LED:IS31FL3733-QF
|
Driver_LED:IS31FL3733-QF
|
||||||
|
|
@ -8274,10 +8271,6 @@ Filter:MAX7422xUA
|
||||||
Filter:MAX7423xUA
|
Filter:MAX7423xUA
|
||||||
Filter:MAX7424xUA
|
Filter:MAX7424xUA
|
||||||
Filter:MAX7425xUA
|
Filter:MAX7425xUA
|
||||||
Filter:MAX7426xPA
|
|
||||||
Filter:MAX7426xUA
|
|
||||||
Filter:MAX7427xPA
|
|
||||||
Filter:MAX7427xUA
|
|
||||||
Filter:MAX7480xPA
|
Filter:MAX7480xPA
|
||||||
Filter:MAX7480xSA
|
Filter:MAX7480xSA
|
||||||
Filter:P300PL104M275xC222
|
Filter:P300PL104M275xC222
|
||||||
|
|
@ -9666,6 +9659,7 @@ Logic_Programmable:PAL20L10xxNS
|
||||||
Logic_Programmable:PAL20L8
|
Logic_Programmable:PAL20L8
|
||||||
Logic_Programmable:PAL20R8xx-P
|
Logic_Programmable:PAL20R8xx-P
|
||||||
Logic_Programmable:PAL20RS10
|
Logic_Programmable:PAL20RS10
|
||||||
|
Logic_Programmable:PAL24
|
||||||
Logic_Programmable:PALCE16V8
|
Logic_Programmable:PALCE16V8
|
||||||
Logic_Programmable:PEEL22CV10AP
|
Logic_Programmable:PEEL22CV10AP
|
||||||
Logic_Programmable:PEEL22CV10AS
|
Logic_Programmable:PEEL22CV10AS
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Norm
|
||||||
'eda_exclude_bom' => 'eda_exclude_from_bom',
|
'eda_exclude_bom' => 'eda_exclude_from_bom',
|
||||||
'eda_exclude_board' => 'eda_exclude_from_board',
|
'eda_exclude_board' => 'eda_exclude_from_board',
|
||||||
'eda_exclude_sim' => 'eda_exclude_from_sim',
|
'eda_exclude_sim' => 'eda_exclude_from_sim',
|
||||||
//NOTE: "eda_invisible" is intentionally NOT mapped here: it is the *inverse* of
|
'eda_invisible' => 'eda_visibility',
|
||||||
//"eda_visibility", so a plain key rename would store the wrong value. It is handled
|
|
||||||
//(and inverted) explicitly in applyEdaFields().
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|
@ -237,9 +235,6 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Norm
|
||||||
}
|
}
|
||||||
if (isset($data['eda_visibility']) && $data['eda_visibility'] !== '') {
|
if (isset($data['eda_visibility']) && $data['eda_visibility'] !== '') {
|
||||||
$edaInfo->setVisibility(filter_var($data['eda_visibility'], FILTER_VALIDATE_BOOLEAN));
|
$edaInfo->setVisibility(filter_var($data['eda_visibility'], FILTER_VALIDATE_BOOLEAN));
|
||||||
} elseif (isset($data['eda_invisible']) && $data['eda_invisible'] !== '') {
|
|
||||||
//"eda_invisible" is the inverse convenience alias of "eda_visibility"
|
|
||||||
$edaInfo->setVisibility(!filter_var($data['eda_invisible'], FILTER_VALIDATE_BOOLEAN));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -350,84 +350,6 @@ EOT;
|
||||||
$this->assertSame('test,test2', $results[0]->getTags());
|
$this->assertSame('test,test2', $results[0]->getTags());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testImportAcceptsNestedEdaInfoColumns(): void
|
|
||||||
{
|
|
||||||
//The API / JSON export writes EDA columns as "eda_info.kicad_symbol"; re-importing such a
|
|
||||||
//file must fill the EDA fields (previously these columns were silently dropped).
|
|
||||||
$input = "name;eda_info.kicad_symbol;eda_info.kicad_footprint;eda_info.reference_prefix;eda_info.value\n"
|
|
||||||
."Nested EDA part;Device:L;Inductor_THT:L_Axial_0307;L;100uH";
|
|
||||||
|
|
||||||
$category = new Category();
|
|
||||||
$category->setName('Test EDA category');
|
|
||||||
|
|
||||||
$errors = [];
|
|
||||||
$results = $this->service->importString($input, [
|
|
||||||
'class' => Part::class,
|
|
||||||
'format' => 'csv',
|
|
||||||
'csv_delimiter' => ';',
|
|
||||||
'create_unknown_datastructures' => true,
|
|
||||||
'part_category' => $category,
|
|
||||||
], $errors);
|
|
||||||
|
|
||||||
$this->assertCount(1, $results);
|
|
||||||
$this->assertEmpty($errors);
|
|
||||||
$eda = $results[0]->getEdaInfo();
|
|
||||||
$this->assertSame('Device:L', $eda->getKicadSymbol());
|
|
||||||
$this->assertSame('Inductor_THT:L_Axial_0307', $eda->getKicadFootprint());
|
|
||||||
$this->assertSame('L', $eda->getReferencePrefix());
|
|
||||||
$this->assertSame('100uH', $eda->getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testImportAcceptsFlatEdaColumns(): void
|
|
||||||
{
|
|
||||||
//The documented flat form (and its short aliases) must keep working.
|
|
||||||
$input = "name;eda_kicad_symbol;kicad_footprint;kicad_reference\n"
|
|
||||||
."Flat EDA part;Device:R;Resistor_SMD:R_0805_2012Metric;R";
|
|
||||||
|
|
||||||
$category = new Category();
|
|
||||||
$category->setName('Test EDA category');
|
|
||||||
|
|
||||||
$errors = [];
|
|
||||||
$results = $this->service->importString($input, [
|
|
||||||
'class' => Part::class,
|
|
||||||
'format' => 'csv',
|
|
||||||
'csv_delimiter' => ';',
|
|
||||||
'create_unknown_datastructures' => true,
|
|
||||||
'part_category' => $category,
|
|
||||||
], $errors);
|
|
||||||
|
|
||||||
$this->assertCount(1, $results);
|
|
||||||
$this->assertEmpty($errors);
|
|
||||||
$eda = $results[0]->getEdaInfo();
|
|
||||||
$this->assertSame('Device:R', $eda->getKicadSymbol());
|
|
||||||
$this->assertSame('Resistor_SMD:R_0805_2012Metric', $eda->getKicadFootprint());
|
|
||||||
$this->assertSame('R', $eda->getReferencePrefix());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testImportInvisibleAliasInvertsVisibility(): void
|
|
||||||
{
|
|
||||||
//"eda_invisible" is the inverse convenience alias of "eda_visibility": eda_invisible=1
|
|
||||||
//must make the part NOT visible to the EDA tool (visibility=false), not visible.
|
|
||||||
$input = "name;eda_invisible\n"
|
|
||||||
."Hidden EDA part;1";
|
|
||||||
|
|
||||||
$category = new Category();
|
|
||||||
$category->setName('Test EDA category');
|
|
||||||
|
|
||||||
$errors = [];
|
|
||||||
$results = $this->service->importString($input, [
|
|
||||||
'class' => Part::class,
|
|
||||||
'format' => 'csv',
|
|
||||||
'csv_delimiter' => ';',
|
|
||||||
'create_unknown_datastructures' => true,
|
|
||||||
'part_category' => $category,
|
|
||||||
], $errors);
|
|
||||||
|
|
||||||
$this->assertCount(1, $results);
|
|
||||||
$this->assertEmpty($errors);
|
|
||||||
$this->assertFalse($results[0]->getEdaInfo()->getVisibility());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testImportExcelFileProjects(): void
|
public function testImportExcelFileProjects(): void
|
||||||
{
|
{
|
||||||
$spreadsheet = new Spreadsheet();
|
$spreadsheet = new Spreadsheet();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue