Skip to content

Commit 82c31f1

Browse files
committed
Updated docs
1 parent cebf716 commit 82c31f1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/tradingview_screener/query.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ def set_tickers(self, *tickers: str) -> Self:
400400
"""
401401
Set the tickers you wish to receive information on.
402402
403+
Note that this resets the markets and sets the URL market to `global`.
404+
403405
Examples:
404406
405407
>>> q = Query().select('name', 'market', 'close', 'volume', 'VWAP', 'MACD.macd')
@@ -431,6 +433,8 @@ def set_index(self, *indexes: str) -> Self:
431433
"""
432434
Scan only the equities that are in in the given index (or indexes).
433435
436+
Note that this resets the markets and sets the URL market to `global`.
437+
434438
Examples:
435439
436440
>>> Query().set_index('SYML:SP;SPX').get_scanner_data()
@@ -505,10 +509,6 @@ def set_index(self, *indexes: str) -> Self:
505509
# self.query['price_conversion'] = {'to_currency': currency}
506510
# return self
507511

508-
# TODO: add tests for set_ticker() and set_index() and make sure if its necessary to reset the
509-
# URL or markets property
510-
# and review the docs again
511-
512512
def set_property(self, key: str, value: Any) -> Self:
513513
self.query[key] = value
514514
return self
@@ -547,18 +547,16 @@ def get_scanner_data_raw(self, **kwargs) -> ScreenerDict:
547547

548548
def get_scanner_data(self, **kwargs) -> tuple[int, pd.DataFrame]:
549549
"""
550-
Perform a POST web-request and return the data from the API as a DataFrame.
551-
552-
This returns a Pandas DataFrame, so make sure you have `pandas` installed.
550+
Perform a POST web-request and return the data from the API as a DataFrame (along with
551+
the number of rows/tickers that matched your query).
553552
554553
Note that you can pass extra keyword-arguments that will be forwarded to `requests.post()`,
555554
this can be very useful if you want to pass your own headers/cookies.
556555
557556
### Live/Delayed data
558557
559-
If you have paid for a live data add-on with TradingView, you want to pass your own
560-
headers and cookies to access that real-time data, otherwise you
561-
# TODO finish this and add to the README too
558+
Note that to get live-data you have to authenticate, which is done by passing your cookies.
559+
Have a look in the README at the "Real-Time Data Access" sections.
562560
563561
:param kwargs: kwargs to pass to `requests.post()`
564562
:return: a tuple consisting of: (total_count, dataframe)

0 commit comments

Comments
 (0)