# pamqp.common

Common type aliases and classes.

pamqp.common.Arguments

  Defines an AMQP method arguments argument data type

  alias of `Optional`[`Dict`[`str`, `FieldValue`]]

pamqp.common.FieldArray

  A data structure for holding an array of field values.

  alias of `List`[`FieldValue`]

pamqp.common.FieldTable

  Field tables are data structures that contain packed name-value pairs.

  The name-value pairs are encoded as short string defining the name, and octet defining the values type and then the value itself. The valid field types for tables are an extension of the native integer, bit, string, and timestamp types, and are shown in the grammar. Multi-octet integer fields are always held in network byte order.

  Guidelines for implementers:

  - Field names MUST start with a letter, ‘$’ or ‘#’ and may continue with letters, $ or #, digits, or underlines, to a maximum length of 128 characters.

  - The server SHOULD validate field names and upon receiving an invalid field name, it SHOULD signal a connection exception with reply code 503 (syntax error).

  - Decimal values are not intended to support floating point values, but rather fixed-point business values such as currency rates and amounts. They are encoded as an octet representing the number of places followed by a long signed integer. The ‘decimals’ octet is not signed.

  - Duplicate fields are illegal. The behaviour of a peer with respect to a table containing duplicate fields is undefined.

  alias of `Dict`[`str`, `FieldValue`]

pamqp.common.FieldValue

  Defines valid field values for a `FieldTable` and a `FieldValue`

  alias of `Union`[`bool`, `bytearray`, `decimal.Decimal`, `List`[`FieldValue`], `Dict`[`str`, `FieldValue`], `float`, `int`, `None`, `str`, `datetime.datetime`]

class pamqp.common.Struct

  Simple object for getting to the struct objects for `pamqp.decode` / `pamqp.encode`.

  byte = <_struct.Struct object>
  double = <_struct.Struct object>
  float = <_struct.Struct object>
  integer = <_struct.Struct object>
  long = <_struct.Struct object>
  long_long_int = <_struct.Struct object>
  short = <_struct.Struct object>
  short_short_int = <_struct.Struct object>
  short_short_uint = <_struct.Struct object>
  timestamp = <_struct.Struct object>
  uint = <_struct.Struct object>
  ulong = <_struct.Struct object>
  ushort = <_struct.Struct object>