EXIR Python Client - Examples
This repository contains a lightweight Python client in index.py and runnable examples under example/ for:
- Public: Fetching market data (e.g., ticker)
- Private: Authenticated calls (user, balance, place orders)
- WebSocket: Streaming market data (orderbook)
Requirements
- Python 3.8+
- Install dependencies:
python3 -m pip install -r requirements.txt
Project layout
index.py: EXIR client (public, private, and WebSocket helpers)utils.py: HTTP and auth utilitiesexample/public.py: Public ticker exampleexample/balance.py: Private user + balance exampleexample/order.py: Private create order exampleexample/websocket.py: WebSocket orderbook subscription example
Public usage
Fetch the ticker for btc-usdt:
python3 example/public.py
Example:
python3 example/public.py
Private usage (user, balance)
Set your api keys:
EXIR_API_KEY=<your-api-key> \
EXIR_API_SECRET=<your-api-secret> \
Notes:
- Ensure your key has the required permissions (e.g., trading, read balance).
- If IP whitelisting is enabled on the key, include your current IP.
- Your system clock must be accurate; auth uses expiring signatures.
Private usage (create order)
Places a limit BUY order for 0.001 BTC at 50,000 USDT on btc-usdt:
If you receive 401 Unauthorized when creating orders:
- Check key permissions and IP whitelist
- Ensure your system clock is in sync
WebSocket usage (orderbook)
Subscribes to orderbook:btc-usdt and logs messages for ~10 seconds:
Notes:
- Public WS channels (e.g.,
orderbook,trade) do not require credentials, but the script will include them if provided. - The client automatically reconnects by default.
Metadata
Release files for exir-py-lib 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| exir_py_lib-1.0.2.tar.gz | 10.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| exir_py_lib-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.8 kB
Release files / exir_py_lib-1.0.2.tar.gz
| Download URL | exir_py_lib-1.0.2.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50c55eecad724b87bdb6b635a65830002423cd5987035cc8b8fd3dc0e523ac42
|
|
BLAKE2b-256 checksum How to use checksums |
1facbe6622ab5b853dbd35036cc0d09eebbd41c9c3b2ff9ccd6aad977c1af1ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / exir_py_lib-1.0.2-py3-none-any.whl
| Download URL | exir_py_lib-1.0.2-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5dc8e7d8bcedd7636004765a170097284e3f021af4ebfe82b3ec8f0e066a53b2
|
|
BLAKE2b-256 checksum How to use checksums |
d1be1cf51c5d9e84fd9cfa1ec28cda4d642a13d2be1a9f1300b7a6df11b1b346
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for exir-py-lib 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.