-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
34 lines (28 loc) · 1.46 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from partname_resolver import partname_resolver
from partname_resolver.components.resistor import Resistor
from partname_resolver.components.capacitor import Capacitor
def find_capacitor():
print("----------------- Resolving part GC331AD72W153KX01 -----------------")
resolved = partname_resolver.resolve('GC331AD72W153KX01')
if resolved is not None:
print("Component is capacitor:", isinstance(resolved, Capacitor))
print("Component is resistor:", isinstance(resolved, Resistor))
print("Component found:", resolved)
print("Component type:", resolved.type.value)
print("Component capacitance:", resolved.capacitance)
print("Component dielectric type:", resolved.dielectric_type)
print("Component max voltage", resolved.voltage)
def find_resistor():
print("----------------- Resolving part CRCW0805562RFKTA -----------------")
resolved = partname_resolver.resolve('CRCW0805562RFKTA')
if resolved is not None:
print("Component is capacitor:", isinstance(resolved, Capacitor))
print("Component is resistor:", isinstance(resolved, Resistor))
print("Component found:", resolved)
print("Component type:", resolved.type.value)
print("Component resistance", resolved.resistance)
print("Component max power", resolved.power)
print("Component max operating voltage", resolved.max_working_voltage)
if __name__ == "__main__":
find_capacitor()
find_resistor()