mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-05 08:51:20 +00:00
Remove NaNs in table, add pyupgrade/Detect private key/ check merge conflicts to pre commit
This commit is contained in:
@@ -5,6 +5,8 @@ repos:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: check-merge-conflict
|
||||
- id: detect-private-key
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 21.4b2
|
||||
hooks:
|
||||
@@ -36,3 +38,8 @@ repos:
|
||||
- id: detect-secrets
|
||||
args: [ '--baseline', '.secrets.baseline' ]
|
||||
exclude: package.lock.json
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v2.18.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [ --py36-plus ]
|
||||
|
||||
@@ -86,25 +86,25 @@ Campares the overview of different ETFs. Unknown tickers show nan
|
||||
Example:
|
||||
|
||||
```
|
||||
(✨) (etf)> compare spy,qqq,voo,DOGE
|
||||
(✨) (etf)> compare spy,qqq,voo,doge
|
||||
DOGE not found
|
||||
╒════════════════╤══════════╤══════════╤══════════╤════════╕
|
||||
│ │ SPY │ QQQ │ VOO │ DOGE │
|
||||
╞════════════════╪══════════╪══════════╪══════════╪════════╡
|
||||
│ Last Price │ $414.94 │ $327.01 │ $381.47 │ nan │
|
||||
├────────────────┼──────────┼──────────┼──────────┼────────┤
|
||||
│ Assets │ $352.93B │ $153.76B │ $219.80B │ nan │
|
||||
├────────────────┼──────────┼──────────┼──────────┼────────┤
|
||||
│ NAV │ $410.85 │ $322.66 │ $377.68 │ nan │
|
||||
├────────────────┼──────────┼──────────┼──────────┼────────┤
|
||||
│ Expense Ratio │ 0.09% │ 0.20% │ 0.03% │ nan │
|
||||
├────────────────┼──────────┼──────────┼──────────┼────────┤
|
||||
│ PE Ratio │ 25.16 │ 35.32 │ 27.60 │ nan │
|
||||
├────────────────┼──────────┼──────────┼──────────┼────────┤
|
||||
│ Beta (5Y) │ 0.99 │ 1.04 │ 0.99 │ nan │
|
||||
├────────────────┼──────────┼──────────┼──────────┼────────┤
|
||||
│ Dividend (ttm) │ $5.56 │ $1.77 │ $5.39 │ nan │
|
||||
├────────────────┼──────────┼──────────┼──────────┼────────┤
|
||||
│ Dividend Yield │ 1.35% │ 0.55% │ 1.43% │ nan │
|
||||
╘════════════════╧══════════╧══════════╧══════════╧════════╛
|
||||
╒════════════════╤══════════╤══════════╤══════════╕
|
||||
│ │ SPY │ QQQ │ VOO │
|
||||
╞════════════════╪══════════╪══════════╪══════════╡
|
||||
│ Last Price │ $414.94 │ $327.01 │ $381.47 │
|
||||
├────────────────┼──────────┼──────────┼──────────┤
|
||||
│ Assets │ $353.25B │ $157.51B │ $222.38B │
|
||||
├────────────────┼──────────┼──────────┼──────────┤
|
||||
│ NAV │ $415.21 │ $328.91 │ $381.70 │
|
||||
├────────────────┼──────────┼──────────┼──────────┤
|
||||
│ Expense Ratio │ 0.09% │ 0.20% │ 0.03% │
|
||||
├────────────────┼──────────┼──────────┼──────────┤
|
||||
│ PE Ratio │ 25.16 │ 35.32 │ 27.60 │
|
||||
├────────────────┼──────────┼──────────┼──────────┤
|
||||
│ Beta (5Y) │ 0.99 │ 1.04 │ 0.99 │
|
||||
├────────────────┼──────────┼──────────┼──────────┤
|
||||
│ Dividend (ttm) │ $5.56 │ $1.77 │ $5.39 │
|
||||
├────────────────┼──────────┼──────────┼──────────┤
|
||||
│ Dividend Yield │ 1.34% │ 0.54% │ 1.41% │
|
||||
╘════════════════╧══════════╧══════════╧══════════╛
|
||||
```
|
||||
|
||||
@@ -120,6 +120,7 @@ def etf_overview(other_args: List[str]):
|
||||
value.append(row.text)
|
||||
df = pd.DataFrame(value, index=column, columns=[ns_parser.name.upper()])
|
||||
print(tabulate(df, headers=df.columns, tablefmt="fancy_grid"))
|
||||
print("")
|
||||
return ""
|
||||
except Exception as e:
|
||||
print(e, "\n")
|
||||
@@ -180,6 +181,7 @@ def etf_holdings(other_args: List[str]):
|
||||
df, headers=["Ticker", "% of ETF", "Shares"], tablefmt="fancy_grid"
|
||||
)
|
||||
)
|
||||
print("")
|
||||
return ""
|
||||
|
||||
except Exception as e:
|
||||
@@ -240,8 +242,10 @@ def compare_etfs(other_args: List[str]):
|
||||
df[etf] = value
|
||||
else:
|
||||
print(f"{etf} not found")
|
||||
df = df.drop(etf, axis=1)
|
||||
df.index = column
|
||||
print(tabulate(df, headers=df.columns, tablefmt="fancy_grid"))
|
||||
print("")
|
||||
return ""
|
||||
except Exception as e:
|
||||
print(e, "\n")
|
||||
|
||||
Reference in New Issue
Block a user