index.rst 3.99 KB
Newer Older
Dan Gass's avatar
Dan Gass committed
1 2 3
####################
[plum] API Reference
####################
4 5 6

.. include:: ../alias.txt

Dan Gass's avatar
Dan Gass committed
7 8
.. currentmodule:: plum

9

Dan Gass's avatar
Dan Gass committed
10 11 12 13 14 15 16 17 18 19 20
**********
Plum Types
**********

    ==============================  ================================================
    Module                          Description
    ==============================  ================================================
    :mod:`plum.array`               list of uniformly typed
    :mod:`plum.bytearray`           array of bytes
    :mod:`plum.float`               floating point
    :mod:`plum.int`                 integer
Dan Gass's avatar
Dan Gass committed
21
    :mod:`plum.int.bitfields`       integer with bit field accessors
Dan Gass's avatar
Dan Gass committed
22 23
    :mod:`plum.int.enum`            integer enumerated constants
    :mod:`plum.int.flag`            integer with bit flags
Dan Gass's avatar
Dan Gass committed
24
    :mod:`plum.ipv4`                IPV4 address
Dan Gass's avatar
Dan Gass committed
25
    :mod:`plum.items`               collection of uniquely typed items
Dan Gass's avatar
Dan Gass committed
26 27
    :mod:`plum.nil`                 no bytes
    :mod:`plum.str`                 string
Dan Gass's avatar
Dan Gass committed
28
    :mod:`plum.structure`           predefined structure of uniquely typed members
Dan Gass's avatar
Dan Gass committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
    ==============================  ================================================

.. toctree::
    :hidden:

    array <types/array.rst>
    bytearray <types/bytearray.rst>
    float <types/float.rst>
    float.big <types/float_big.rst>
    float.little <types/float_little.rst>
    float.native <types/float_native.rst>
    int <types/int.rst>
    int.big <types/int_big.rst>
    int.little <types/int_little.rst>
    int.native <types/int_native.rst>
    int.bitfields <types/int_bitfields.rst>
    int.enum <types/int_enum.rst>
    int.flag <types/int_flag.rst>
Dan Gass's avatar
Dan Gass committed
47 48 49 50
    ipv4 <types/ipv4.rst>
    ipv4.big <types/ipv4_big.rst>
    ipv4.little <types/ipv4_little.rst>
    ipv4.native <types/ipv4_native.rst>
Dan Gass's avatar
Dan Gass committed
51
    items <types/items.rst>
Dan Gass's avatar
Dan Gass committed
52 53 54 55 56
    nil <types/nil.rst>
    str <types/str.rst>
    structure <types/structure.rst>


57 58 59 60
*****************
Utility Functions
*****************

Dan Gass's avatar
Dan Gass committed
61 62 63 64 65 66 67 68 69 70 71 72 73
    ===================================  ================================================================================
    Function                             Description
    ===================================  ================================================================================
    :func:`getbytes`                     Get bytes from bytes buffer.
    :func:`pack`                         Pack values as bytes following a format.
    :func:`pack_and_dump`                Pack values as bytes and produce bytes summary following a format.
    :func:`pack_into`                    Pack values as bytes into a buffer following a format.
    :func:`pack_into_and_dump`           Pack values as bytes into a buffer following a format and produce bytes summary.
    :func:`unpack`                       Unpack item(s) from bytes.
    :func:`unpack_and_dump`              Unpack item(s) from bytes and produce packed bytes summary.
    :func:`unpack_from`                  Unpack item(s) from within a bytes buffer.
    :func:`unpack_from_and_dump`         Unpack item(s) from within a bytes buffer and produce packed bytes summary.
    ===================================  ================================================================================
74 75 76 77

.. toctree::
    :hidden:

78
    getbytes() <utilities/getbytes.rst>
Dan Gass's avatar
Dan Gass committed
79
    pack() <utilities/pack.rst>
Dan Gass's avatar
Dan Gass committed
80
    pack_and_dump() <utilities/pack_and_dump.rst>
81
    pack_into() <utilities/pack_into.rst>
Dan Gass's avatar
Dan Gass committed
82
    pack_into_and_dump() <utilities/pack_into_and_dump.rst>
Dan Gass's avatar
Dan Gass committed
83
    unpack() <utilities/unpack.rst>
84
    unpack_from() <utilities/unpack_from.rst>
Dan Gass's avatar
Dan Gass committed
85 86
    unpack_and_dump() <utilities/unpack_and_dump.rst>
    unpack_from_and_dump() <utilities/unpack_from_and_dump.rst>
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102


**********
Exceptions
**********

    - |ExcessMemoryError|
    - |InsufficientMemoryError|
    - |PackError|
    - |SizeError|
    - |UnpackError|


.. toctree::
    :hidden:

Dan Gass's avatar
Dan Gass committed
103 104 105 106 107
    ExcessMemoryError <exceptions/ExcessMemoryError.rst>
    InsufficientMemoryError <exceptions/InsufficientMemoryError.rst>
    PackError <exceptions/PackError.rst>
    SizeError <exceptions/SizeError.rst>
    UnpackError <exceptions/UnpackError.rst>