suou.codecs

Coding/decoding utilities (e.g. Base64).

Functions

b2048decode(val, *[, strip])

Decode a BIP-39 encoded string into bytes.

b2048encode(val)

Encode a bytestring using the BIP-39 wordlist.

b32ldecode(val)

Decode a lowercase base32 encoded byte sequence.

b32lencode(val)

Encode bytes as a lowercase base32 string, with trailing '=' stripped.

b64decode(val)

Wrapper around base64.urlsafe_b64decode() which deals with padding.

b64encode(val, *[, strip])

Wrapper around base64.urlsafe_b64encode() which also strips trailing '='.

cb32decode(val)

Decode bytes from Crockford Base32.

cb32encode(val)

Encode bytes in Crockford Base32.

cb32lencode(val)

Encode bytes in Crockford Base32, lowercased.

jsonencode(obj, *[, skipkeys, separators, ...])

json.dumps() but with stricter and smarter defaults, i.e. no whitespace in separators, and encoding dates as ISO strings.

quote_css_string(s)

Quotes a string as CSS string literal.

rb64decode(val)

Wrapper around base64.urlsafe_b64decode() which deals with padding.

rb64encode(val, *[, strip])

Call base64.urlsafe_b64encode() with null bytes i.e. '0' padding to the start.

ssv_list(s, *[, sep_chars])

Parse values from a Space Separated Values (SSV) string.

twocolon_list(s)

Parse a string on a single line as multiple lines, each line separated by double colon (::).

want_bytes(s[, encoding, errors])

Force a string into its bytes representation.

want_str(s[, encoding, errors])

Convert a bytestring into a text string.

want_urlsafe(s)

Force a Base64 string into its urlsafe representation.

want_urlsafe_bytes(s)

Shorthand for want_bytes(want_urlsafe(s)).

z85encode(val)

Classes

StringCase(*values)

Enum values used by regex validators and storage converters.