Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change updated_at to unix ts #38

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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