The Common Parts Library is a set of commonly used electronic components for designing and manufacturing connected device products. This library has CPL for Production and CPL for Prototyping data in YAML format.
Sign up for Octopart Slack channel here, and share any questions, feedback or thoughts with us there.
YAML data can be parsed in all the major languages. An example on how to parse the YAML data in Python is shown below. It returns all capacitor MPNs with a value of 1 pF in the CPL for Production:
import yaml with open('CPL-Data/CPL for Production/Capacitors.yaml', 'r') as f: doc = yaml.load(f) def findmpn(value): for row in doc["rows"]: if row["extravals"]["Capacitance"] == value: for part in row["parts"]: print(part["mpn"]) if __name__ == "__main__": findmpn("1 pF")