Giter VIP home page Giter VIP logo

tradingview-scraper's Introduction

Tradingview scraper

The goal is to develop this package for scapping anything on https://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 symbol

    Idea's timeframe

    Idea's timestamp

    Idea's label

    Idea's social informations

    Idea's description

  • Three ways to scrape webpage:

    Scrape just first 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 = 'btc',
                      wholePage = False,
                      startPage = 1,
                      endPage = 2, 
                      to_csv = False,
                      return_json=False)
print(obj)

Output:

- A tuple which contain:
  1. A pandas dataframe (contains: timeStamp, symbol, timeFrame, label, title, socialInfo) 
  2. A string (Symbol description in the first webpage)
- A Json which contain keys like bellow:   
  `dict_keys(['symbol_description', '0', '1', '2', '3', '4', '5'])`   
  which each of '0' to '5' keys containing ideas details like 'timestamp','symbol','timefram', etc.

2. Getting indicators status:

from tradingview_scraper import Indicators
obj = Indicators().scraper(exchange="BITSTAMP",
                          symbols=["BTCUSD","LTCUSD"],
                          indicators=["RSI","Stoch.K"],
                          allIndicators=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 = 'btc',
              wholePage = False,
              startPage = 1,
              endPage = 2, 
              to_csv = False,
              return_json = False)
Argument Description
symbol Symbol name
wholePage Set it True if you want to scrape all pages
(Then specify startPage and endPage)
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="BITSTAMP",
                    symbols=["BTCUSD"],
                    indicators=["RSI"],
                    allIndicators=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 of ClassA changed to Ideas

License

  • MIT

tradingview-scraper's People

Contributors

mnwato avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.