web_trader::bar_chart: Python Flask 游戏,整合来自纳斯达克的数据,让用户练习买卖股票

  • k8_869223
    了解作者
  • 2.1MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 04:30
    上传日期
网上交易员 Web Trader 是一个交易网站,它整合了来自纳斯达克的数据,允许用户搜索任何股票的股票代码和价格。 我使用 HTML 和 CSS 来格式化所有页面,并使用 Python 进行后端开发。 所有用户信息、交易、持有和余额都存储在 SQLite3 数据库中。 用户不仅可以搜索股票,还可以使用自有资金进行买卖。 目标是最终获得丰厚的利润。 设置 克隆(或下载)存储库: git clone git@github.com:Paulinakhew/web_trader.git 下载所有必要的软件包: macOS 用户 $ pip3 install -r requirements.txt Linux 用户 $ pip install -r requirements.txt 创建 sqlite3 数据库: $ python3 schema.py 种子数据库: $ pyth
web_trader-master.zip
  • web_trader-master
  • .github
  • ISSUE_TEMPLATE
  • bug_report.md
    834B
  • feature_request.md
    595B
  • workflows
  • pythonpackage.yml
    1KB
  • Procfile.txt
    22B
  • .vscode
  • settings.json
    191B
  • model.py
    14KB
  • test_model.py
    3.4KB
  • controller.py
    6.2KB
  • requirements.txt
    146B
  • Pipfile.lock
    20.6KB
  • Transaction.py
    1.2KB
  • .travis.yml
    215B
  • server.py
    1.3KB
  • LICENSE
    1KB
  • setup.cfg
    208B
  • README.md
    4KB
  • Pipfile
    325B
  • .pre-commit-config.yaml
    1.2KB
  • seed.py
    343B
  • schema.py
    1.3KB
  • templates
  • search.html
    8.1KB
  • trade.html
    8.3KB
  • create.html
    2.9KB
  • menu.html
    3.7KB
  • login.html
    7.7KB
  • contact.html
    7.8KB
  • dashboard.html
    7.9KB
  • .gitignore
    1.2KB
  • .coveragerc
    47B
  • static
  • trading.jpg
    116.1KB
  • apple-icon-60x60.png
    5.5KB
  • manifest.json
    721B
  • apple-icon-57x57.png
    5KB
  • .DS_Store
    10KB
  • favicon-96x96.png
    8.6KB
  • apple-icon-precomposed.png
    17.3KB
  • lookup_quote.png
    201.4KB
  • apple-icon-120x120.png
    12.2KB
  • login.png
    1.1MB
  • android-icon-192x192.png
    16.7KB
  • favicon.ico
    1.1KB
  • ms-icon-150x150.png
    16.7KB
  • apple-icon.png
    17.3KB
  • ms-icon-70x70.png
    6.4KB
  • dashboard.png
    85.3KB
  • apple-icon-180x180.png
    21.3KB
  • linkedin_logo.png
    5.4KB
  • apple-icon-72x72.png
    6.4KB
  • buy_sell.png
    167.3KB
  • android-icon-96x96.png
    8.6KB
  • favicon-32x32.png
    2.3KB
  • github_logo.svg
    2.9KB
  • android-icon-48x48.png
    3.8KB
  • ms-icon-310x310.png
    55.9KB
  • arrow.png
    824.5KB
  • apple-icon-144x144.png
    14.9KB
  • main_menu.png
    316.9KB
  • ms-icon-144x144.png
    14.9KB
  • android-icon-144x144.png
    14.9KB
  • blank_user.png
    32.2KB
  • android-icon-72x72.png
    6.4KB
  • apple-icon-152x152.png
    16.9KB
  • apple-icon-76x76.png
    6.9KB
  • apple-icon-114x114.png
    11.6KB
  • favicon-16x16.png
    1.4KB
  • browserconfig.xml
    282B
  • android-icon-36x36.png
    2.7KB
