Bases: object
The Decoder is the lowest level entry point for parsing, decoding, and fully converting Transit data into Python objects.
During the creation of a Decoder object, you can specify custom options in a dictionary. One such option is ‘decoders’. Note that while you can specify your own decoders and override many of the built in decoders, some decoders are silently enforced and cannot be overriden. These are known as Ground Decoders, and are needed to maintain bottom-tier compatibility.
Given a node of data (any supported decodeable obj - string, dict, list), return the decoded object. Optionally set the current decode cache [None]. If None, a new RollingCache is instantiated and used. You may also hit to the decoder that this node is to be treated as a map key [False]. This is used internally.
Special case decodes map-as-array. Otherwise lists are treated as Python lists.
Arguments follow the same convention as the top-level ‘decode’ function
Bases: object
The top-level Unmarshaler used by the Reader for JSON payloads. While you may use this directly, it is strongly discouraged.
Bases: object
The top-level Unmarshaler used by the Reader for MsgPacke payloads. While you may use this directly, it is strongly discouraged.
Bases: object
The top-level object for reading in Transit data and converting it to Python objects. During initialization, you must specify the protocol used for unmarshalling the data- json or msgpack.
Bases: object
This is the internal cache used by python-transit for cacheing and expanding map keys during writing and reading. The cache enables transit to minimize the amount of duplicate data sent over the wire, effectively compressing down the overall payload size. The cache is not intended to be used directly.
Bases: object
Bases: _abcoll.Mapping, _abcoll.Hashable
Bases: object
Bases: transit.class_hash.ClassDict
This is the master handler for encoding/writing Python data into Transit data, based on its type. The Handler itself is a dispatch map, that resolves on full type/object inheritance.
These handlers can be overriden during the creation of a Transit Writer.
Bases: transit.writer.Marshaler
The Marshaler tailor to JSON. To use this Marshaler, specify the ‘json’ protocol when creating a Writer.
Bases: object
The base Marshaler from which all Marshalers inherit.
The Marshaler specifies how to emit Transit data given encodeable Python objects. The end of this process is specialized by other Marshalers to covert the final result into an on-the-wire payload (JSON or MsgPack).
Test whether the keys within a map are stringable - a simple map, that can be optimized and whose keys can be cached
Used to determine and dipatch the writing of a map - a simple map with strings as keys, or a complex map, whose keys are also compound types.
Marshal an individual obj, potentially as part of another container object (like a list/dictionary/etc). Specify if this object is a key to a map/dict, and pass in the current cache being used. This method should only be called by a top-level marshalling call and should not be considered an entry-point for integration.
Bases: transit.writer.Marshaler
The Marshaler tailor to MsgPack. To use this Marshaler, specify the ‘msgpack’ protocol when creating a Writer.
Bases: transit.writer.VerboseSettings, transit.writer.JsonMarshaler
JsonMarshaler class with VerboseSettings mixin
Bases: object
Mixin for JsonMarshaler that adds support for Verbose output/input. Verbosity is only suggest for debuging/inspecting purposes.
Bases: object
The top-level object for writing out Python objects and converting them to Transit data. During initialization, you must specify the protocol used for marshalling the data- json or msgpack. You must also specify the io source used for writing (a file descriptor). You may optionally pass in an options dictionary that will be forwarded onto the Marshaler. The cache is enabled by default.