pyaltium.matlib._lib#

Module Contents#

Classes#

MaterialsLibrary

The top level materials library item.

class pyaltium.matlib._lib.MaterialsLibrary(library_id=None, serializer_version='1.1.0.0', version='1.1.0.0', namespace='http://altium.com/ns/Data/ExtensibleLibraries')#

The top level materials library item.

This class represents an Altium materials library, which is generally

Parameters
  • library_id (Union[str, uuid.UUID]) –

  • serializer_version (str) –

  • version (str) –

  • namespace (str) –

types :list#
type_extensions :list#
entities :list[pyaltium.matlib.base.MatLibEntity]#
entity_extensions :list#
serializer_version :str#
library_id :uuid.UUID#
version :str#
namespace :str#
classmethod from_et(et)#

Load in a XML document root as parameters and entities.

Parameters

et (xml.etree.ElementTree.Element) –

Return type

MaterialsLibrary

getall(obj_type)#

Locate all

Parameters

obj_type (Union[pyaltium.matlib.base.MatLibEntity, tuple[pyaltium.matlib.base.MatLibEntity]]) –

Return type

Iterable[pyaltium.matlib.base.MatLibEntity]

classmethod loads(s)#

Read in the material library from an XML string.

classmethod load(file)#

Read this library from an XML file.

Parameters

file (Union[TextIO, str]) – File name as string or pointer as an IO type. Passed directly to

xml.etree.ElementTree.ElementTree.parse(). :type file: Union[TextIO, str]

dumps()#

Write this material library to an XML string.

Return type

str

dump(file)#

Write this library to a file as XML.

Parameters

file (Union[TextIO, str]) – File name as string or pointer as an IO type. Passed directly to

xml.etree.ElementTree.ElementTree.write(). :type file: Union[TextIO, str]