Skip to content

Add crypto, forex, and indices examples#415

Merged
justinpolygon merged 5 commits into
masterfrom
jw-add-cfi
Apr 3, 2023
Merged

Add crypto, forex, and indices examples#415
justinpolygon merged 5 commits into
masterfrom
jw-add-cfi

Conversation

@justinpolygon

Copy link
Copy Markdown
Collaborator

Added example code snippets for crypto, forex, and indices.

@justinpolygon justinpolygon marked this pull request as ready for review March 29, 2023 12:53
Comment thread examples/rest/crypto-snapshots_all_tickers.py
Comment thread examples/rest/crypto-snapshots_all_tickers.py
@justinpolygon

Copy link
Copy Markdown
Collaborator Author

@jbonzo FYI - it looks like it's actually the linter that made the changes and added the spacing across the lines. So, I changed the code like we chatted about to be:

>                 percent_change = ((item.prev_day.close - item.prev_day.open)/item.prev_day.open*100)
>                 print("{:<15}{:<15}{:<15}{:.2f} %".format(item.ticker,item.prev_day.open,item.prev_day.close,percent_change))

Then, the link check failed here https://github.com/polygon-io/client-python/actions/runs/4601386532/jobs/8129177080?pr=415 so I run poetry run black polygon test_* examples to make the suggested changes and it give me this:

<                 percent_change = (
<                     (item.prev_day.close - item.prev_day.open)
<                     / item.prev_day.open
<                     * 100
<                 )
<                 print(
<                     "{:<15}{:<15}{:<15}{:.2f} %".format(
<                         item.ticker,
<                         item.prev_day.open,
<                         item.prev_day.close,
<                         percent_change,
<                     )
<                 )

Updated code style to pass lint check.
@jbonzo

jbonzo commented Apr 3, 2023

Copy link
Copy Markdown
Collaborator

@jbonzo FYI - it looks like it's actually the linter that made the changes and added the spacing across the lines. So, I changed the code like we chatted about to be:


>                 percent_change = ((item.prev_day.close - item.prev_day.open)/item.prev_day.open*100)

>                 print("{:<15}{:<15}{:<15}{:.2f} %".format(item.ticker,item.prev_day.open,item.prev_day.close,percent_change))

Then, the link check failed here https://github.com/polygon-io/client-python/actions/runs/4601386532/jobs/8129177080?pr=415 so I run poetry run black polygon test_* examples to make the suggested changes and it give me this:


<                 percent_change = (

<                     (item.prev_day.close - item.prev_day.open)

<                     / item.prev_day.open

<                     * 100

<                 )

<                 print(

<                     "{:<15}{:<15}{:<15}{:.2f} %".format(

<                         item.ticker,

<                         item.prev_day.open,

<                         item.prev_day.close,

<                         percent_change,

<                     )

<                 )

Ah. Thats unfortunate. Ok then.

@justinpolygon justinpolygon merged commit 5d8560c into master Apr 3, 2023
@justinpolygon justinpolygon deleted the jw-add-cfi branch April 3, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants