alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
505 stars 125 forks source link

fix: remove f-string for enum #385

Closed hiohiohio closed 7 months ago

hiohiohio commented 7 months ago

fixes #383

Context:

Changes:

Ref:

You can test this by

$ docker run -it --entrypoint bash python:3.12-slim
$ apt-get update && apt-get install git -y
$ pip install git+https://github.com/hiohiohio/alpaca-py.git@fix-stream-url-not-found
$ python3

import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

API_KEY=''
SECRET=''
from alpaca.data.live import CryptoDataStream
wss_client = CryptoDataStream(API_KEY, SECRET)

async def bars_data_handler(data):
    print(data)

wss_client.subscribe_bars(bars_data_handler, "BTC/USD")
wss_client.run()