plateau.core.urlencode module
- plateau.core.urlencode.decode_key(key: str) Tuple[str, str, List, str] | Tuple[str, None, List, None] [source]
Split a given key into its plateau 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
- plateau.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.
- plateau.core.urlencode.quote_indices(indices: Iterable[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]
- plateau.core.urlencode.unquote(value)[source]
Decodes a urlencoded string and performs necessary decoding depending on the used python version.
- plateau.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]