aleph.toolkit.cursor module¶
- aleph.toolkit.cursor.decode_address_cursor(cursor: str) str[source]¶
Decode an address-based cursor back to address.
- aleph.toolkit.cursor.decode_address_stats_cursor(cursor: str) Tuple[Any, str][source]¶
Decode an address stats cursor back to (sort_value, address).
- aleph.toolkit.cursor.decode_aggregate_cursor(cursor: str) Tuple[datetime, str, str][source]¶
Decode an aggregate cursor back to (time, key, owner).
- aleph.toolkit.cursor.decode_credit_history_cursor(cursor: str) Tuple[datetime, str, int][source]¶
Decode a credit history cursor back to (message_timestamp, credit_ref, credit_index).
- aleph.toolkit.cursor.decode_credit_history_sort_cursor(cursor: str) Tuple[str, Any, int, str, int][source]¶
Decode a credit history sort cursor.
Returns (sort_by, sort_value, sort_order, credit_ref, credit_index). For backward compat, if ‘s’ key is missing, assumes ‘message_timestamp’ sort with DESC order and uses the ‘t’ key as the sort value.
- aleph.toolkit.cursor.decode_cursor(cursor: str) Dict[str, Any][source]¶
Decode a cursor string back to a dict. Raises ValueError if malformed.
- aleph.toolkit.cursor.decode_message_cursor(cursor: str) Tuple[datetime, str][source]¶
Decode a message/post/file cursor back to (time, item_hash).
- aleph.toolkit.cursor.encode_address_cursor(address: str) str[source]¶
Encode an address-based cursor: (address,).
- aleph.toolkit.cursor.encode_address_stats_cursor(sort_value: Any, address: str) str[source]¶
Encode an address stats cursor: (sort_value, address).
- aleph.toolkit.cursor.encode_aggregate_cursor(time: datetime, key: str, owner: str) str[source]¶
Encode an aggregate cursor: (time, key, owner).
- aleph.toolkit.cursor.encode_credit_history_cursor(time: datetime, credit_ref: str, credit_index: int) str[source]¶
Encode a credit history cursor: (message_timestamp, credit_ref, credit_index).
- aleph.toolkit.cursor.encode_credit_history_sort_cursor(sort_by: str, sort_value: Any, sort_order: int, credit_ref: str, credit_index: int) str[source]¶
Encode a credit history cursor with sort field and order info.