# matchtable package

## Submodules

## matchtable.column module

class matchtable.column.Column

  Bases: `TypedDict`

  destinationRelated: NotRequired[bool]
  header: str | UidRef
  id: str
  isResizable: NotRequired[bool]
  propToSort: NotRequired[str]
  property: str
  sourceRelated: NotRequired[bool]
  type: Literal['number', 'string', 'custom']

class matchtable.column.ColumnBuilder(column_type: Literal['number', 'string', 'custom'])

  Bases: `object`

  build() → Column

    Obtain the data.

  set_flag(flag: Literal['isResizable', 'destinationRelated', 'sourceRelated']) → Self

    Set a flag to the column.

    Parameters:

      flag – Type of the flag

  set_name(name: str) → Self

    Set the name to the column.

  set_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the column.

  set_property_name(property_name: str) → Self

    Set the property of match item shown in the column.

  set_sort_key(sort_key: str) → Self

    Specify the key used to sort the column.

  set_style(style_builder: ColumnStyleBuilder) → Self

    Set a style to the column.

class matchtable.column.ColumnStyle

  Bases: `TypedDict`

  maxWidth: NotRequired[int | UidRef]
  minWidth: NotRequired[int | UidRef]

class matchtable.column.ColumnStyleBuilder

  Bases: `object`

  build() → ColumnStyle

    Obtain the data.

  set_max_width(max_width: int) → Self

    Set the maximum width to the column.

  set_max_width_i18n(max_width: I18nWord) → Self

    Set the i18n word as the maximum width of the column.

  set_min_width(min_width: int) → Self

    Set the minimum width to the column.

  set_min_width_i18n(min_width: I18nWord) → Self

    Set the i18n word as the minimum width of the column.

## matchtable.filter module

class matchtable.filter.FilterBuilder

  Bases: `object`

  Create a filter.

  add_selective_filter(prop: str, values: list[str | float]) → Self

    Add a property to be filtered.

    Parameters:

      - prop – Name of property to be filtered.

      - values – Values of property. Only rows with these property values will shown.

  build() → dict[str, list[str | float]]

    Obtain the data.

## matchtable.i18n module

class matchtable.i18n.I18nResourcesWriter

  Bases: `object`

  A writer for an i18n resource.

  add_word(word: I18nWord) → Self

    Add a word to the resources.

  write(path: str) → bool

    Write i18n resources to the specified path.

    Parameters:

      path – Output json path.

    Returns:

      Is writing success or fail.

    Return type:

      bool

class matchtable.i18n.I18nWord

  Bases: `TypedDict`

  A word.

  Parameters:

    - key – Resource key for the vocabulary.

    - ja – Japanese for the vocabulary.

    - en – English for the vocabulary.

    - zh_cn – Chinese for the vocabulary.

  en: str | int | None
  ja: str | int | None
  key: str
  zh_cn: str | int | None

class matchtable.i18n.UidRef

  Bases: `TypedDict`

  uid_ref: str
  uid_type: Literal['i18n']

## matchtable.matchitem module

class matchtable.matchitem.IdentificationCriteria

  Bases: `TypedDict`

  threshold: float
  type: Literal['number', 'string', 'custom']

class matchtable.matchitem.MatchItem

  Bases: `TypedDict`

  destinationItemId: str | None
  destinationItemName: str | UidRef | None
  identificationCriteria: NotRequired[dict[str, IdentificationCriteria]]
  name: str | UidRef
  sourceItemId: str | None
  sourceItemName: str | UidRef | None
  type: NotRequired[Literal['Added', 'Deleted', 'Unchanged', 'Changed']]

class matchtable.matchitem.MatchItemBuilder(dst_id: str | Any | None, src_id: str | Any | None)

  Bases: `object`

  Create a match item.

  build() → MatchItem

    Obtain the data.

  set_destination_name(name: str) → Self

    Set the name of the destination data.

  set_destination_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the destination data.

  set_name(name: str) → Self

    Set the name to the item.

  set_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the item.

  set_property(prop: str, value: Any) → Self

    Assign new value to user-defined property.

    Parameters:

      - prop – Name of property.

      - value – New value to be assigned for the property.

  set_source_name(name: str) → Self

    Set the name of the source data.

  set_source_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the source data.

  set_type(item_type: Literal['Added', 'Deleted', 'Unchanged', 'Changed']) → Self

    Set the type of the item.

## matchtable.matchtable module

class matchtable.matchtable.MatchResult

  Bases: `TypedDict`

  columns: list[Column]
  defaultFilter: NotRequired[dict[str, list[str | float]]]
  defaultSort: NotRequired[Sort]

class matchtable.matchtable.MatchTable

  Bases: `TypedDict`

  formatVersion: int
  matchItemOperations: list[Operation]
  matchResult: MatchResult

class matchtable.matchtable.MatchTableBuilder

  Bases: `object`

  Create a match table.

  add_column(column: ColumnBuilder) → Self

    Add a column to match table.

  add_item(match: MatchItemBuilder) → Self

    Add a match item to match table.

  add_operation(operation: OperationBuilder) → Self

    Add an operation to match table.

  build() → MatchTable

    Obtain the data.

  set_default_filter(filter_builder: FilterBuilder) → Self

    Set a default filter to match table.

  set_default_sort(column: ColumnBuilder, is_descending: bool) → Self

    Set a default sort to match table.

    Parameters:

      - column – The column to be sorted.

      - is_descending – Whether sort in descending order or not.

