qs_codec.enums package¶
Submodules¶
qs_codec.enums.charset module¶
Charset enum module.
- class qs_codec.enums.charset.Charset(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
_CharsetDataMixin
,Enum
Character set.
- LATIN1 = _CharsetDataMixin(encoding='iso-8859-1')¶
ISO-8859-1 (Latin-1) character encoding.
- UTF8 = _CharsetDataMixin(encoding='utf-8')¶
UTF-8 character encoding.
qs_codec.enums.duplicates module¶
This module contains an enum of all available duplicate key handling strategies.
- class qs_codec.enums.duplicates.Duplicates(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
An enum of all available duplicate key handling strategies.
- COMBINE = 1¶
Combine duplicate keys into a single key with an array of values.
- FIRST = 2¶
Use the first value for duplicate keys.
- LAST = 3¶
Use the last value for duplicate keys.
qs_codec.enums.format module¶
An enum of all supported URI component encoding formats.
- class qs_codec.enums.format.Format(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
_FormatDataMixin
,Enum
An enum of all supported URI component encoding formats.
- RFC1738 = _FormatDataMixin(format_name='RFC1738', formatter=<function Formatter.rfc1738>)¶
qs_codec.enums.list_format module¶
An enum for all available list format options.
- class qs_codec.enums.list_format.ListFormat(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
_ListFormatDataMixin
,Enum
An enum of all available list format options.
- BRACKETS = _ListFormatDataMixin(list_format_name='BRACKETS', generator=<function ListFormatGenerator.brackets>)¶
Use brackets to represent list items, for example
foo[]=123&foo[]=456&foo[]=789
- COMMA = _ListFormatDataMixin(list_format_name='COMMA', generator=<function ListFormatGenerator.comma>)¶
Use commas to represent list items, for example
foo=123,456,789
- INDICES = _ListFormatDataMixin(list_format_name='INDICES', generator=<function ListFormatGenerator.indices>)¶
Use indices to represent list items, for example
foo[0]=123&foo[1]=456&foo[2]=789
- REPEAT = _ListFormatDataMixin(list_format_name='REPEAT', generator=<function ListFormatGenerator.repeat>)¶
Use a repeat key to represent list items, for example
foo=123&foo=456&foo=789
qs_codec.enums.sentinel module¶
This module defines the Sentinel enum, which contains all available sentinel values.
- class qs_codec.enums.sentinel.Sentinel(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
_SentinelDataMixin
,Enum
An enum of all available sentinel values.
- CHARSET = _SentinelDataMixin(raw='✓', encoded='utf8=%E2%9C%93')¶
These are the percent-encoded
utf-8
octets representing a checkmark, indicating that the request actually isutf-8
encoded.
- ISO = _SentinelDataMixin(raw='✓', encoded='utf8=%26%2310003%3B')¶
This is what browsers will submit when the
✓
character occurs in anapplication/x-www-form-urlencoded
body and the encoding of the page containing the form isiso-8859-1
, or when the submitted form has anaccept-charset
attribute ofiso-8859-1
. Presumably also with other charsets that do not contain the✓
character, such asus-ascii
.