GithubHelp home page GithubHelp logo

pstocky's Introduction

股票小数据

快速上手

构建 docker 镜像(or 本地准备 python 环境)

git clone [email protected]:JackonYang/dockerfiles.git
cd dockerfiles/apps-pstocky
make docker-build

启动 juypter server

cd pstocky
make start-jupyter

浏览器打开代码

url: 127.0.0.1:8899

如果是在远程服务器上,IP 改为服务器 IP 即可。

⚠️注意⚠️:juypter server 默认不需要密码,且以 root 运行。使用方便,但暴露在公网有很大的安全风险。

运行环境

dockerfile: https://github.com/JackonYang/dockerfiles/tree/master/apps-pstocky

pstocky's People

Contributors

jackonyang avatar linux-wang avatar nevercc avatar rtx3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pstocky's Issues

画饼了画饼了

项目远景呢!项目远景呢!!项目远景呢!!!

坦白的说,
我也一直在考虑中,还没有形成一个特别具体而又明确的焦点,
所以,一直在回避讨论远景。

没有远景,就敢开始?

对!就是这么任性。

短期目标明确

  1. 取到数据。最好是数据源多一点,可以做数据的交叉验证。
  2. 完善代码的框架,其他的项目里可以复用。
  3. 让 python 新人在实际的项目中,实战一下。

这里存在着刚需。

那么多的工具,为啥还要重复开发呢?

再多的工具,我们都没有用起来,或者,总觉得缺点啥功能。
为什么不自己开发呢?

面对刚需,只要眼下没有走弯路,做就对了!

最起码,可以深入理解股票啊

远景,可以是什么?

一个靠谱的股票分析工具,至少,我自己会使用的工具。

很多人对工具的态度非常极端:

靠谱的工具 == 可以给出傻瓜都能赚钱的策略。

所以,把自己定位成这种工具的目标群体的人,是?哈哈

我的理解:

  1. 帮助我快速成为专家,缩短学习时间。

    我们可以通过粗略的模拟+演练,在短时间内完成部分经验的积累。
    不要跟我撕模拟的不真实。不能太极端。

  2. 给出一些定性的分析。

    定量分析,是国际顶级团队再做的。我们不做梦。
    定性的分析,还是可以试试的嘛。

  3. 虽然我不知道什么可以赚,但我能证明,什么赚不了。

    不要拿真金白银去做回测!

我最希望从项目里得到的经验是:
大型的数据分析项目,该如何做架构。
包括:爬虫、数据清洗、数据分析、web 交互、admin 管理台、open API。
甚至会加上人工智能的框架

@kingzeus 的观点,我也很赞同:

所以这个项目就是给大家玩的。跳出你熟悉的框架或者代码,努力去尝试些新的技术

传统的思路和方法,如果能赚钱,也就轮不到我们来做这个项目了。

一面方面,我们想打破常规,来点刺激的。
而这个项目,又需要打破常规的思维。

所以,这里就是数据分析新技术的试验田嘛!

[需求] 实时数据的爬虫

免费的 API,质量不会太好。
自己写一个,也很方便。

频率不要太高,以免被屏蔽。

多找几个数据源,可以做交叉验证。

大家有时间了,就来写一个数据源的爬虫。

项目架构讨论

为了不让项目过早的死于混乱的代码,架构很重要。

大家现在这里一起补充、讨论下。
然后,可以约一个视频会议敲定最终的结论。

大型的数据分析项目,该如何做架构。
是我最希望从项目里得到的经验。

必备模块包括:

  • 爬虫
  • 数据清洗
  • 数据分析
  • web 交互
  • admin 管理台
  • open API
  • 机器学习

延伸模块:

  • 深度学习等热点内容

开发环境与生产环境 dockerfile 分开

  1. 开发环境,挂载本地代码,注意,不是 copy。生产环境,从 github 上 pull 最新的 master 分之
  2. 开发环境,docker 内配 mysql。生产环境,暂时使用 host 里的 mysql / nginx

第 38 行,这里不适合于 开发环境的 dockerfile

RUN cd /opt && \
    git clone https://github.com/pstocky/pstocky.git

异常栈,初始化失败

Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip/utils/init.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/django'

[需求]自动化部署

写一套可以自动生成部署配置文件的脚本。

环境包括:

  • nginx
  • uwsgi
  • supervisor
  • mysql
  • redis
  • celery

项目相关的配置,存储在一个配置文件中 pstock.ini
比如: 域名、mysql 的用户名/密码等。

操作流程:

  1. 读取配置文件,并设置为环境变量。
  2. 读取环境变量,根据 nginx 模版生成项目的 nginx 配置,并 copy 到对应的 nginx 目录下
  3. ... mysql ...
    ...
  4. 通过 Django 的 manage.py 执行 migration 操作,初始化数据库
  5. load initial 数据
  6. runserver

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.