From 1be96a81a388b84f0776d9c319b3dd83477893d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Thu, 12 Nov 2020 21:47:53 +0100 Subject: [PATCH] initial --- .gitignore | 1 + .idea/dashie-json-cleaner.iml | 11 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 117 +++ Cargo.lock | 85 ++ Cargo.toml | 12 + cleaned.json | 643 ++++++++++++++ src/categories.json | 1491 +++++++++++++++++++++++++++++++++ src/main.rs | 20 + 10 files changed, 2394 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/dashie-json-cleaner.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 cleaned.json create mode 100644 src/categories.json create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/.idea/dashie-json-cleaner.iml b/.idea/dashie-json-cleaner.iml new file mode 100644 index 0000000..c254557 --- /dev/null +++ b/.idea/dashie-json-cleaner.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5f94e0d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..40dbcbd --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1605213513593 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..a7f3d98 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,85 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "dashie-json-cleaner" +version = "0.1.0" +dependencies = [ + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "itoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "serde" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" + +[[package]] +name = "serde_derive" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..731bc26 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "dashie-json-cleaner" +version = "0.1.0" +authors = ["Ondřej Hruška "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde = "1.0.117" +serde_json = "1.0.59" +serde_derive = "1.0.117" diff --git a/cleaned.json b/cleaned.json new file mode 100644 index 0000000..b21e940 --- /dev/null +++ b/cleaned.json @@ -0,0 +1,643 @@ +{ + "name": "Root Category", + "children": [ + { + "name": "# Free Space", + "description": "" + }, + { + "name": "1 Active Components", + "description": "", + "children": [ + { + "name": "1 Semiconductors", + "description": "", + "children": [ + { + "name": "1 Transistors", + "description": "", + "children": [ + { + "name": "MOSFET", + "description": "" + }, + { + "name": "NPN", + "description": "" + }, + { + "name": "PNP", + "description": "" + } + ] + }, + { + "name": "2 Integrated Circuits", + "description": "", + "children": [ + { + "name": "1 7400 series", + "description": "https://en.wikipedia.org/wiki/List_of_7400-series_integrated_circuits", + "children": [ + { + "name": "1 Counters", + "description": "" + }, + { + "name": "Z Others", + "description": "" + } + ] + }, + { + "name": "2 ADC, DAC", + "description": "" + }, + { + "name": "3 Microcontrollers", + "description": "" + }, + { + "name": "4 OpAmps", + "description": "" + }, + { + "name": "5 Timers", + "description": "" + }, + { + "name": "6 EPROM", + "description": "" + }, + { + "name": "7 EEPROM", + "description": "" + }, + { + "name": "8 Comparators", + "description": "" + }, + { + "name": "9 MOSFET Drivers", + "description": "" + }, + { + "name": "A Voltage Regulators / Controllers", + "description": "" + }, + { + "name": "Z Others", + "description": "" + }, + { + "name": "B FPGA", + "description": "" + }, + { + "name": "C CPLD", + "description": "" + }, + { + "name": "D PAL", + "description": "" + }, + { + "name": "E GAL", + "description": "" + }, + { + "name": "F RAM", + "description": "", + "children": [ + { + "name": "SRAM", + "description": "" + }, + { + "name": "DRAM", + "description": "" + } + ] + }, + { + "name": "G Buffer/Line driver", + "description": "" + }, + { + "name": "H UART / Serial", + "description": "" + }, + { + "name": "0 4000 series", + "description": "https://en.wikipedia.org/wiki/List_of_4000-series_integrated_circuits", + "children": [ + { + "name": "Analog Switches", + "description": "" + } + ] + } + ] + }, + { + "name": "3 Diodes", + "description": "", + "children": [ + { + "name": "1 Universal", + "description": "" + }, + { + "name": "2 Schottky", + "description": "" + }, + { + "name": "3 Z Diodes", + "description": "" + }, + { + "name": "4 Rectifiers and Rectifier Diodes", + "description": "" + } + ] + }, + { + "name": "4 Triacs", + "description": "" + }, + { + "name": "5 Voltage References", + "description": "" + }, + { + "name": "Thyristor", + "description": "", + "children": [ + { + "name": "1 TRIACs", + "description": "" + }, + { + "name": "2 SCR", + "description": "" + } + ] + } + ] + }, + { + "name": "2 Optoelectronics", + "description": "", + "children": [ + { + "name": "1 LED", + "description": "", + "children": [ + { + "name": "Module", + "description": "" + }, + { + "name": "SMD", + "description": "" + }, + { + "name": "Standard", + "description": "" + } + ] + }, + { + "name": "2 LCD Displays", + "description": "", + "children": [ + { + "name": "1 Text", + "description": "" + }, + { + "name": "2 Graphics", + "description": "" + } + ] + }, + { + "name": "3 Octocouplers", + "description": "" + }, + { + "name": "4 Others", + "description": "" + }, + { + "name": "5 Optical Switches", + "description": "" + } + ] + }, + { + "name": "3 Others", + "description": "", + "children": [ + { + "name": "Inverter", + "description": "" + } + ] + } + ] + }, + { + "name": "2 Passive Components", + "description": "", + "children": [ + { + "name": "1 Resistors", + "description": "", + "children": [ + { + "name": "1 Metal Film 1%", + "description": "" + }, + { + "name": "2 Carbon Film 5%", + "description": "" + }, + { + "name": "3 Networks", + "description": "" + }, + { + "name": "4 Power Resistors", + "description": "" + }, + { + "name": "PTC", + "description": "" + } + ] + }, + { + "name": "2 Capacitors", + "description": "", + "children": [ + { + "name": "1 Ceramic", + "description": "" + }, + { + "name": "2 Electrolythic", + "description": "" + }, + { + "name": "3 Film", + "description": "" + }, + { + "name": "Styroflex", + "description": "" + }, + { + "name": "Tantal", + "description": "" + } + ] + }, + { + "name": "3 Crystals, OSC, Filt", + "description": "", + "children": [ + { + "name": "1 Crystals", + "description": "" + }, + { + "name": "2 Oscillators", + "description": "" + }, + { + "name": "3 Filters", + "description": "" + } + ] + }, + { + "name": "4 Potentiometers / Padders", + "description": "", + "children": [ + { + "name": "1 Potentiometers", + "description": "" + }, + { + "name": "2 Trimmer", + "description": "", + "children": [ + { + "name": "1 10/25 Tirms precision", + "description": "" + }, + { + "name": "2 Cermet", + "description": "" + }, + { + "name": "3 Precision", + "description": "" + } + ] + }, + { + "name": "3 Slide Potentiometer", + "description": "" + }, + { + "name": "4 Encoders", + "description": "" + } + ] + }, + { + "name": "8 Photoresistors / LDRs", + "description": "" + }, + { + "name": "9 Varistor", + "description": "" + } + ] + }, + { + "name": "3 Electromechanical Parts", + "description": "", + "children": [ + { + "name": "1 Connectors", + "description": "", + "children": [ + { + "name": "1 IC Sockets", + "description": "" + }, + { + "name": "2 PCB Connectors", + "description": "", + "children": [ + { + "name": "1 Rectangular", + "description": "", + "children": [ + { + "name": "1 Wire-to-Board", + "description": "" + }, + { + "name": "2 USB", + "description": "" + }, + { + "name": "3 D-Sub", + "description": "" + }, + { + "name": "4 IDC Connectors and Box Headers", + "description": "" + }, + { + "name": "5 Terminal Blocks", + "description": "" + }, + { + "name": "6 Board to Board", + "description": "" + }, + { + "name": "7 Pin Headers", + "description": "" + } + ] + }, + { + "name": "2 Round", + "description": "" + }, + { + "name": "3 Audio", + "description": "" + }, + { + "name": "4 Others", + "description": "" + }, + { + "name": "5 WAGO", + "description": "" + }, + { + "name": "6 Faston", + "description": "" + }, + { + "name": "7 HF", + "description": "" + }, + { + "name": "8 DC Power Jacks", + "description": "" + }, + { + "name": "9 Lab Connectors", + "description": "" + } + ] + } + ] + }, + { + "name": "2 Switches and Buttons", + "description": "", + "children": [ + { + "name": "1 Switches", + "description": "" + }, + { + "name": "2 Push Button", + "description": "" + }, + { + "name": "3 Code Switches", + "description": "" + }, + { + "name": "4 DIP Switches", + "description": "" + }, + { + "name": "5 Accessories", + "description": "" + } + ] + }, + { + "name": "3 Relais", + "description": "" + }, + { + "name": "4 Fuses", + "description": "", + "children": [ + { + "name": "1 5*20", + "description": "" + }, + { + "name": "2 6,3*32", + "description": "" + }, + { + "name": "3 Blade Fuses", + "description": "" + } + ] + }, + { + "name": "5 Battery Holders", + "description": "" + }, + { + "name": "6 Transformers", + "description": "" + }, + { + "name": "7 Motors", + "description": "", + "children": [ + { + "name": "1 DC", + "description": "" + }, + { + "name": "2 Stepper", + "description": "" + }, + { + "name": "3 Servo", + "description": "" + }, + { + "name": "4 Brushless", + "description": "" + } + ] + }, + { + "name": "8 Selenoids", + "description": "" + } + ] + }, + { + "name": "4 Mechanical Parts", + "description": "", + "children": [ + { + "name": "1 Mica Washers", + "description": "" + }, + { + "name": "2 Cooling", + "description": "" + }, + { + "name": "3 Screws", + "description": "", + "children": [ + { + "name": "1 Auto", + "description": "" + }, + { + "name": "2 Mx", + "description": "" + }, + { + "name": "3 Imperial", + "description": "" + } + ] + }, + { + "name": "5 Nuts", + "description": "" + }, + { + "name": "6 Pulleys", + "description": "" + }, + { + "name": "7 Bearings", + "description": "" + }, + { + "name": "8 Spacers", + "description": "" + }, + { + "name": "9 Sliding things", + "description": "" + } + ] + }, + { + "name": "5 Cables", + "description": "", + "children": [ + { + "name": "1 Spools", + "description": "" + }, + { + "name": "2 Ribbon Cable", + "description": "" + } + ] + }, + { + "name": "6 Speakers and Buzzers", + "description": "" + }, + { + "name": "V Modules", + "description": "" + }, + { + "name": "W PC Stuff", + "description": "" + }, + { + "name": "X PCB Material", + "description": "" + }, + { + "name": "Y Other Stuff", + "description": "" + }, + { + "name": "Z Projects", + "description": "" + }, + { + "name": "U 3D Printing", + "description": "" + }, + { + "name": "T Books", + "description": "" + }, + { + "name": "# To test", + "description": "" + } + ] +} diff --git a/src/categories.json b/src/categories.json new file mode 100644 index 0000000..1a047d8 --- /dev/null +++ b/src/categories.json @@ -0,0 +1,1491 @@ +{ + "@context": "/api/contexts/PartCategory", + "@id": "/api/part_categories/1", + "@type": "PartCategory", + "parent": null, + "children": [ + { + "@id": "/api/part_categories/2", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ # Free Space", + "expanded": true, + "name": "# Free Space", + "description": "" + }, + { + "@id": "/api/part_categories/3", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [ + { + "@id": "/api/part_categories/14", + "@type": "PartCategory", + "parent": "/api/part_categories/3", + "children": [ + { + "@id": "/api/part_categories/17", + "@type": "PartCategory", + "parent": "/api/part_categories/14", + "children": [ + { + "@id": "/api/part_categories/23", + "@type": "PartCategory", + "parent": "/api/part_categories/17", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 1 Transistors ➤ MOSFET", + "expanded": true, + "name": "MOSFET", + "description": "" + }, + { + "@id": "/api/part_categories/24", + "@type": "PartCategory", + "parent": "/api/part_categories/17", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 1 Transistors ➤ NPN", + "expanded": true, + "name": "NPN", + "description": "" + }, + { + "@id": "/api/part_categories/25", + "@type": "PartCategory", + "parent": "/api/part_categories/17", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 1 Transistors ➤ PNP", + "expanded": true, + "name": "PNP", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 1 Transistors", + "expanded": true, + "name": "1 Transistors", + "description": "" + }, + { + "@id": "/api/part_categories/18", + "@type": "PartCategory", + "parent": "/api/part_categories/14", + "children": [ + { + "@id": "/api/part_categories/26", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [ + { + "@id": "/api/part_categories/146", + "@type": "PartCategory", + "parent": "/api/part_categories/26", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 1 7400 series ➤ 1 Counters", + "expanded": true, + "name": "1 Counters", + "description": "" + }, + { + "@id": "/api/part_categories/147", + "@type": "PartCategory", + "parent": "/api/part_categories/26", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 1 7400 series ➤ Z Others", + "expanded": true, + "name": "Z Others", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 1 7400 series", + "expanded": true, + "name": "1 7400 series", + "description": "https://en.wikipedia.org/wiki/List_of_7400-series_integrated_circuits" + }, + { + "@id": "/api/part_categories/27", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 2 ADC, DAC", + "expanded": true, + "name": "2 ADC, DAC", + "description": "" + }, + { + "@id": "/api/part_categories/28", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 3 Microcontrollers", + "expanded": true, + "name": "3 Microcontrollers", + "description": "" + }, + { + "@id": "/api/part_categories/29", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 4 OpAmps", + "expanded": true, + "name": "4 OpAmps", + "description": "" + }, + { + "@id": "/api/part_categories/30", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 5 Timers", + "expanded": true, + "name": "5 Timers", + "description": "" + }, + { + "@id": "/api/part_categories/31", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 6 EPROM", + "expanded": true, + "name": "6 EPROM", + "description": "" + }, + { + "@id": "/api/part_categories/32", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 7 EEPROM", + "expanded": true, + "name": "7 EEPROM", + "description": "" + }, + { + "@id": "/api/part_categories/33", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 8 Comparators", + "expanded": true, + "name": "8 Comparators", + "description": "" + }, + { + "@id": "/api/part_categories/34", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 9 MOSFET Drivers", + "expanded": true, + "name": "9 MOSFET Drivers", + "description": "" + }, + { + "@id": "/api/part_categories/35", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ A Voltage Regulators / Controllers", + "expanded": true, + "name": "A Voltage Regulators / Controllers", + "description": "" + }, + { + "@id": "/api/part_categories/36", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ Z Others", + "expanded": true, + "name": "Z Others", + "description": "" + }, + { + "@id": "/api/part_categories/131", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ B FPGA", + "expanded": true, + "name": "B FPGA", + "description": "" + }, + { + "@id": "/api/part_categories/132", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ C CPLD", + "expanded": true, + "name": "C CPLD", + "description": "" + }, + { + "@id": "/api/part_categories/133", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ D PAL", + "expanded": true, + "name": "D PAL", + "description": "" + }, + { + "@id": "/api/part_categories/134", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ E GAL", + "expanded": true, + "name": "E GAL", + "description": "" + }, + { + "@id": "/api/part_categories/135", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [ + { + "@id": "/api/part_categories/136", + "@type": "PartCategory", + "parent": "/api/part_categories/135", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ F RAM ➤ SRAM", + "expanded": true, + "name": "SRAM", + "description": "" + }, + { + "@id": "/api/part_categories/137", + "@type": "PartCategory", + "parent": "/api/part_categories/135", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ F RAM ➤ DRAM", + "expanded": true, + "name": "DRAM", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ F RAM", + "expanded": true, + "name": "F RAM", + "description": "" + }, + { + "@id": "/api/part_categories/138", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ G Buffer/Line driver", + "expanded": true, + "name": "G Buffer/Line driver", + "description": "" + }, + { + "@id": "/api/part_categories/145", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ H UART / Serial", + "expanded": true, + "name": "H UART / Serial", + "description": "" + }, + { + "@id": "/api/part_categories/148", + "@type": "PartCategory", + "parent": "/api/part_categories/18", + "children": [ + { + "@id": "/api/part_categories/149", + "@type": "PartCategory", + "parent": "/api/part_categories/148", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 0 4000 series ➤ Analog Switches", + "expanded": true, + "name": "Analog Switches", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits ➤ 0 4000 series", + "expanded": true, + "name": "0 4000 series", + "description": "https://en.wikipedia.org/wiki/List_of_4000-series_integrated_circuits" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 2 Integrated Circuits", + "expanded": true, + "name": "2 Integrated Circuits", + "description": "" + }, + { + "@id": "/api/part_categories/19", + "@type": "PartCategory", + "parent": "/api/part_categories/14", + "children": [ + { + "@id": "/api/part_categories/39", + "@type": "PartCategory", + "parent": "/api/part_categories/19", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 3 Diodes ➤ 1 Universal", + "expanded": true, + "name": "1 Universal", + "description": "" + }, + { + "@id": "/api/part_categories/40", + "@type": "PartCategory", + "parent": "/api/part_categories/19", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 3 Diodes ➤ 2 Schottky", + "expanded": true, + "name": "2 Schottky", + "description": "" + }, + { + "@id": "/api/part_categories/41", + "@type": "PartCategory", + "parent": "/api/part_categories/19", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 3 Diodes ➤ 3 Z Diodes", + "expanded": true, + "name": "3 Z Diodes", + "description": "" + }, + { + "@id": "/api/part_categories/42", + "@type": "PartCategory", + "parent": "/api/part_categories/19", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 3 Diodes ➤ 4 Rectifiers and Rectifier Diodes", + "expanded": true, + "name": "4 Rectifiers and Rectifier Diodes", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 3 Diodes", + "expanded": true, + "name": "3 Diodes", + "description": "" + }, + { + "@id": "/api/part_categories/20", + "@type": "PartCategory", + "parent": "/api/part_categories/14", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 4 Triacs", + "expanded": true, + "name": "4 Triacs", + "description": "" + }, + { + "@id": "/api/part_categories/21", + "@type": "PartCategory", + "parent": "/api/part_categories/14", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ 5 Voltage References", + "expanded": true, + "name": "5 Voltage References", + "description": "" + }, + { + "@id": "/api/part_categories/22", + "@type": "PartCategory", + "parent": "/api/part_categories/14", + "children": [ + { + "@id": "/api/part_categories/43", + "@type": "PartCategory", + "parent": "/api/part_categories/22", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ Thyristor ➤ 1 TRIACs", + "expanded": true, + "name": "1 TRIACs", + "description": "" + }, + { + "@id": "/api/part_categories/44", + "@type": "PartCategory", + "parent": "/api/part_categories/22", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ Thyristor ➤ 2 SCR", + "expanded": true, + "name": "2 SCR", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors ➤ Thyristor", + "expanded": true, + "name": "Thyristor", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 1 Semiconductors", + "expanded": true, + "name": "1 Semiconductors", + "description": "" + }, + { + "@id": "/api/part_categories/15", + "@type": "PartCategory", + "parent": "/api/part_categories/3", + "children": [ + { + "@id": "/api/part_categories/45", + "@type": "PartCategory", + "parent": "/api/part_categories/15", + "children": [ + { + "@id": "/api/part_categories/46", + "@type": "PartCategory", + "parent": "/api/part_categories/45", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 1 LED ➤ Module", + "expanded": true, + "name": "Module", + "description": "" + }, + { + "@id": "/api/part_categories/47", + "@type": "PartCategory", + "parent": "/api/part_categories/45", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 1 LED ➤ SMD", + "expanded": true, + "name": "SMD", + "description": "" + }, + { + "@id": "/api/part_categories/48", + "@type": "PartCategory", + "parent": "/api/part_categories/45", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 1 LED ➤ Standard", + "expanded": true, + "name": "Standard", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 1 LED", + "expanded": true, + "name": "1 LED", + "description": "" + }, + { + "@id": "/api/part_categories/49", + "@type": "PartCategory", + "parent": "/api/part_categories/15", + "children": [ + { + "@id": "/api/part_categories/50", + "@type": "PartCategory", + "parent": "/api/part_categories/49", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 2 LCD Displays ➤ 1 Text", + "expanded": true, + "name": "1 Text", + "description": "" + }, + { + "@id": "/api/part_categories/51", + "@type": "PartCategory", + "parent": "/api/part_categories/49", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 2 LCD Displays ➤ 2 Graphics", + "expanded": true, + "name": "2 Graphics", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 2 LCD Displays", + "expanded": true, + "name": "2 LCD Displays", + "description": "" + }, + { + "@id": "/api/part_categories/52", + "@type": "PartCategory", + "parent": "/api/part_categories/15", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 3 Octocouplers", + "expanded": true, + "name": "3 Octocouplers", + "description": "" + }, + { + "@id": "/api/part_categories/53", + "@type": "PartCategory", + "parent": "/api/part_categories/15", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 4 Others", + "expanded": true, + "name": "4 Others", + "description": "" + }, + { + "@id": "/api/part_categories/54", + "@type": "PartCategory", + "parent": "/api/part_categories/15", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics ➤ 5 Optical Switches", + "expanded": true, + "name": "5 Optical Switches", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 2 Optoelectronics", + "expanded": true, + "name": "2 Optoelectronics", + "description": "" + }, + { + "@id": "/api/part_categories/16", + "@type": "PartCategory", + "parent": "/api/part_categories/3", + "children": [ + { + "@id": "/api/part_categories/55", + "@type": "PartCategory", + "parent": "/api/part_categories/16", + "children": [], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 3 Others ➤ Inverter", + "expanded": true, + "name": "Inverter", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components ➤ 3 Others", + "expanded": true, + "name": "3 Others", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 1 Active Components", + "expanded": true, + "name": "1 Active Components", + "description": "" + }, + { + "@id": "/api/part_categories/4", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [ + { + "@id": "/api/part_categories/56", + "@type": "PartCategory", + "parent": "/api/part_categories/4", + "children": [ + { + "@id": "/api/part_categories/57", + "@type": "PartCategory", + "parent": "/api/part_categories/56", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 1 Resistors ➤ 1 Metal Film 1%", + "expanded": true, + "name": "1 Metal Film 1%", + "description": "" + }, + { + "@id": "/api/part_categories/58", + "@type": "PartCategory", + "parent": "/api/part_categories/56", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 1 Resistors ➤ 2 Carbon Film 5%", + "expanded": true, + "name": "2 Carbon Film 5%", + "description": "" + }, + { + "@id": "/api/part_categories/59", + "@type": "PartCategory", + "parent": "/api/part_categories/56", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 1 Resistors ➤ 3 Networks", + "expanded": true, + "name": "3 Networks", + "description": "" + }, + { + "@id": "/api/part_categories/60", + "@type": "PartCategory", + "parent": "/api/part_categories/56", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 1 Resistors ➤ 4 Power Resistors", + "expanded": true, + "name": "4 Power Resistors", + "description": "" + }, + { + "@id": "/api/part_categories/61", + "@type": "PartCategory", + "parent": "/api/part_categories/56", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 1 Resistors ➤ PTC", + "expanded": true, + "name": "PTC", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 1 Resistors", + "expanded": true, + "name": "1 Resistors", + "description": "" + }, + { + "@id": "/api/part_categories/62", + "@type": "PartCategory", + "parent": "/api/part_categories/4", + "children": [ + { + "@id": "/api/part_categories/63", + "@type": "PartCategory", + "parent": "/api/part_categories/62", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 2 Capacitors ➤ 1 Ceramic", + "expanded": true, + "name": "1 Ceramic", + "description": "" + }, + { + "@id": "/api/part_categories/64", + "@type": "PartCategory", + "parent": "/api/part_categories/62", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 2 Capacitors ➤ 2 Electrolythic", + "expanded": true, + "name": "2 Electrolythic", + "description": "" + }, + { + "@id": "/api/part_categories/65", + "@type": "PartCategory", + "parent": "/api/part_categories/62", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 2 Capacitors ➤ 3 Film", + "expanded": true, + "name": "3 Film", + "description": "" + }, + { + "@id": "/api/part_categories/66", + "@type": "PartCategory", + "parent": "/api/part_categories/62", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 2 Capacitors ➤ Styroflex", + "expanded": true, + "name": "Styroflex", + "description": "" + }, + { + "@id": "/api/part_categories/67", + "@type": "PartCategory", + "parent": "/api/part_categories/62", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 2 Capacitors ➤ Tantal", + "expanded": true, + "name": "Tantal", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 2 Capacitors", + "expanded": true, + "name": "2 Capacitors", + "description": "" + }, + { + "@id": "/api/part_categories/68", + "@type": "PartCategory", + "parent": "/api/part_categories/4", + "children": [ + { + "@id": "/api/part_categories/69", + "@type": "PartCategory", + "parent": "/api/part_categories/68", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 3 Crystals, OSC, Filt ➤ 1 Crystals", + "expanded": true, + "name": "1 Crystals", + "description": "" + }, + { + "@id": "/api/part_categories/70", + "@type": "PartCategory", + "parent": "/api/part_categories/68", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 3 Crystals, OSC, Filt ➤ 2 Oscillators", + "expanded": true, + "name": "2 Oscillators", + "description": "" + }, + { + "@id": "/api/part_categories/142", + "@type": "PartCategory", + "parent": "/api/part_categories/68", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 3 Crystals, OSC, Filt ➤ 3 Filters", + "expanded": true, + "name": "3 Filters", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 3 Crystals, OSC, Filt", + "expanded": true, + "name": "3 Crystals, OSC, Filt", + "description": "" + }, + { + "@id": "/api/part_categories/71", + "@type": "PartCategory", + "parent": "/api/part_categories/4", + "children": [ + { + "@id": "/api/part_categories/72", + "@type": "PartCategory", + "parent": "/api/part_categories/71", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders ➤ 1 Potentiometers", + "expanded": true, + "name": "1 Potentiometers", + "description": "" + }, + { + "@id": "/api/part_categories/73", + "@type": "PartCategory", + "parent": "/api/part_categories/71", + "children": [ + { + "@id": "/api/part_categories/74", + "@type": "PartCategory", + "parent": "/api/part_categories/73", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders ➤ 2 Trimmer ➤ 1 10/25 Tirms precision", + "expanded": true, + "name": "1 10/25 Tirms precision", + "description": "" + }, + { + "@id": "/api/part_categories/75", + "@type": "PartCategory", + "parent": "/api/part_categories/73", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders ➤ 2 Trimmer ➤ 2 Cermet", + "expanded": true, + "name": "2 Cermet", + "description": "" + }, + { + "@id": "/api/part_categories/76", + "@type": "PartCategory", + "parent": "/api/part_categories/73", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders ➤ 2 Trimmer ➤ 3 Precision", + "expanded": true, + "name": "3 Precision", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders ➤ 2 Trimmer", + "expanded": true, + "name": "2 Trimmer", + "description": "" + }, + { + "@id": "/api/part_categories/77", + "@type": "PartCategory", + "parent": "/api/part_categories/71", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders ➤ 3 Slide Potentiometer", + "expanded": true, + "name": "3 Slide Potentiometer", + "description": "" + }, + { + "@id": "/api/part_categories/78", + "@type": "PartCategory", + "parent": "/api/part_categories/71", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders ➤ 4 Encoders", + "expanded": true, + "name": "4 Encoders", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 4 Potentiometers / Padders", + "expanded": true, + "name": "4 Potentiometers / Padders", + "description": "" + }, + { + "@id": "/api/part_categories/79", + "@type": "PartCategory", + "parent": "/api/part_categories/4", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 8 Photoresistors / LDRs", + "expanded": true, + "name": "8 Photoresistors / LDRs", + "description": "" + }, + { + "@id": "/api/part_categories/80", + "@type": "PartCategory", + "parent": "/api/part_categories/4", + "children": [], + "categoryPath": "Root Category ➤ 2 Passive Components ➤ 9 Varistor", + "expanded": true, + "name": "9 Varistor", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 2 Passive Components", + "expanded": true, + "name": "2 Passive Components", + "description": "" + }, + { + "@id": "/api/part_categories/5", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [ + { + "@id": "/api/part_categories/81", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [ + { + "@id": "/api/part_categories/82", + "@type": "PartCategory", + "parent": "/api/part_categories/81", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 1 IC Sockets", + "expanded": true, + "name": "1 IC Sockets", + "description": "" + }, + { + "@id": "/api/part_categories/83", + "@type": "PartCategory", + "parent": "/api/part_categories/81", + "children": [ + { + "@id": "/api/part_categories/84", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [ + { + "@id": "/api/part_categories/85", + "@type": "PartCategory", + "parent": "/api/part_categories/84", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular ➤ 1 Wire-to-Board", + "expanded": true, + "name": "1 Wire-to-Board", + "description": "" + }, + { + "@id": "/api/part_categories/86", + "@type": "PartCategory", + "parent": "/api/part_categories/84", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular ➤ 2 USB", + "expanded": true, + "name": "2 USB", + "description": "" + }, + { + "@id": "/api/part_categories/87", + "@type": "PartCategory", + "parent": "/api/part_categories/84", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular ➤ 3 D-Sub", + "expanded": true, + "name": "3 D-Sub", + "description": "" + }, + { + "@id": "/api/part_categories/88", + "@type": "PartCategory", + "parent": "/api/part_categories/84", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular ➤ 4 IDC Connectors and Box Headers", + "expanded": true, + "name": "4 IDC Connectors and Box Headers", + "description": "" + }, + { + "@id": "/api/part_categories/89", + "@type": "PartCategory", + "parent": "/api/part_categories/84", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular ➤ 5 Terminal Blocks", + "expanded": true, + "name": "5 Terminal Blocks", + "description": "" + }, + { + "@id": "/api/part_categories/90", + "@type": "PartCategory", + "parent": "/api/part_categories/84", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular ➤ 6 Board to Board", + "expanded": true, + "name": "6 Board to Board", + "description": "" + }, + { + "@id": "/api/part_categories/91", + "@type": "PartCategory", + "parent": "/api/part_categories/84", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular ➤ 7 Pin Headers", + "expanded": true, + "name": "7 Pin Headers", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 1 Rectangular", + "expanded": true, + "name": "1 Rectangular", + "description": "" + }, + { + "@id": "/api/part_categories/92", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 2 Round", + "expanded": true, + "name": "2 Round", + "description": "" + }, + { + "@id": "/api/part_categories/93", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 3 Audio", + "expanded": true, + "name": "3 Audio", + "description": "" + }, + { + "@id": "/api/part_categories/94", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 4 Others", + "expanded": true, + "name": "4 Others", + "description": "" + }, + { + "@id": "/api/part_categories/95", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 5 WAGO", + "expanded": true, + "name": "5 WAGO", + "description": "" + }, + { + "@id": "/api/part_categories/96", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 6 Faston", + "expanded": true, + "name": "6 Faston", + "description": "" + }, + { + "@id": "/api/part_categories/97", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 7 HF", + "expanded": true, + "name": "7 HF", + "description": "" + }, + { + "@id": "/api/part_categories/98", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 8 DC Power Jacks", + "expanded": true, + "name": "8 DC Power Jacks", + "description": "" + }, + { + "@id": "/api/part_categories/99", + "@type": "PartCategory", + "parent": "/api/part_categories/83", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors ➤ 9 Lab Connectors", + "expanded": true, + "name": "9 Lab Connectors", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors ➤ 2 PCB Connectors", + "expanded": true, + "name": "2 PCB Connectors", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 1 Connectors", + "expanded": true, + "name": "1 Connectors", + "description": "" + }, + { + "@id": "/api/part_categories/100", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [ + { + "@id": "/api/part_categories/101", + "@type": "PartCategory", + "parent": "/api/part_categories/100", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 2 Switches and Buttons ➤ 1 Switches", + "expanded": true, + "name": "1 Switches", + "description": "" + }, + { + "@id": "/api/part_categories/102", + "@type": "PartCategory", + "parent": "/api/part_categories/100", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 2 Switches and Buttons ➤ 2 Push Button", + "expanded": true, + "name": "2 Push Button", + "description": "" + }, + { + "@id": "/api/part_categories/103", + "@type": "PartCategory", + "parent": "/api/part_categories/100", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 2 Switches and Buttons ➤ 3 Code Switches", + "expanded": true, + "name": "3 Code Switches", + "description": "" + }, + { + "@id": "/api/part_categories/104", + "@type": "PartCategory", + "parent": "/api/part_categories/100", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 2 Switches and Buttons ➤ 4 DIP Switches", + "expanded": true, + "name": "4 DIP Switches", + "description": "" + }, + { + "@id": "/api/part_categories/144", + "@type": "PartCategory", + "parent": "/api/part_categories/100", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 2 Switches and Buttons ➤ 5 Accessories", + "expanded": true, + "name": "5 Accessories", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 2 Switches and Buttons", + "expanded": true, + "name": "2 Switches and Buttons", + "description": "" + }, + { + "@id": "/api/part_categories/105", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 3 Relais", + "expanded": true, + "name": "3 Relais", + "description": "" + }, + { + "@id": "/api/part_categories/106", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [ + { + "@id": "/api/part_categories/110", + "@type": "PartCategory", + "parent": "/api/part_categories/106", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 4 Fuses ➤ 1 5*20", + "expanded": true, + "name": "1 5*20", + "description": "" + }, + { + "@id": "/api/part_categories/111", + "@type": "PartCategory", + "parent": "/api/part_categories/106", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 4 Fuses ➤ 2 6,3*32", + "expanded": true, + "name": "2 6,3*32", + "description": "" + }, + { + "@id": "/api/part_categories/112", + "@type": "PartCategory", + "parent": "/api/part_categories/106", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 4 Fuses ➤ 3 Blade Fuses", + "expanded": true, + "name": "3 Blade Fuses", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 4 Fuses", + "expanded": true, + "name": "4 Fuses", + "description": "" + }, + { + "@id": "/api/part_categories/107", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 5 Battery Holders", + "expanded": true, + "name": "5 Battery Holders", + "description": "" + }, + { + "@id": "/api/part_categories/108", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 6 Transformers", + "expanded": true, + "name": "6 Transformers", + "description": "" + }, + { + "@id": "/api/part_categories/109", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [ + { + "@id": "/api/part_categories/113", + "@type": "PartCategory", + "parent": "/api/part_categories/109", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 7 Motors ➤ 1 DC", + "expanded": true, + "name": "1 DC", + "description": "" + }, + { + "@id": "/api/part_categories/114", + "@type": "PartCategory", + "parent": "/api/part_categories/109", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 7 Motors ➤ 2 Stepper", + "expanded": true, + "name": "2 Stepper", + "description": "" + }, + { + "@id": "/api/part_categories/115", + "@type": "PartCategory", + "parent": "/api/part_categories/109", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 7 Motors ➤ 3 Servo", + "expanded": true, + "name": "3 Servo", + "description": "" + }, + { + "@id": "/api/part_categories/116", + "@type": "PartCategory", + "parent": "/api/part_categories/109", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 7 Motors ➤ 4 Brushless", + "expanded": true, + "name": "4 Brushless", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 7 Motors", + "expanded": true, + "name": "7 Motors", + "description": "" + }, + { + "@id": "/api/part_categories/117", + "@type": "PartCategory", + "parent": "/api/part_categories/5", + "children": [], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts ➤ 8 Selenoids", + "expanded": true, + "name": "8 Selenoids", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 3 Electromechanical Parts", + "expanded": true, + "name": "3 Electromechanical Parts", + "description": "" + }, + { + "@id": "/api/part_categories/6", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [ + { + "@id": "/api/part_categories/118", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 1 Mica Washers", + "expanded": true, + "name": "1 Mica Washers", + "description": "" + }, + { + "@id": "/api/part_categories/119", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 2 Cooling", + "expanded": true, + "name": "2 Cooling", + "description": "" + }, + { + "@id": "/api/part_categories/120", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [ + { + "@id": "/api/part_categories/121", + "@type": "PartCategory", + "parent": "/api/part_categories/120", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 3 Screws ➤ 1 Auto", + "expanded": true, + "name": "1 Auto", + "description": "" + }, + { + "@id": "/api/part_categories/122", + "@type": "PartCategory", + "parent": "/api/part_categories/120", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 3 Screws ➤ 2 Mx", + "expanded": true, + "name": "2 Mx", + "description": "" + }, + { + "@id": "/api/part_categories/123", + "@type": "PartCategory", + "parent": "/api/part_categories/120", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 3 Screws ➤ 3 Imperial", + "expanded": true, + "name": "3 Imperial", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 3 Screws", + "expanded": true, + "name": "3 Screws", + "description": "" + }, + { + "@id": "/api/part_categories/124", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 5 Nuts", + "expanded": true, + "name": "5 Nuts", + "description": "" + }, + { + "@id": "/api/part_categories/125", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 6 Pulleys", + "expanded": true, + "name": "6 Pulleys", + "description": "" + }, + { + "@id": "/api/part_categories/126", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 7 Bearings", + "expanded": true, + "name": "7 Bearings", + "description": "" + }, + { + "@id": "/api/part_categories/127", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 8 Spacers", + "expanded": true, + "name": "8 Spacers", + "description": "" + }, + { + "@id": "/api/part_categories/128", + "@type": "PartCategory", + "parent": "/api/part_categories/6", + "children": [], + "categoryPath": "Root Category ➤ 4 Mechanical Parts ➤ 9 Sliding things", + "expanded": true, + "name": "9 Sliding things", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 4 Mechanical Parts", + "expanded": true, + "name": "4 Mechanical Parts", + "description": "" + }, + { + "@id": "/api/part_categories/7", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [ + { + "@id": "/api/part_categories/129", + "@type": "PartCategory", + "parent": "/api/part_categories/7", + "children": [], + "categoryPath": "Root Category ➤ 5 Cables ➤ 1 Spools", + "expanded": true, + "name": "1 Spools", + "description": "" + }, + { + "@id": "/api/part_categories/130", + "@type": "PartCategory", + "parent": "/api/part_categories/7", + "children": [], + "categoryPath": "Root Category ➤ 5 Cables ➤ 2 Ribbon Cable", + "expanded": true, + "name": "2 Ribbon Cable", + "description": "" + } + ], + "categoryPath": "Root Category ➤ 5 Cables", + "expanded": true, + "name": "5 Cables", + "description": "" + }, + { + "@id": "/api/part_categories/8", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ 6 Speakers and Buzzers", + "expanded": true, + "name": "6 Speakers and Buzzers", + "description": "" + }, + { + "@id": "/api/part_categories/9", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ V Modules", + "expanded": true, + "name": "V Modules", + "description": "" + }, + { + "@id": "/api/part_categories/10", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ W PC Stuff", + "expanded": true, + "name": "W PC Stuff", + "description": "" + }, + { + "@id": "/api/part_categories/11", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ X PCB Material", + "expanded": true, + "name": "X PCB Material", + "description": "" + }, + { + "@id": "/api/part_categories/12", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ Y Other Stuff", + "expanded": true, + "name": "Y Other Stuff", + "description": "" + }, + { + "@id": "/api/part_categories/13", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ Z Projects", + "expanded": true, + "name": "Z Projects", + "description": "" + }, + { + "@id": "/api/part_categories/139", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ U 3D Printing", + "expanded": true, + "name": "U 3D Printing", + "description": "" + }, + { + "@id": "/api/part_categories/140", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ T Books", + "expanded": true, + "name": "T Books", + "description": "" + }, + { + "@id": "/api/part_categories/141", + "@type": "PartCategory", + "parent": "/api/part_categories/1", + "children": [], + "categoryPath": "Root Category ➤ # To test", + "expanded": true, + "name": "# To test", + "description": "" + } + ], + "categoryPath": "Root Category", + "expanded": true, + "name": "Root Category", + "description": null +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..fc42179 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,20 @@ +#[macro_use] extern crate serde_json; +#[macro_use] extern crate serde_derive; + +#[derive(Serialize,Deserialize,Debug,Clone)] +struct Node { + #[serde(skip_serializing_if = "Option::is_none")] + name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + description: Option, + #[serde(skip_serializing_if = "Vec::is_empty")] + children: Vec, +} + +fn main() { + let source = include_str!("categories.json"); + + let parsed : Node = serde_json::from_str(source).expect("parse"); + + println!("{}", serde_json::to_string_pretty(&parsed).expect("serialize")); +}