# eric7.EricUtilities.__init__

Package containing utility modules and functions.

### Global Attributes

None

### Classes

None

### Functions

dataString | Function to generate a formatted size string.
strGroup | Function to group a string into sub-strings separated by a separator.
strToQByteArray | Function to convert a Python string into a QByteArray.
toBool | Function to convert a value to bool.
toByteArray | Function to convert a value to a byte array.
toDict | Function to convert a value to a dictionary.
toList | Function to convert a value to a list.
versionIsValid | Function to check, if the given version string is valid.
versionToTuple | Function to convert a version string into a tuple.

## dataString

dataString(size, loc=None)

Function to generate a formatted size string.

size (int)
  size to be formatted
loc (QLocale (optional))
  locale to be used for localized size strings (defaults to None)

Return:
  formatted data string

Return Type:
  str

Up

## strGroup

strGroup(txt, sep, groupLen=4)

Function to group a string into sub-strings separated by a separator.

txt (str)
  text to be grouped
sep (str)
  separator string
groupLen (int)
  length of each group

Return:
  result string

Return Type:
  str

Up

## strToQByteArray

strToQByteArray(txt)

Function to convert a Python string into a QByteArray.

txt (str, bytes, bytearray)
  Python string to be converted

Return:
  converted QByteArray

Return Type:
  QByteArray

Up

## toBool

toBool(value)

Function to convert a value to bool.

value (str)
  value to be converted

Return:
  converted data

Return Type:
  bool

Up

## toByteArray

toByteArray(value)

Function to convert a value to a byte array.

value (QByteArray or None)
  value to be converted

Return:
  converted data

Return Type:
  QByteArray

Up

## toDict

toDict(value)

Function to convert a value to a dictionary.

value (dict or None)
  value to be converted

Return:
  converted data

Return Type:
  dict

Up

## toList

toList(value)

Function to convert a value to a list.

value (None, list or Any)
  value to be converted

Return:
  converted data

Return Type:
  list

Up

## versionIsValid

versionIsValid(version)

Function to check, if the given version string is valid.

version (str)
  version string

Return:
  flag indicating validity

Return Type:
  bool

Up

## versionToTuple

versionToTuple(version)

Function to convert a version string into a tuple.

Note: A version string consists of non-negative decimals separated by "." optionally followed by a suffix. Suffix is everything after the last decimal.

version (str)
  version string

Return:
  version named tuple containing the version parts

Return Type:
  semver.VersionInfo

Up