kartothek.core.urlencode module¶
-
kartothek.core.urlencode.
decode_key
(key)[source]¶ Split a given key into its kartothek components {dataset_uuid}/{table}/{key_indices}/{filename}
Example
uuid/table/index_col=1/index_col=2/partition_label.parquet
- Returns
dataset_uuid (str)
table (str)
key_indices (list) – The already unquoted list of index pairs
file_ (str) – The file name
-
kartothek.core.urlencode.
quote
(value)[source]¶ Performs percent encoding on a sequence of bytes. if the given value is of string type, it will be encoded. If the value is neither of string type nor bytes type, it will be cast using the str constructor before being encoded in UTF-8.
-
kartothek.core.urlencode.
quote_indices
(indices: List[Tuple[str, str]]) → List[str][source]¶ Urlencode a list of column-value pairs and encode them as:
quote(column)=quote(value)
- Parameters
indices – A list of tuples where each list entry is (column, value)
- Returns
List with urlencoded column=value strings
- Return type
List[str]
-
kartothek.core.urlencode.
unquote
(value)[source]¶ Decodes a urlencoded string and performs necessary decoding depending on the used python version.
-
kartothek.core.urlencode.
unquote_indices
(index_strings: List[str]) → List[Tuple[str, str]][source]¶ Take a list of encoded column-value strings and decode them to tuples
input: quote(column)=quote(value) output (column, value)
- Parameters
indices – A list of tuples where each list entry is (column, value)
- Returns
List with column value pairs
- Return type
List[str]