API Documentation

Electronics Conventions Module documentation (conventions.electronics)

tendril.conventions.electronics.no_fp(device)[source]
tendril.conventions.electronics.fpismodlen(device)[source]
tendril.conventions.electronics.fpiswire(device)[source]
tendril.conventions.electronics.fpiswire_ident(ident)[source]
tendril.conventions.electronics.ident_transform(device, value, footprint, tf=None, generic=False)[source]

Auto-generated ident string from the component device, value and footprint attributes.

If the device string starts with any of the strings in nofp_strings, the footprint is excluded from the ident string.

When applied to gEDA generated data (BOMs, gsymlib), the return value is the Canonical Representation for the component. The burden of ensuring uniqueness and consistency is on the gEDA schematic files and authors thereof. See conventions.rst listed in somewhere for relevant guidelines.

For all other forms of data, the specific modules must provide a transform csv file to ensure correct mapping into the canonical form. For the format of this file, see somewhere.

exception tendril.conventions.electronics.MalformedIdentError[source]

Bases: ValueError

tendril.conventions.electronics.parse_ident(ident, generic=False)[source]
class tendril.conventions.electronics.jb_component

Bases: tuple

Create new instance of jb_component(code, typeclass, required, get_default, criteria)

_asdict()

Return a new OrderedDict which maps field names to their values.

_fields = ('code', 'typeclass', 'required', 'get_default', 'criteria')
_fields_defaults = {}
classmethod _make(iterable)

Make a new jb_component object from a sequence or iterable

_replace(**kwds)

Return a new jb_component object replacing specified fields with new values

property code

Alias for field number 0

property criteria

Alias for field number 4

property get_default

Alias for field number 3

property required

Alias for field number 2

property typeclass

Alias for field number 1

class tendril.conventions.electronics.jb_tools

Bases: tuple

Create new instance of jb_tools(tclass, defs, pack, parse, construct, match, bestmatch)

_asdict()

Return a new OrderedDict which maps field names to their values.

_fields = ('tclass', 'defs', 'pack', 'parse', 'construct', 'match', 'bestmatch')
_fields_defaults = {}
classmethod _make(iterable)

Make a new jb_tools object from a sequence or iterable

_replace(**kwds)

Return a new jb_tools object replacing specified fields with new values

property bestmatch

Alias for field number 6

property construct

Alias for field number 4

property defs

Alias for field number 1

property match

Alias for field number 5

property pack

Alias for field number 2

property parse

Alias for field number 3

property tclass

Alias for field number 0

tendril.conventions.electronics.jellybean_match(tcomponents, p1, p2)[source]
tendril.conventions.electronics.jellybean_bestmatch(tcomponents, target, candidates)[source]
tendril.conventions.electronics.jellybean_packer(ttype, tcomponents, tcontext, **kwargs)[source]

Pack components for a jellybean part into a structured form. Also applies defaults when needed and supported at this stage.

Parameters
  • ttype

  • tcomponents

  • kwargs

Returns

tendril.conventions.electronics.jellybean_parser(ttype, tcomponents, tcontext, value)[source]

Parses the standard form of the value for a jellybean part. Returns the components in a structured form, constructed by _jellybean_packer where defaults are applied.

Parameters
  • ttype

  • tcomponents

  • tcontext

  • value

Returns

tendril.conventions.electronics.jellybean_constructor(tcomponents, **kwargs)[source]

Construct a valid value string from components for jellybean parts. The provided structured forms can be provided directly as kwargs.

Parameters
  • tcomponents

  • kwargs

Returns

class tendril.conventions.electronics.Resistor

Bases: tuple

Create new instance of Resistor(resistance, wattage, tolerance, tc)

_asdict()

Return a new OrderedDict which maps field names to their values.

_fields = ('resistance', 'wattage', 'tolerance', 'tc')
_fields_defaults = {}
classmethod _make(iterable)

Make a new Resistor object from a sequence or iterable

_replace(**kwds)

Return a new Resistor object replacing specified fields with new values

property resistance

Alias for field number 0

property tc

Alias for field number 3

property tolerance

Alias for field number 2

property wattage

Alias for field number 1

tendril.conventions.electronics.jb_resistor_defs()[source]
tendril.conventions.electronics.jb_resistor(resistance, wattage=None, tolerance=None, tc=None, context=None)[source]
tendril.conventions.electronics.match_resistor(tresistor, sresistor)[source]
tendril.conventions.electronics.bestmatch_resistor(tresistor, candidates)[source]
tendril.conventions.electronics.parse_resistor(value, context=None)[source]
tendril.conventions.electronics.construct_resistor(resistance, wattage=None, tolerance=None, tc=None)[source]
class tendril.conventions.electronics.Capacitor

Bases: tuple

Create new instance of Capacitor(capacitance, voltage, tolerance, tcc)

_asdict()

Return a new OrderedDict which maps field names to their values.

_fields = ('capacitance', 'voltage', 'tolerance', 'tcc')
_fields_defaults = {}
classmethod _make(iterable)

Make a new Capacitor object from a sequence or iterable

_replace(**kwds)

Return a new Capacitor object replacing specified fields with new values

property capacitance

Alias for field number 0

property tcc

Alias for field number 3

property tolerance

Alias for field number 2

property voltage

Alias for field number 1

tendril.conventions.electronics.jb_capacitor_defs()[source]
tendril.conventions.electronics.jb_capacitor(capacitance, voltage=None, tolerance=None, tcc=None, context=None)[source]
tendril.conventions.electronics.match_capacitor(tcapacitor, scapacitor)[source]
tendril.conventions.electronics.bestmatch_capacitor(tcapacitor, candidates)[source]
tendril.conventions.electronics.parse_capacitor(value, context=None)[source]
tendril.conventions.electronics.construct_capacitor(capacitance, voltage=None, tolerance=None, tcc=None)[source]
tendril.conventions.electronics.parse_inductor(value)[source]
tendril.conventions.electronics.construct_inductor(inductance)[source]
tendril.conventions.electronics.parse_crystal(value)[source]
tendril.conventions.electronics.construct_crystal(frequency)[source]
tendril.conventions.electronics.parse_led(value)[source]
tendril.conventions.electronics.check_for_std_val(ident)[source]
tendril.conventions.electronics.check_for_jb_component(device, value, footprint)[source]
tendril.conventions.electronics.jb_tools_for_ident(ident)[source]