Skip to content

Commit

Permalink
fix quote 0 int values
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxrk committed Jun 21, 2024
1 parent 5c62d88 commit bbdf540
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions firstrade/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ def __init__(self, ft_session: FTSession, symbol: str):
self.bid = float(quote.find("bid").text.replace(",", ""))
self.ask = float(quote.find("ask").text.replace(",", ""))
self.last = float(quote.find("last").text.replace(",", ""))
self.bid_size = int(quote.find("bidsize").text.replace(",", ""))
self.ask_size = int(quote.find("asksize").text.replace(",", ""))
self.last_size = int(quote.find("lastsize").text.replace(",", ""))
temp_store = quote.find("bidsize").text.replace(",", "")
self.bid_size = int(temp_store) if temp_store.isdigit() else 0
temp_store = quote.find("asksize").text.replace(",", "")
self.ask_size = int(temp_store) if temp_store.isdigit() else 0
temp_store = quote.find("lastsize").text.replace(",", "")
self.last_size = int(temp_store) if temp_store.isdigit() else 0
self.bid_mmid = quote.find("bidmmid").text
self.ask_mmid = quote.find("askmmid").text
self.last_mmid = quote.find("lastmmid").text
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

setuptools.setup(
name="firstrade",
version="0.0.18",
version="0.0.19",
author="MaxxRK",
author_email="[email protected]",
description="An unofficial API for Firstrade",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
url="https://github.com/MaxxRK/firstrade-api",
download_url="https://github.com/MaxxRK/firstrade-api/archive/refs/tags/0018.tar.gz",
download_url="https://github.com/MaxxRK/firstrade-api/archive/refs/tags/0019.tar.gz",
keywords=["FIRSTRADE", "API"],
install_requires=["requests", "beautifulsoup4", "lxml"],
packages=["firstrade"],
Expand Down

0 comments on commit bbdf540

Please sign in to comment.