Git Product home page Git Product logo

stock-viewer's Introduction

Stock-Viewer

Installation

pip install sqlite3
pip install alpaca-trade-api
pip install fastapi uvicorn
pip install jinja2
pip install python-multipart

Get API keys

To run populate_stocks.py and populate_prices.py successfully, you would need an API key and secret key inside const.py file. The step-by-step guide is as follows:

  1. Create an account on https://app.alpaca.markets/signup if you don't have an account already.
  2. After logging in to the account, click on 'Generate Key' to get an API key and the secret key.
  3. Make a const.py file
  4. Store the following inside the file
import os
API_KEY = 'Your API key'
SECRET_KEY = 'Your Secret key'
DATABASE_PATH = os.path.abspath("app.db")
BASE_URL = 'https://paper-api.alpaca.markets'

How to run

  1. Create the stock and prices table by running the following command
python3 create_db.py
  1. Store the stock data inside the database
python3 populate_stocks.py
  1. Store the prices of the stocks in database
python3 populate_prices.py
  1. After storing the stocks and their prices, run
uvicorn main:app --reload
  1. You can start viewing the stocks on your localhost:8000 now

stock-viewer's People

Contributors

taha59 avatar

Stargazers

Laiba Razi Khan avatar

Watchers

 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.