百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

stocksight

> 数据库
开源

使用 Elasticsearch、Twitter、新闻标题和 Python 自然语言处理和情感分析的股票市场分析器和预测器

2.5K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用 Elasticsearch、Twitter、新闻标题和 Python 自然语言处理和情感分析的股票市场分析器和预测器

stocksight

Stock market analyzer and stock predictor using Elasticsearch, Twitter, News headlines and Python natural language processing and sentiment analysis. How much do emotions on Twitter and news headlines affect a stock's price? Let's find out...

About

stocksight is an open source stock market analysis software that uses Elasticsearch to store Twitter and news headlines data for stocks. stocksight analyzes the emotions of what the author writes and does sentiment analysis on the text to determine how the author "feels" about a stock. It could be used for more than finding sentiment of just stocks, it could be used to find sentiment of anything...

Slack workspace

Join the conversation, get support, etc on stocksight Slack.

Requirements

  • Python 3.x
  • Elasticsearch 5.x
  • Kibana 5.x
  • elasticsearch python module
  • nltk python module
  • requests python module
  • tweepy python module
  • beautifulsoup4 python module
  • textblob python module
  • vaderSentiment python module
  • newspaper3k python module

Download

$ git clone https://github.com/shirosaidev/stocksight.git
$ cd stocksight

Download latest version

Screenshot

Stocksight Kibana dashboard

Install - Docker

*** See how to use below before building the Docker containers ***

  1. Download/clone stocksight repo with git.
  2. Set up stocksight, elasticsearch and kibana containers using Docker compose
cd stocksight
cp config.py.sample config.py
***see how to use below for config.py (stocksight config) changes***
docker-compose build && docker-compose up

This will volume mount config.py (stocksight settings) and twitteruserids.txt to those files in your local git cloned "stocksight" directory

  1. Once all the containers have started up, shell into the container

docker exec -it stocksight_stocksight_1 bash

  1. See examples below for running stocksight.

Install - local

Recommended to install Elasticsearch and Kibana in local machine or other machine/vm/docker

  1. Install python requirements using pip

pip install -r requirements.txt

  1. Install python nltk data

python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"

How to use

  1. Create a new twitter application and generate your consumer key and access token. https://developer.twitter.com/en/docs/basics/developer-portal/guides/apps.html https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens.html

  2. Copy config.py.sample to config.py (stocksight config file)

  3. Set elasticsearch settings in config.py for your env (for Docker, set elasticsearch_host = "elasticsearch")

  4. Add twitter consumer key/access token and secrets to config.py

  5. Edit config.py and modify NLTK tokens required/ignored and twitter feeds you want to mine. NLTK tokens required are keywords which must be in tweet before adding it to Elasticsearch (whitelist). NLTK tokens ignored are keywords which if are found in tweet, it will not be added to Elasticsearch (blacklist).

Examples

Run sentiment.py to create 'stocksight' index in Elasticsearch and start mining and analyzing Tweets using keywords and the stock symbol TSLA

$ python sentiment.py -s TSLA -k 'Elon Musk',Musk,Tesla,SpaceX --debug

Start mining and analyzing Tweets using keywords and the stock symbol TSLA and follow any url links in tweets and performing sentiment analysis on the link web page as well as the tweet

$ python sentiment.py -s TSLA -k 'Elon Musk',Musk,Tesla,SpaceX -l --debug

Start mining and analyzing Tweets from feeds in config using cached user ids from file (if you change any of the twitter feeds in the config file, you need to delete this file and recreate it without -f)

$ python sentiment.py -s TSLA -f twitteruserids.txt --debug

Start mining and analyzing News headlines and following headline links and scraping relevant text on landing page

$ python sentiment.py -s TSLA --followlinks --debug

Run stockprice.py to add stock prices to 'stocksight' index in Elasticsearch

$ python stockprice.py -s TSLA --debug

Kibana

Load 'stocksight' index in Kibana. For index pattern you can use 'stocksight' if you only have the single index or 'stocksight-*', etc. For time-field name you will want to use the date/time field 'date'.

To import the saved exported visualizations/dashboard, go to Kibana, click on management, click on saved objects, click on the import button and import the export.json file.

CLI options

…

Disclaimer

This software is for educational purposes only. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS. Do not risk money which you are afraid to lose. There might be bugs in the code - this software DOES NOT come with ANY warranty.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonelasticsearchnatural-language-processingnltkpython

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库