class matchtable.matchtable.MatchTableWriter(matchtable: MatchTable)

  Bases: `object`

  A writer for the matchtable.

  write(filepath: str) → bool

    Write matchtable.json to filepath.

    Parameters:

      filepath – Output file path.

    Returns:

      Is writing success or fail.

    Return type:

      bool

class matchtable.matchtable.Sort

  Bases: `TypedDict`

  columnId: str
  isDescending: bool

## matchtable.operation module

class matchtable.operation.Operation

  Bases: `TypedDict`

  displayedName: str | UidRef
  iconName: NotRequired[str]
  id: str
  options: NotRequired[dict[str, Any]]
  type: NotRequired[str]

class matchtable.operation.OperationBuilder

  Bases: `object`

  Create an operation.

  add_option(key: str, value: Any) → Self

    Add an option to the operation.

  build() → Operation

    Obtain the data.

  set_icon(icon: str) → Self

    Set the icon to the operation.

  set_name(name: str) → Self

    Set the name to the operation.

  set_name_i18n(name: I18nWord) → Self

    Set an i18n word as the name of the operation.

  set_type(operation_type: str) → Self

    Set the type to the operation.

## Module contents

class matchtable.ColumnBuilder(column_type: Literal['number', 'string', 'custom'])

  Bases: `object`

  build() → Column

    Obtain the data.

  set_flag(flag: Literal['isResizable', 'destinationRelated', 'sourceRelated']) → Self

    Set a flag to the column.

    Parameters:

      flag – Type of the flag

  set_name(name: str) → Self

    Set the name to the column.

  set_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the column.

  set_property_name(property_name: str) → Self

    Set the property of match item shown in the column.

  set_sort_key(sort_key: str) → Self

    Specify the key used to sort the column.

  set_style(style_builder: ColumnStyleBuilder) → Self

    Set a style to the column.

class matchtable.ColumnStyleBuilder

  Bases: `object`

  build() → ColumnStyle

    Obtain the data.

  set_max_width(max_width: int) → Self

    Set the maximum width to the column.

  set_max_width_i18n(max_width: I18nWord) → Self

    Set the i18n word as the maximum width of the column.

  set_min_width(min_width: int) → Self

    Set the minimum width to the column.

  set_min_width_i18n(min_width: I18nWord) → Self

    Set the i18n word as the minimum width of the column.

class matchtable.FilterBuilder

  Bases: `object`

  Create a filter.

  add_selective_filter(prop: str, values: list[str | float]) → Self

    Add a property to be filtered.

    Parameters:

      - prop – Name of property to be filtered.

      - values – Values of property. Only rows with these property values will shown.

  build() → dict[str, list[str | float]]

    Obtain the data.

class matchtable.MatchItemBuilder(dst_id: str | Any | None, src_id: str | Any | None)

  Bases: `object`

  Create a match item.

  build() → MatchItem

    Obtain the data.

  set_destination_name(name: str) → Self

    Set the name of the destination data.

  set_destination_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the destination data.

  set_name(name: str) → Self

    Set the name to the item.

  set_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the item.

  set_property(prop: str, value: Any) → Self

    Assign new value to user-defined property.

    Parameters:

      - prop – Name of property.

      - value – New value to be assigned for the property.

  set_source_name(name: str) → Self

    Set the name of the source data.

  set_source_name_i18n(name: I18nWord) → Self

    Set the i18n word as the name of the source data.

  set_type(item_type: Literal['Added', 'Deleted', 'Unchanged', 'Changed']) → Self

    Set the type of the item.

class matchtable.MatchTable

  Bases: `TypedDict`

  formatVersion: int
  matchItemOperations: list[Operation]
  matchResult: MatchResult

class matchtable.MatchTableBuilder

  Bases: `object`

  Create a match table.

  add_column(column: ColumnBuilder) → Self

    Add a column to match table.

  add_item(match: MatchItemBuilder) → Self

    Add a match item to match table.

  add_operation(operation: OperationBuilder) → Self

    Add an operation to match table.

  build() → MatchTable

    Obtain the data.

  set_default_filter(filter_builder: FilterBuilder) → Self

    Set a default filter to match table.

  set_default_sort(column: ColumnBuilder, is_descending: bool) → Self

    Set a default sort to match table.

    Parameters:

      - column – The column to be sorted.

      - is_descending – Whether sort in descending order or not.

class matchtable.MatchTableWriter(matchtable: MatchTable)

  Bases: `object`

  A writer for the matchtable.

  write(filepath: str) → bool

    Write matchtable.json to filepath.

    Parameters:

      filepath – Output file path.

    Returns:

      Is writing success or fail.

    Return type:

      bool

class matchtable.OperationBuilder

  Bases: `object`

  Create an operation.

  add_option(key: str, value: Any) → Self

    Add an option to the operation.

  build() → Operation

    Obtain the data.

  set_icon(icon: str) → Self

    Set the icon to the operation.

  set_name(name: str) → Self

    Set the name to the operation.

  set_name_i18n(name: I18nWord) → Self

    Set an i18n word as the name of the operation.

  set_type(operation_type: str) → Self

    Set the type to the operation.