Skip to main content

A unofficial Python wrapper for the Kalshi API

Project description

kalshi-python-unofficial

A lightweight Python wrapper for the Kalshi trading API. Fairly untested at the moment.

Usage

Setting API Credentials

import kalshi.auth
kalshi.auth.set_key("PUBLIC_KEY","path/to/private_key.pem")

REST Endpoints

Full coverage except for collections and advanced endpoints.

from kalshi.rest import portfolio, exchange
print(portfolio.GetBalance())
print(exchange.GetExchangeStatus())

Websocket Client

import kalshi.websocket
class MyClient(kalshi.websocket.Client):
    async def on_open(self):
        await self.subscribe(["orderbook_delta"], ["KXBTCD-25JAN1821-T104249.99"])

    async def on_message(self, message):
        print("Received message:", message)

ws_client = MyClient()
asyncio.run(ws_client.connect())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kalshi_python_unofficial-0.0.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kalshi_python_unofficial-0.0.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file kalshi_python_unofficial-0.0.1.tar.gz.

File metadata

File hashes

Hashes for kalshi_python_unofficial-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e513ced55d4e749593540558b919b3d5cccc487d5e35500f37009705a2f433f1
MD5 5bb3ae195bd394baf581c77132b0b2f4
BLAKE2b-256 b62a32a2979fd7c74d7176123b2c87c8636f1ac54c4bf2dcecb4e13ae62df2c0

See more details on using hashes here.

File details

Details for the file kalshi_python_unofficial-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kalshi_python_unofficial-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cfc9b5274ac9f6bcdc4a3adf1ef8384161034384a35976b6e220a613cb8f6652
MD5 a8c98a639a4c311c47bf0608c7a65746
BLAKE2b-256 d2717a37a186d0d25026326649600bb5d895765e39d9c3e6949dd8b5778d1af2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page