nepse_client.client

Base client implementation for NEPSE API.

This module provides the foundation for both sync and async clients, including common utilities, configuration loading, and response handling.

Functions

mask_sensitive_data(data[, keys])

Mask sensitive fields in data for safe logging.

safe_serialize(obj)

Safely serialize objects for logging.

nepse_client.client.mask_sensitive_data(data, keys=('token', 'password', 'Authorization'))[source]

Mask sensitive fields in data for safe logging.

Parameters:
  • data (dict[str, Any]) – Dictionary containing potentially sensitive data

  • keys (tuple) – Tuple of keys to mask

Return type:

dict[str, Any]

Returns:

Dictionary with masked sensitive values

nepse_client.client.safe_serialize(obj)[source]

Safely serialize objects for logging.

Parameters:

obj (Any) – Object to serialize

Return type:

Union[str, dict, list]

Returns:

Serialized representation