Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmysitu committed Apr 13, 2024
1 parent e63dbfb commit 5b272a7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
25 changes: 25 additions & 0 deletions examples/get_xnas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/python3 -u

import msfinance as msf

proxy = 'socks5://127.0.0.1:1088'

stock = msf.Stock(
debug=True,
session='xnas.db3',
proxy=proxy,
)

tickers_list = {
'asml', # ASML Holding NV ADR
}

for ticker in sorted(tickers_list):
valuations = stock.get_valuations(ticker, 'xnas')
financials = stock.get_financials(ticker, 'xnas')

print(f"Ticker: {ticker}")
for valuation in valuations:
print(valuation)
for financial in financials:
print(financial)
25 changes: 25 additions & 0 deletions examples/get_xnys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/python3 -u

import msfinance as msf

proxy = 'socks5://127.0.0.1:1088'

stock = msf.Stock(
debug=True,
session='xnys.db3',
proxy=proxy,
)

tickers_list = {
'tsm',
}

for ticker in sorted(tickers_list):
valuations = stock.get_valuations(ticker, 'xshg')
financials = stock.get_financials(ticker, 'xshg')

print(f"Ticker: {ticker}")
for valuation in valuations:
print(valuation)
for financial in financials:
print(financial)
2 changes: 1 addition & 1 deletion tests/test_stocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def test_stocks():
proxy = 'socks5://127.0.0.1:1088'
session='/tmp/msfinance/msf.sql3'
session='/tmp/msfinance/msf.db3'


if 'true' == os.getenv('GITHUB_ACTIONS'):
Expand Down

0 comments on commit 5b272a7

Please sign in to comment.