Examples#
Example:
from stakepd import kalshi_data as kd
key = kd.load_private_key(private_key_path="~/.kalshi/key.pem")
kd.load_private_key(private_key=None, private_key_path=None, password=None)Load an RSA or Ed25519 PEM private key.
KalshiClient loads the key for you. It’s useful together with KalshiAuth for calling endpoints the wrapper doesn’t cover.private_key:str or bytes, optionalprivate_key_path.private_key_path:str or os.PathLike, optional.pem file.password:bytes, optionalcryptography key object).KalshiAuthErrorKalshiAuthrequests authentication handler that adds Kalshi’s signature headers.KalshiClientExample:
from stakepd import kalshi_data as kd
key = kd.load_private_key(private_key_path="~/.kalshi/key.pem")
This method is also covered, alongside the rest of the module, in the overview guide.