Giter Club home page Giter Club logo

robo-advisor's Introduction

robo-advisor

Setup

Repo Setup

Use the GitHub.com online interface to create a new remote project repository called something like "robo-advisor". When prompted by the GitHub.com online interface, let's get in the habit of adding a "README.md" file and a Python-flavored ".gitignore" file (and also optionally a "LICENSE") during the repo creation process. After this process is complete, you should be able to view the repo on GitHub.com at an address like https://github.com/YOUR_USERNAME/robo-advisor.

After creating the remote repo, use GitHub Desktop software or the command-line to download or "clone" it onto your computer. Choose a familiar download location like the Desktop.

After cloning the repo, navigate there from the command-line:

``cd ~/Desktop/robo-advisor

Use your text editor or the command-line to create a new sub-directory called "app" with a file called "robo_advisor.py", and then place inside some example print statements like the following:

this is the "app/robo_advisor.py" file

print("-------------------------") print("SELECTED SYMBOL: XYZ") print("-------------------------") print("REQUESTING STOCK MARKET DATA...") print("REQUEST AT: 2018-02-20 02:00pm") print("-------------------------") print("LATEST DAY: 2018-02-20") print("LATEST CLOSE: $100,000.00") print("RECENT HIGH: $101,000.00") print("RECENT LOW: $99,000.00") print("-------------------------") print("RECOMMENDATION: BUY!") print("RECOMMENDATION REASON: TODO") print("-------------------------") print("HAPPY INVESTING!") print("-------------------------") Make sure to save Python files like this whenever you're done editing them. After setting up a virtual environment, we will be ready to run this file.

Use your text editor or the command-line to create a new file called "requirements.txt" in the root directory of your repository, and then place inside the following contents:

this is the "requirements.txt" file

it might be helpful to use pandas. if you do, uncomment the last line below ...

requests python-dotenv

pandas

After setting up a virtual environment, we will be ready to install these packages.

Environment Setup

Create and activate a new Anaconda virtual environment:

conda create -n stocks-env python=3.8 # (first time only) conda activate stocks-env From within the virtual environment, install the required packages specified in the "requirements.txt" file you created:

pip install -r requirements.txt From within the virtual environment, demonstrate your ability to run the Python script from the command-line:

``python app/robo_advisor.py Basic Requirements

Repository Requirements

Your project repository should contain an "app" directory with a "robo_advisor.py" file inside (i.e. "app/robo_advisor.py").

Your project repository should contain a "README.md" file. The README file should provide instructions to help someone else install, setup, and run your program. This includes instructions for installing package dependencies, for example using Pip. It also includes instructions for setting an environment variable named ALPHAVANTAGE_API_KEY (see "Security Requirements" section below).

Your project repository should contain a file called ".gitignore" which prevents the ".env" file and its secret credentials from being tracked in version control. The ".gitignore" file generated during the GitHub repo creation process should already do this, otherwise you can create your own ".gitignore" file and place inside the following contents:

this is the ".gitignore" file

ignore secret environment variable values in the ".env" file:

.env Finally, your project repository should contain a "data" directory with another ".gitignore" file inside. In the "data/.gitignore", place inside the following contents to track the empty directory (thus allowing CSV files to be written there without error), while ignoring the CSV files themselves:

this is the "data/.gitignore" file

ignore all files in this "data" directory:

except this ".gitignore" file:

!.gitignore Security Requirements

Your program will need an API Key to issue requests to the AlphaVantage API. But the program's source code should absolutely not include the secret API Key value. Instead, you should set an environment variable called ALPHAVANTAGE_API_KEY, and your program should read the API Key from this environment variable at run-time.

You are encouraged to use a "dotenv" approach to setting project-specific environment variables by using a file called ".env" in conjunction with the dotenv package. Example ".env" contents:

this is the ".env" file

ALPHAVANTAGE_API_KEY="abc123"

The ".env" file should absolutely not be tracked in version control or included in your GitHub repository. Use a local ".gitignore" file for this purpose.

robo-advisor's People

Contributors

klj9236 avatar

Stargazers

Michael Rossetti 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.