Exposed functions and symbols

rapidjson.__author__

The author of the module.

rapidjson.__version__

The version of the module.

rapidjson.__rapidjson_version__

The version of the RapidJSON library this module is built with.

datetime_mode related constants

rapidjson.DM_NONE

This is the default datetime_mode: neither date nor datetime nor time instances are recognized by dumps() and loads().

rapidjson.DM_ISO8601

In this datetime_mode mode dumps() and loads() handle date, datetime and date instances representing those values using the ISO 8601 format.

rapidjson.DM_UNIX_TIME

This mode tells RapidJSON to serialize date, datetime and time as numeric timestamps: for the formers it is exactly the result of their timestamp() method, that is as the number of seconds passed since EPOCH; date instances are serialized as the corresponding datetime instance with all the time slots set to 0; time instances are serialized as the number of seconds since midnight.

Since this is obviously irreversible, this flag is usable only for dumps(): an error is raised when passed to loads().

rapidjson.DM_ONLY_SECONDS

This is usable in combination with DM_UNIX_TIME so that an integer representation is used, ignoring microseconds.

rapidjson.DM_IGNORE_TZ

This can be used combined with DM_ISO8601 or DM_UNIX_TIME, to ignore the value’s timezones.

rapidjson.DM_NAIVE_IS_UTC

This can be used combined with DM_ISO8601 or DM_UNIX_TIME, to tell RapidJSON that the naïve values (that is, without an explicit timezone) are already in UTC timezone.

rapidjson.DM_SHIFT_TO_UTC

This can be used combined with DM_ISO8601 or DM_UNIX_TIME, to always shift values the UTC timezone.

uuid_mode related constants

rapidjson.UM_NONE

This is the default uuid_mode: UUID instances are not recognized by dumps() and loads().

rapidjson.UM_CANONICAL

In this uuid_mode, loads() recognizes string values containing the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx canonical representation as UUID instances; dumps() emits same kind of representation for UUID instances as a string value.

rapidjson.UM_HEX

In this uuid_mode loads() recognizes string values containing exactly 32 hex digits or the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx canonical representation as UUID instances; dumps() emits the 32 hex digits of UUID instances as a string value.

number_mode related constants

rapidjson.NM_NONE

This is the default number_mode: numeric values can be as wide as the memory allows.

rapidjson.NM_DECIMAL

In this number_mode loads() will return floating point values as Decimal instances instead of float; dumps() will serialize Decimal instances like any other float number.

rapidjson.NM_NAN

This enables non-numbers (i.e. nan, +inf and -inf) handling in both directions.

rapidjson.NM_NATIVE

In this alternative number_mode numeric values must fit into the underlying C library limits, with a considerable speed benefit.

parse_mode related constants

rapidjson.PM_NONE

This is the default parse_mode: with the exception of the NaN and Infinite recognition active by default, the parser is in strict mode.

rapidjson.PM_COMMENTS

In this parse_mode, the parser allows and ignores one-line // ... and multi-line /* ... */ comments

rapidjson.PM_TRAILING_COMMAS

In this parse_mode, the parser allows and ignores trailing commas at the end of arrays and objects.