Base Module

Module contents

class beautifuljason.base.Alignment(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntFlag

Represents alignment options, analogous to Qt’s Qt::AlignmentFlag.

Absolute = 128
Bottom = 32
Center = 68
HCenter = 4
Justify = 8
Leading = 1
Left = 1
Right = 2
Top = 16
Trailing = 2
VCenter = 64
class beautifuljason.base.AttrList(h5_group)

Bases: H5Group

Represents a list-like interface for attributes in an HDF5 group.

Parameters:

h5_group (h5py.Group) – The actual HDF5 group object.

class Iterator(h5_group, iter_start, iter_step)

Bases: H5Group

Iterator for the AttrList class.

Parameters:
  • h5_group (h5py.Group) – The actual HDF5 group object.

  • iter_start (int) – The starting index for the iterator.

  • iter_step (int) – The step size for the iterator.

append(values)

Appends the given values as attributes.

Parameters:

values (Sequence) – The values to append.

clear()

Removes all attributes used by the AttrList.

class beautifuljason.base.DummyH5Group

Bases: object

A dummy representation of an H5Group.

This class is used as a workaround for cases where the actual h5_group is None. It provides a mock interface to mimic the behavior of an H5Group without any actual data.

class beautifuljason.base.Font(font_str: str | bytes)

Bases: dict

Represents a font with various attributes. This class is designed to parse and represent fonts in a specific string format.

Parameters:

font_str (str | bytes) – The font string to parse. Accepts both str and bytes.

Raises:

TypeError – If the provided font_str is not of type str or bytes.

class FontStyle(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents the style of the font, analogous to QFont::Style in Qt.

Italic = 1
Normal = 0
Oblique = 2
class FontStyleHint(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents the style hint of the font, analogous to QFont::StyleHint in Qt.

AnyStyle = 5
Courier = 2
Cursive = 6
Decorative = 3
Fantasy = 8
Helvetica = 0
Monospace = 7
OldEnglish = 3
SansSerif = 0
Serif = 1
System = 4
Times = 1
TypeWriter = 2
class FontWeight(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents the weight of the font using QFont::Weight values from Qt5. Qt6 values will be automatically converted to their Qt5 counterparts.

Black = 87
Bold = 75
DemiBold = 63
ExtraBold = 81
ExtraLight = 12
Light = 25
Medium = 57
Normal = 50
Thin = 0
classmethod qt6_to_qt5_mapping()
static default_font() Font

Provides a default font representation. Currently implemented for Windows only.

Returns:

A default font representation.

Return type:

Font

static qt6_default_font() Font

Provides a default font representation for Qt6. Currently implemented for Windows only.

Returns:

A default font representation.

Return type:

Font

New in version 1.1.0.

class beautifuljason.base.GroupList(h5_group, list_group_name: str, value_class)

Bases: H5Group

Represents a list-like structure within an HDF5 file.

Parameters:
  • h5_group (h5py.Group) – The actual HDF5 group object.

  • list_group_name (str) – The name of the group that contains the list.

  • value_class (type) – The class that represents the values within the list.

class Iterator(h5_group, obj_class, iter_start: int, iter_step: int)

Bases: H5Group

Iterator for the GroupList class.

Parameters:
  • h5_group (h5py.Group) – The actual HDF5 group object.

  • obj_class (type) – The class that represents the values within the list.

  • iter_start (int) – The starting index for the iterator.

  • iter_step (int) – The step size for the iterator.

append(attrs: Sequence[Mapping] | Mapping) None

Appends one or multiple items to the list.

Parameters:

attrs (Sequence | Mapping) – The item(s) to append to the list.

Raises:

TypeError – If the provided attrs is not of type Sequence or Mapping.

class beautifuljason.base.H5Group(h5_group)

Bases: object

Represents a group within an HDF5 file.

Parameters:

h5_group (h5py.Group) – The actual HDF5 group object.

class beautifuljason.base.IDedObject(h5_group)

Bases: H5Group

Represents a group within an HDF5 file that has an ID.

property id: str

Returns the ID of the object after validating its format.

Returns:

The ID of the object.

Return type:

str

class beautifuljason.base.OriginalFileFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents various file formats supported by JASON.

Castep = 9
Custom = 17
EMF = 15
Image = 12
JCAMPDX = 18
JEOL_Alice2 = 23
JEOL_Delta = 10
JJD = 2
JJH5 = 1
JJJ = 3
Magritek = 22
Molfile = 11
PDF = 14
SIMPSON = 16
SPINit = 21
SVG = 13
Spinevolution = 8
Spinsight = 4
TopSpin = 6
TopSpinProc = 7
Unknown = 0
Vnmr = 5
WinNMR = 19
WinNMRProc = 20
class beautifuljason.base.QMetaType_Type(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents data types analogous to Qt’s QMetaType::Type.

Bool = 1
Char = 34
Char16 = 56
Char32 = 57
Double = 6
Float = 38
Int = 2
Long = 32
LongLong = 4
QByteArray = 12
QChar = 7
QSize = 21
QString = 10
QStringList = 11
QVariantList = 9
SChar = 40
Short = 33
UChar = 37
UInt = 3
ULong = 35
ULongLong = 5
UShort = 36
UnknownType = 0
class beautifuljason.base.Units(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Represents various unit types used in JASON.

CM2perS = 13
CM2perS_LIN = 16
DEG = 9
DPTS = 15
DPTS_LIN = 18
FPTS = 7
FVIRT = 12
GPTS = 22
GperCM = 19
HZ = 1
KHZ = 2
M2perS = 14
M2perS_LIN = 17
MS = 5
NONE = 0
PERCENTS = 10
PPM = 3
S = 6
TPTS = 8
TVIRT = 11
TperM = 21
US = 4
mTperM = 20