Giter VIP home page Giter VIP logo

snowman's Introduction

snowman

small mvc for grab stock data and analysis ,simple using elastic as database and redis for caching data,using bootstrap theme and baidu Echart for analytic data display

说明


snoman是用来做stock数据采集及分析的mvc框架,采用ElasticSearch做数据库存储,Redis做数据缓存,集成了简单的Router,View , Elastic 查询,Redis查询,Command脚本,Bootstroop主题,Echart图标绘制,datePicker 等功能,此版本为基础版本,后续功能将会逐步完善

本项目效果截图在exmple下面

项目搭建


安装方法

首先你需要安装elasticsearh和Redis等服务,执行git clone 完成项目初始化

git clone [email protected]:martin20140408/snowman.git .
ElasticSearch/Redis安装

下载 ElasticSearch 客户端,解压到本地目录后在bin点击elasticsearch.bat启动服务

下载 Redis 客户端,执行redis-server.exe启动服务

[可选]使用nssm为Elasticsearch和Redis注册系统服务

数据采集
php command.php capture #index stock
php command.php capture/getDailyData  #index daily data
数据导入
php command.php import/loadFromCsv #bulk load data from csv
php command.php import #load csv data from specific csv file
数据导出
php command.php export/saveToCsv #save remote data to local csv files
php command.php export  type=stock #import elasticsearch data to csv files
数据删除
php command.php delete #delete data by elasticsearch condition
ElasticHelper查询

支持mysql风格和Elastic风格两种查询方式

Helper::getEs()
  ->select('COUNT(mid),sex,mid')
  ->term(["sex"=>1],1)
  ->terms(["mid"=>[34,35,33]])
  ->wildcard(["language"=>"*zh*"])
  ->sort("id desc ,mid asc")
  ->aggs("mid")
  ->limit(10);
等价于
  Helper::getEs()
  ->select('COUNT(mid),sex,mid')
  ->where(["sex"=>1],1)
  ->in(["mid"=>[34,35,33]])
  ->like(["language"=>"*zh*"])
  ->order("id desc ,mid asc")
  ->group("mid")
  ->limit(10);
//like mysql 
//select COUNT(mid),sex,mid from xx where sex != 1 and mid in ('34','35','33') and language like "%zh%" group by mid order bu id desc ,mid asc limit 0,10

snowman's People

Contributors

martin20140408 avatar

Watchers

 avatar  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.