Skip to content

Commit

Permalink
Merge pull request #38 from rcholic/updated_at
Browse files Browse the repository at this point in the history
change updated_at to unix ts
  • Loading branch information
rcholic authored Sep 2, 2024
2 parents 2fac2f8 + cb12296 commit 8eb2cd2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cschwabpy/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def to_dataframe_row(self, strip_space: bool = False) -> List[Any]:
self.expirationDate,
util.ts_to_date_string(self.quoteTimeInLong),
self.totalVolume,
util.ts_to_date_string(self.quoteTimeInLong),
self.quoteTimeInLong, # updated_at
self.gamma,
self.delta,
self.vega,
Expand Down Expand Up @@ -417,6 +417,7 @@ def break_down_option_map(
strip_space: bool = False,
) -> Mapping[str, pd.DataFrame]:
"""Whether strip spaces in option symbols."""
now_unix_ts = int(util.now_unix_ts())
result: MutableMapping[str, pd.DataFrame] = {}
for exp_date, strike_map in optionExpMap.items():
expiration = exp_date.split(":")[0]
Expand All @@ -434,6 +435,8 @@ def break_down_option_map(

strike_df = pd.DataFrame(all_rows)
strike_df.columns = OptionChain_Headers
# change updated_at to now_unix_ts
strike_df["updated_at"] = now_unix_ts
result[expiration] = strike_df

return result
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cschwabpy"
version = "0.1.3.8"
version = "0.1.3.9"
description = ""
authors = ["Tony Wang <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="CSchwabPy",
version="0.1.3.8",
version="0.1.3.9",
description="Charles Schwab Stock & Option Trade API Client for Python.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 8eb2cd2

Please sign in to comment.