pyaltium.base#

base.py

Baase classes for everything we do

Module Contents#

Classes#

Magic

Magic values and strings used in Altium files

OleMixin

Helper functions for anything with an ole file_name object.

AltiumFileMixin

This class will generally not be exposed.

AltiumLibMixin

An item in a library.

AltiumLibItemMixin

Single item in a library.

Attributes#

class pyaltium.base.Magic#

Magic values and strings used in Altium files

SCHLIB_HEADER = HEADER=Protel for Windows - Schematic Library Editor Binary File Version 5.0#
PCBLIB_HEADER = PCB 6.0 Binary Library File#
class pyaltium.base.OleMixin#

Helper functions for anything with an ole file_name object.

file_name :str#
class pyaltium.base.AltiumFileMixin(file_name=None, lazyload=False)#

Bases: OleMixin

This class will generally not be exposed. Just intended to set up children

Parameters
  • file_name (str) –

  • lazyload (bool) –

lazyload :bool#
setfile_name(file_name)#

Check if file is valid (to the best of our ability) then update generic information.

Parameters

file_name (str) –

Return type

None

pyaltium.base.LibItemType#
class pyaltium.base.AltiumLibMixin(file_name=None, lazyload=False)#

Bases: AltiumFileMixin, Generic[LibItemType]

An item in a library.

Library items should be able to load themselves from a file.

Parameters
  • file_name (str) –

  • lazyload (bool) –

items_list :List[LibItemType]#
list_items(as_dict=True)#

Return a list of all the items.

Optionally return them as a dictionary.

Return type

list[LibItemType]

pyaltium.base.RecordType#
class pyaltium.base.AltiumLibItemMixin#

Bases: OleMixin, Generic[RecordType]

Single item in a library.

abstract as_dict()#
Return type

dict

property records#

Load data if it hasn’t been loaded yet. If it has, return it.

Return type

List[RecordType]

property name#
Return type

str

abstract draw(ax)#

Draw self on a canvas.

Parameters

ax (matplotlib.pyplot.Axes) –

Return type

None

get_svg()#