FMP

FMP

Enter

Financial Modelling Prep provides a free stock API, financial statement API, and lots more valuable financial data. Before you can start taking advantage of our

How to create your own Python environment

Sep 30, 2022 2:20 AM - Jack Dalton

twitterlinkedinfacebook
blog post cover photo

Image credit: ThisisEngineering RAEng

Financial Modelling Prep provides a free stock API, financial statement API, and lots more valuable financial data. Before you can start taking advantage of our service you must first set up the environment where you are going to write your code. In this guide, we will explain exactly how to do this:

  1. Download and Install Anaconda
  2. Launch Jupyter Lab and Create Your Folders
  3. Launch a Notebook and Start Coding!

Step 1: Download and install Anaconda

Anaconda is one of the leading python and data science platforms. It enables you to be able to have your own Jupyter Notebook style environment to write your code and run your analysis. The Jupyter Notebook environment is great for beginners to intermediate coders because it allows you to run individual blocks of code and get their specific outputs. Everything in one notebook will be connected so it makes it much easier to debug your code and figure out the exact location of any errors. Anaconda enables you to create your own Juptyer Notebook environment that will store your files locally on your PC or Mac. Here are the instructions from Anaconda on how to install it on your Mac or Windows PC:

Windows Install Guide:

    1. Download the Anaconda installer
    2. RECOMMENDED: Verify data integrity with SHA-256. For more information on hashes, see What about cryptographic hash verification?
    3. Double click the installer to launch.
    4. Click Next.
    5. Read the licensing terms and click “I Agree”.
    6. Select an install for “Just Me” unless you're installing for all users (which requires Windows Administrator privileges) and click Next.
    7. Select a destination folder to install Anaconda and click the Next button. See FAQ

install

    1. Choose whether to add Anaconda to your PATH environment variable. We recommend not adding Anaconda to the PATH environment variable, since this can interfere with other software. Instead, use Anaconda software by opening Anaconda Navigator or the Anaconda Prompt from the Start Menu.

install

macOS Install Guide:

    1. Download the graphical macOS installer for your version of Python.
    2. RECOMMENDED: Verify data integrity with SHA-256. For more information on hashes, see What about cryptographic hash verification?
    3. Double-click the downloaded file and click continue to start the installation.
    4. Answer the prompts on the Introduction, Read Me, and License screens.
    5. Click the Install button to install Anaconda in your ~/opt directory (recommended):

install

    1. OR, click the Change Install Location button to install in another location (not recommended). On the Destination Select screen, select Install for me only.
    2. Click the continue button
    3. A successful installation displays the following screen:

install

Step 2: Launch Jupyter Lab and Create Your Folders

Now that you've installed Anaconda, it is time to launch JupyterLab and start making your environment your own. First you will need to open the Anaconda Navigator. Don't be scared by the seemingly scary command centre code it runs when you open it - this is normal and won't harm your computer. Once you've launched Anaconda Navigator you'll be asked to make an account which is not necessary to get started so we recommend you ignore this. You should get to a screen like this:

install

Click the Launch Button underneath JupyterLab which is highlighted above. This will take you to a new tab on your preferred browser and will look something like this:

install

Once successfully launched, you'll want to create a new folder and name whatever makes the most sense to you (We called ours FMP because we're biased!). Below you'll see that the new folder button is highlighted:

install

After you've created the main folder that you'll store all your work, spend some time thinking about how to organize your subfolders. We recommend creating a new folder for each project you take on and putting all your work for that project in that folder. This will likely be multiple Jupyter notebooks and other files such as CSVs. Below is an example of the folder structure we have used:

install

Step 3: Launch a Notebook and Start Coding!

So now your environment is all set up, it is time to start writing some code and performing analysis using Python. To start, perhaps create a folder called “Learning” or something similar to store all of your notebooks used to get started and learn new skills. To open the folder, simply double click it. To navigate back press the name of the main folder. To open your first notebook click the tile beneath the Notebook header that says “Python 3” and a new notebook will open!

install

By default, this notebook will be untitled. To rename the notebook either right-click the file in the left-hand side or at the top of the tab and then select rename. These two are highlighted below:

install

To make sure Jupyter is working properly always run a simple test bit of code and make sure the output works well. For example, try typing the following into the first cell:

x = 7 * 5

x

Then hit enter.

You should of course get an output of 35

install

If you want to create a new notebook, click the + icon in the top left corner of Jupyter and it will bring up a new launcher where you can follow the steps above to begin a new notebook.

Rounding Up

So that's how you can get your Python coding environment set up and start coding. First, download and install Anaconda. Then, launch JupyterLabs and create your folder structure. Finally, launch your first notebook and test it works before beginning your coding adventure!

Other Blogs

Sep 11, 2023 1:38 PM - Rajnish Katharotiya

P/E Ratios Using Normalized Earnings

Price to Earnings is one of the key metrics use to value companies using multiples. The P/E ratio and other multiples are relative valuation metrics and they cannot be looked at in isolation. One of the problems with the P/E metric is the fact that if we are in the peak of a business cycle, earni...

blog post title

Sep 11, 2023 1:49 PM - Rajnish Katharotiya

What is Price To Earnings Ratio and How to Calculate it using Python

Price-to-Earnings ratio is a relative valuation tool. It is used by investors to find great companies at low prices. In this post, we will build a Python script to calculate Price Earnings Ratio for comparable companies. Photo by Skitterphoto on Pexels Price Earnings Ratio and Comparable Compa...

blog post title

Oct 17, 2023 3:09 PM - Davit Kirakosyan

VMware Stock Drops 12% as China May Hold Up the Broadcom Acquisition

Shares of VMware (NYSE:VMW) witnessed a sharp drop of 12% intra-day today due to rising concerns about China's review of the company's significant sale deal to Broadcom. Consequently, Broadcom's shares also saw a dip of around 4%. Even though there aren’t any apparent problems with the proposed solu...

blog post title
FMP

FMP

Financial Modeling Prep API provides real time stock price, company financial statements, major index prices, stock historical data, forex real time rate and cryptocurrencies. Financial Modeling Prep stock price API is in real time, the company reports can be found in quarter or annual format, and goes back 30 years in history.
twitterlinkedinfacebookinstagram
2017-2024 © Financial Modeling Prep