Tradingview scraper tool
Project description
Tradingview scraper
This is a Python library for scraping ideas and indicators of TradingView.com.
The goal is to develop this package for scraping anything on TradingView.com with realtime response.
Thanks to contributors
To Do List:
- Scrape ideas section of a symbol
- Export as
csv
file - Export as
JSON
- Scrape indicators status data
- Review and fix bugs
etc ... (You suggest)
To be aware of last changes go to the end of this page
Features:
-
Scrape idea's informations like:
Idea's Title
Idea's description
Idea's symbol
Idea's timeframe
Idea's timestamp
Idea's label
Idea's social informations
-
Three ways to scrape webpage:
Scrape the front page
Scrape all pages
Scrape specific range of pages
-
Extract indicators status like of symbols:
RSI
Stoch.K
, etc full list of indicators -
Save data into a CSV file
-
Return json format
Installation:
Open your favorite Terminal and run the command:
pip install tradingview-scraper
Examples:
1. Getting ideas:
from tradingview_scraper import Ideas
obj = Ideas().scraper(symbol: str = None,
startPage: int = 1,
endPage: int = 2,
to_csv: bool = False,
return_json: bool = False)
print(obj)
Setting symbol to None will scrape the ideas front page on TradingView.
Output:
- By default a tuple object containing the following columns is returned:
1. A pandas dataframe (contains: Timestamp, Title, Description, Symbol, Timeframe, Label, Url, ImageURL, Likes, Comments)
2. A string (Symbol description in the first webpage)
- If 'return_json' is set to True, a dictionary will be returned containing the keys below:
`dict_keys(['symbol_description', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])`
Where each of '0' to '9' keys contain an idea's details like 'Timestamp','Title','Description', etc.
2. Getting indicators status:
from tradingview_scraper import Indicators
obj = Indicators().scraper(exchange: str = "BITSTAMP",
symbols: list = ["BTCUSD", "LTCUSDT"],
indicators: list = ["RSI", "Stoch.K"],
allIndicators: bool = False)
print(obj)
Output:
{'BTCUSD': {'RSI': '46.34926112', 'Stoch.K': '40.40173723'}, 'LTCUSD': {'RSI': '43.38421064', 'Stoch.K': '42.32662465'}}
Note:
Default arguments are set to:
Ideas.scraper(symbol: str = None,
startPage: int = 1,
endPage: int = 2,
to_csv: bool = False,
return_json: bool = False)
Argument | Description |
---|---|
symbol | Symbol name |
startPage | specify first page number to scrape |
endPage | specify last page number to scrape |
to_csv | Set it True to save data as a 'CSV' file |
return_json | Set it True to have json format in return |
Indicators().scraper(exchange: str = "BITSTAMP",
symbols: list = ["BTCUSD", "LTCUSDT"],
indicators: list = ["RSI", "Stoch.K"],
allIndicators: bool = False)
Argument | Description |
---|---|
exchange | Exchange name also you can use another exchanges |
symbols | A list of symbols |
indicators | A list of indicators |
allIndicators | Set it True if you need all of indicators |
Changes:
- Release
0.1.0
:
The name ofClassA
changed toIdeas
License
- MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for tradingview-scraper-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b9a49fa8a4bddfebe036ece8e449da0fc10c7d1b02d964fcc0eb81b47877822 |
|
MD5 | e0031eaeffbdb3525cad993eefd86d65 |
|
BLAKE2b-256 | 9c3131b19301bff149e6a1ac2bf7b89c44c19c6c75e18d8064eddbc27923f0a4 |
Close
Hashes for tradingview_scraper-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 781fcd4fbcaf48ca185ac354608c6e143584b7be1e3722548eef2b0d14ecc00c |
|
MD5 | 4aa19b9dfc31bc23a298387cf3fd64aa |
|
BLAKE2b-256 | 5a59191fd016710ea8d9a5b6216f849efb18872625b285a7f1d3a9fa19e83d4a |