xdrlib2 must enable the definition of Python classes (XDR classes) that correspond to arbitrary XDR type definitions.
xdrlib2 must be able to encode any XDR class instances into a bytes object that conforms to the XDR standard described in RFC 4506.
xdrlib2 must be able to decode any bytes-like object that corresponds to a valid XDR-encoded value into its corresponding XDR class.
Given a valid XDR-encoded bytes-like object enc, decoding enc and subsequently encoding the decoded value must produce a byte string identical to enc.
Given an XDR class instance obj, encoding obj and subsequently decoding the resulting bytestring must produce an XDR class instance that is identical to obj.
Backwards compatibility
xdrlib2 must be able to function as a drop-in replacement for the standard library's xdrlib module.
Usage requirements
xdrlib2 must provide a utiltiy that can translate any valid XDR-specification file spec.xdr into a corresponding Python module spec.py that contains the Python code (XDR classes, constant definitions, etc.) that corresponds to the definitions in spec.xdr.