内容介绍
[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/) [![Build Status](https://travis-ci.com/Paulinakhew/web_trader.svg?branch=master)](https://travis-ci.com/github/Paulinakhew/web_trader) [![Coverage Status](https://coveralls.io/repos/github/Paulinakhew/web_trader/badge.svg?branch=master)](https://coveralls.io/github/Paulinakhew/web_trader?branch=master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Paulinakhew/web_trader/blob/master/LICENSE) <a href="https://gitmoji.carloscuesta.me" rel='nofollow' onclick='return false;'> <img src="https://img.shields.io/badge/gitmoji-%20���%20���-FFDD67.svg?style=flat-square" alt="Gitmoji"> </a> # Web Trader Web Trader is a trading website that consolidates data from Nasdaq, allowing the user to search up the ticker symbol and price of any stock. I employed HTML and CSS to format all the pages and used Python for the back end development. All of the user information, transactions, holdings, and balances are stored in a SQLite3 database. Not only can users search up stocks, they can buy and sell using their own funds. The goal is to end up with a large profit. ## Setup - Clone (or download) the repository: ```ShellSession git clone git@github.com:Paulinakhew/web_trader.git ``` - Download all the necessary packages: * **MacOS Users** ```ShellSession $ pip3 install -r requirements.txt ``` * **Linux Users** ```ShellSession $ pip install -r requirements.txt ``` - Create the sqlite3 database: ```ShellSession $ python3 schema.py ``` - Seed the database: ```ShellSession $ python3 seed.py ``` - Install pre-commit hook: ``` pre-commit install ``` - Run the app locally: ```ShellSession $ python3 controller.py ``` - Paste http://127.0.0.1:5000 into your web browser and have fun! �ㄹ ## Example Photos **This is the login menu where you can login or create a new user account.** ![Login menu](static/login.png?raw=true "Login menu") **This is the main menu that opens after you log in.** ![Main menu](static/main_menu.png?raw=true "Main menu") **The dashboard is where you can see all of your previous transactions as well as current holdings.** ![Dashboard](static/dashboard.png?raw=true "Dashboard") **This page lets the user lookup ticker symbols and the last prices of stocks.** ![Lookup and Quote Menu](static/lookup_quote.png?raw=true "Lookup and Quote Menu") **The buy and sell menu lets the user input the ticker symbol and quantity of the stock that they want to purchase/sell.** ![Buy and Sell Menu](static/buy_sell.png?raw=true "Buy and Sell Menu") ### SQLite3 Database The database is created using SQLite3. There are five tables in total, each serving a different purpose. For example, the transactions table is used to store the date, number of shares, and ticker symbols of all the users' purchases. This is the code for the transactions table: ```SQLite3 CREATE TABLE transactions( pk INTEGER PRIMARY KEY AUTOINCREMENT, ticker_symbol TEXT, num_shares FLOAT, owner_username INTEGER, last_price FLOAT, date TEXT, FOREIGN KEY(owner_username) REFERENCES user(username) ); ``` ### API I used the `flask_restful` extension to create an `api`. The endpoints are as follows: ``` '/users' '/transactions' '/transactions/<username>' '/holdings/<username>' ``` ### Testing I use GitHub actions and Pytest to test the project. You can see the tests [here](test_model.py). I also have the API Key for the Intrinio API set up as a Secret. Secrets are environment variables that are encrypted and only exposed to selected actions. Anyone with collaborator access to this repository can use these secrets in a workflow. ### Security Instead of storing passwords as plaintext, I stored the salt and the hash of the password. When users try to log in, the hashed password is compared to the hash in the database. ```Python3 pwdhash = hashlib.pbkdf2_hmac( 'sha512', password.encode('utf-8'), salt.encode('ascii'), 100000 ) ``` ### New Features :sparkles: Feel free to create a GitHub issue for this repository if you have any new ideas!
评论
    相关推荐
    • Flashcards
      在本练习结束之前,您的Flashcard应用程序应该可以保存多张用户创建的卡片,以便用户可以重新访问该应用程序以查看其卡片 应用浏览 TODO://在下面的“用户故事”部分中,为您完成的任何用户故事,在-[ ]这样的- [x]...
    • Flashcards
      将代码推送到GitHub 选修的 在问题和答案之间切换抽认卡 设置卡片问与答面的样式,以更好地区分两个面 在卡片下方添加可选的多项选择答案 实验2 应用说明 与上面的实验1相同,但具有其他功能供用户创建自己的抽...
    • Flashcards
      抽认卡 :memo: NOTE将此模板粘贴到上一个实验中现有... 将代码推送到GitHub 选修的 如果用户尝试创建没有问题或答案的新抽认卡,则会收到错误消息 用户可以编辑现有的抽认卡 用户可以在创建屏幕中添加多项选择答案
    • Flashcards
      将代码推送到GitHub 选修的 如果用户尝试创建没有问题或答案的新抽认卡,则会收到错误消息 用户可以编辑现有的抽认卡 用户可以在创建屏幕中添加多项选择答案 实验1 应用说明 这个应用程式会显示一个问题,然后轻...
    • whiteFlash.github.io
      whiteFlash.github.io
    • Flashcards
      将代码推送到GitHub 选修的 如果用户尝试创建没有问题或答案的新抽认卡,则会收到错误消息 用户可以编辑现有的抽认卡 用户可以在创建屏幕中添加多项选择答案 实验1 抽认卡 该应用程序显示一个问题,用户点击标签...
    • flash日志管理
      flash操作管理大全,很好的项目,用于想用flash做日志
    • Flashcards
      将代码推送到GitHub 可选的 首次显示时,用户应看到带有圆角,阴影和动画的更好的flaschard 在不同尺寸的手机上使用应用程序时,用户应正确查看所有视图的布局 多项选择中的正确答案应该是随机的 实验3 应用说明...
    • Flashcards
      将代码推送到GitHub 选修的 如果用户尝试创建没有问题或答案的新抽认卡,则会收到错误消息 用户可以编辑现有的抽认卡 用户可以在创建屏幕中添加多项选择答案 实验1 应用说明 一个简单的抽认卡应用程序,带有正面...
    • flashrob01.github.io
      flashrob01.github.io