# pamqp.decode

## AMQP Data Decoder

Functions for decoding data of various types including field tables and arrays

class `pamqp.decode.``Struct`

  Simple object for getting to the struct objects

`pamqp.decode.``bit`(value, position)

  Decode a bit value

  Parameters:

  - value (bytes) – Value to decode
  - position (int) – The bit position to retrieve

  Return tuple: | bytes used, bool value
  Raises: | ValueError

`pamqp.decode.``boolean`(value)

  Decode a boolean value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, bool
  Raises: | ValueError

`pamqp.decode.``by_type`(value, data_type, offset=0)

  Decodes values using the specified type

  Parameters:

  - value (bytes) – Value to decode
  - data_type (str) – type of data to decode

  Return tuple: | bytes consumed, mixed based on field type

`pamqp.decode.``byte_array`(value)

  Decode a byte_array value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, bool
  Raises: | ValueError

`pamqp.decode.``decimal`(value)

  Decode a decimal value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, decimal.Decimal value
  Raises: | ValueError

`pamqp.decode.``double`(value)

  Decode a double value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, float
  Raises: | ValueError

`pamqp.decode.``field_array`(value)

  Decode a field array value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, list
  Raises: | ValueError

`pamqp.decode.``field_table`(value)

  Decode a field array value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, dict
  Raises: | ValueError

`pamqp.decode.``floating_point`(value)

  Decode a floating point value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, float
  Raises: | ValueError

`pamqp.decode.``long_int`(value)

  Decode a long integer value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, int
  Raises: | ValueError

`pamqp.decode.``long_long_int`(value)

  Decode a long-long integer value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, int
  Raises: | ValueError

`pamqp.decode.``long_str`(value)

  Decode a string value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, bytes|str
  Raises: | ValueError

`pamqp.decode.``long_uint`(value)

  Decode an unsigned long integer value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, int
  Raises: | ValueError

`pamqp.decode.``octet`(value)

  Decode an octet value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, int
  Raises: | ValueError

`pamqp.decode.``short_int`(value)

  Decode a short integer value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, int
  Raises: | ValueError

`pamqp.decode.``short_short_int`(value)

  Decode a short, short integer value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, int
  Raises: | ValueError

`pamqp.decode.``short_str`(value)

  Decode a string value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, unicode|str
  Raises: | ValueError

`pamqp.decode.``short_uint`(value)

  Decode an unsigned short integer value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, int
  Raises: | ValueError

`pamqp.decode.``timestamp`(value)

  Decode a timestamp value

  Parameters: | value (bytes) – Value to decode
  Return tuple: | bytes used, struct_time
  Raises: | ValueError