Skip to main content

No project description provided

Project description

KAQ_QUANT_COMMON

A simple Python package that does amazing things.

Features

  • Feature 1: Does X
  • Feature 2: Does Y

Installation

You can install this package using:

pip install my-package

Pub

Command:

twine upload dist/* --verbose

Simulated Exchange WS

  • Server: WsExchangeServer(exchange, mysql_host, mysql_port, mysql_user, mysql_passwd, mysql_db, start_time, speed_multiplier, use_realtime_event_time, inject_sample_on_empty, port)
  • Client: WsExchangeClient(url)
  • Topics:
    • funding_rate.all
    • funding_rate.<symbol>
  • Notes:
    • inject_sample_on_empty: when DB has no rows, inject small sample events for testing; set to False in production to avoid synthetic pushes.

Example

from kaq_quant_common.api.ws.exchange.ws_exchange_server import WsExchangeServer
from kaq_quant_common.api.ws.exchange.ws_exchange_client import WsExchangeClient

# Start server
server = WsExchangeServer(
    exchange="binance",
    mysql_host="192.168.0.17",
    mysql_port=3306,
    mysql_user="root",
    mysql_passwd="mysql_8x48BF",
    mysql_db="db_kaq_binance",
    start_time=1730000000000,  # ms timestamp
    speed_multiplier=10.0,
    use_realtime_event_time=True,
    inject_sample_on_empty=True,  # disable in production
    port=8768,
)
server.run_with_thread(block=False)

# Client subscribe
client = WsExchangeClient(url="ws://localhost:8768")
client.connect()
client.subscribe_all(lambda evt: print(evt))

client.disconnect()
server.shutdown_with_thread()

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

kaq_quant_common-0.1.34.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

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

kaq_quant_common-0.1.34-py3-none-any.whl (61.4 kB view details)

Uploaded Python 3

File details

Details for the file kaq_quant_common-0.1.34.tar.gz.

File metadata

  • Download URL: kaq_quant_common-0.1.34.tar.gz
  • Upload date:
  • Size: 40.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for kaq_quant_common-0.1.34.tar.gz
Algorithm Hash digest
SHA256 6a896dc70a74eea674b05c530a1a8bfebd3c160944166aca3fa8b70e65550a18
MD5 3c486c7b4267e26c7b025ba2aeb4fbaf
BLAKE2b-256 050b3fca7c84d145395089a8e123540431c37859e9b23b10e227b34f75f68c95

See more details on using hashes here.

File details

Details for the file kaq_quant_common-0.1.34-py3-none-any.whl.

File metadata

File hashes

Hashes for kaq_quant_common-0.1.34-py3-none-any.whl
Algorithm Hash digest
SHA256 f01866b9c951968b6439fce48a56167897aa8d3fe023b425658084250d7ec450
MD5 98e7b5e75225170b730383be71f10367
BLAKE2b-256 372f279fb4389080667b13432fc862749f56bb4d422ff1433d3375578903b887

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