Stocks Profits Tracker (+ Notion API Integration with Python)

You will get a 🔗 Notion Template Link

➚ Get it now

Share:

Nov 26, 2023 669 Words

Read Time: 4 Minutes

Notion Stocks Profits Tracker
You can track live US stock prices in your personal notion dashboard and a single python script.
➚ Get it now

What will I get?

📊 A Notion Template to maintain a personal portfolio of US stocks investments

🤯 A mechanism for live price tracking & profits calculation

📖 Python script to update the live prices & step-by-step setup guide to get it all working

😃 Easy to use


Integration Guide

1. Duplicating Template:

Once, you purchase the notion template, you’ll be given a notion template link. Click on the Duplicate button in the top right of the notion page.

Duplicating Template

ℹ️ Ignore if you’ve already completed this step. Notion may ask you to login into your notion account to successfully duplicate.

2. Creating Notion Integration:

What is a Notion Integration?

A notion integration allows a user to run automations using tools like programming languages like Python, Javascript, etc.

🤔 You don’t have to worry too much about this if you’re confused, this is just a simple explanation that will help you get a general idea.


Follow these steps to create a notion integration:

  1. Click on this link → https://notion.so/my-integrations/ (once you open this link in your browser, the website may ask you to login to your notion account)
  2. You’ll be presented with this webpage, click on + New Integration button (big black button)

Creating Notion Integration

  1. You’ll then be presented with a form to fill in the Basic Information: , you can set the below values:

    1. Type → Internal
    2. Associated Workspace → Choose your notion account’s workspace
    3. Name → Stocks Profits Tracker
    4. Logo → No need, ignore this

    Finally, Click on the Submit → (black button)

  2. You’ll next be presented with a webpage called Secrets , you will have to click show and copy the notion integration secret token and keep it safely aside

Copy & Paste the above 🔑 Notion Integration Secret Key somewhere 🔒 safe because it will be used in the 🐍 python script.

3. Connect Notion Integration to Template:

  1. Click on the three dots ... in the top right corner of the duplicate notion template

  2. Click on + Add Connections at the end of the the drop down, search for and click the notion integration you’ve created in step 2 ( Stock Profits Tracker)

    Connecting notion integration

4. Populating Stock Prices in ‘Stock Profit Tracker’ Database:

You can add the following values for every stock symbol(tick) you want to add:

  1. Name → Stock Symbol (like MSFT)
  2. Amount Invested → Add the amount you bought the stock units with
  3. Price/Unit → This value will be updated by the Notion Integration (add a default 0.1 so that the python script can update it)
  4. Number of units bought → Add the number of stock units you bought

Leave the Status & Net Profit because when the Price/Unit gets updated by automation, these values will change automatically.

💡 The default notion database contains a few stock market symbols like MSFT, NFLX, TSLA, AAPL, HOOD, etc. (use them as example while adding new stock units)

🚨 Don’t change the column names or database name in the Stocks Profits Tracker database, doing so will make it impossible to update the columns using the python script.

5. Running Python Script:

The final part of the integration is about running a python script that will update the real stock prices for all the stock units you have in the database.


  1. Clone this GitHub repositoryhttps://github.com/tnvmadhav/notion-stocks-integration

  2. Save the secret notion integration token in the my_variables.yml file

    MY_NOTION_SECRET_TOKEN: paste-your-notion-integration-token-here
    
  3. Install the python requirements and dependency libraries by running the command in your terminal

    python3 -m pip3 install -r requirements.txt
    
  4. Finally run this command in your terminal to start the live Price/Unit update process

    python3 main.py
    

That’s it!

If all the steps are followed properly, your notion database should be getting live stock price and net profit updates when python server is running on your machine.

🚨 If something isn’t working or if you’re confused, contact me on Twitter/X DM and I’ll help you out 🙂

What Will I Get?


🔗 A Notion Template Link
  1. Duplicable
  2. Life Time Access
  3. Personal License

Find more posts from following topics

1
12
13
14
15
16
17
18
19
2
20
2024
21
22
23
24
26
27
28
29
3
30
4
5
6
@binding
abbacchio
accurate-requests
anime
api-development
api-testing
api-testing-tools
array
automated-testing
bad-habits
base64-decoder
base64-encoder
biography
blog
blogging
books
browser
bulma-css
bulma.io
bulmacss
button-swiftui
chatgpt
chrome
clipboard
code
code-block
code-navigation
code-snippet
codecoverage
comparison
compile
computer-networks
configuring-debugger-for-django-in-vs-code
configuring-launch.json-for-python-debugger
copy
copy-to-clipboard
copy-to-clipboard-neovim
css
current-date
current-time
current-timestamp
database
debugger-setup-in-visual-studio-code
debugging-django-app-in-visual-studio-code
debugging-python-code-in-visual-studio-code
debugging-python-programs-with-visual-studio-code
debugging-python-with-virtual-environment-in-vs-code
developer-productivity
developers
development-workflow
django
django-rest-framework
dom
dynamic-sitemap-in-nextjs
encryption
engineering-dashboard
enumerate
experience
fiction
flowcharts
generics
git
git-diff
github
global-keyboard-shorcut
global-shortcut
go-hugo
go-programming
go-test
go-to-line
go-tool
go1.18
golang
golang-development
golden-wind
good-habits
gorilla-websocket
gpt
gpt-3.5
gpt-4
gpt-4-api
guide
gumroad
habits
habits-tracker-notion-template
hamburger-menu
hotkeys
html
hugo
ide
image
image-sharing
image-tool-for-ios
imagerenderer
include-timestamp
integrated-development-environment
ios
ios-16
ios16
iphone
iphone-13
iphone-13-pro
iphone-13-pro-max
javascript
jojos-bizzarre-adventure
jump-to-definition
keyboard-shortcut
leonardo-da-vinci
lessons
linux
logging
ls
lsp
macos
map
markdown
markdown-code
mental-programming
menu
menubarextra
mergesort
mermaid-syntax
mistake-tracker-notion
mobile-view
modifier
modulo-operation
navbar
navigationlink
navigationstack
neovim
nested-functions
next.js
nextjs
nextjs-markdown
nextjs-sitemap
nextjs-sitemaps
nice-shot
nice-shot-pro
notion
notion-api
notion-api-python
notion-budget
notion-budget-template
notion-budget-tracker
notion-bug-report-tracker
notion-dashboard
notion-expense-manager
notion-habits
notion-habits-dashboard
notion-habits-template
notion-habits-tracker
notion-habits-tracker-template
notion-issue-tracker
notion-mistake-tracker
notion-product
notion-product-dashboard
notion-product-roadmap
notion-product-roadmap-dashboard
notion-tasks
notion-tasks-dashboard
notion-tasks-template
notion-tasks-tracker
notion-template
notionworkspaces
november
october
openai
osx
pagination
personal-ifttt-framework
photospicker
photospickeritem
phpickerfilter
postgres
postman-capabilities
postman-request
pre-request-script
product-roadmap-notion-template
product-roadmap-template
productivity
programming
python
python-api
python-debugger-tutorial-for-vs-code
python-debugging-mode-in-vs-code
python-notion-api
python3
reading
real-time-communication
rehype
remark
request-data
running-debugger-in-visual-studio-code
running-django-app-in-debugging-mode
running-program-in-debugging-mode-in-vs-code
running-python-code-in-debugging-mode
safari
screenshot-app-for-ios
screenshot-app-ios
screenshot-ios
screenshot-tool-for-ios
september
set-current-timestamp
setting-up-debugger-in-vs-code-for-python
share-extension
sharelink
sharepreview
sharesheet
simple-websocket-server
sitemap
slice
slices
slider
sort
sorting
space-complexity
sql
ssh
step-by-step-guide
stocks-profits-tracker
stocks-profits-tracker-template
stocks-tracker
struct
sustained-vigilance
swift
swiftui
swiftui-button
swiftui-button-action
swiftui-button-style
table-of-contents
tasks-tracker-notion-template
tcp
test
testing
textfield-swiftui
til
tim-sort
time-complexity
timeliness
timestamp-integration
timsort
transferable
triggers-and-actions
tutorial
unittest
unix
us-stocks
usa-stocks
useful-ios-features
using-breakpoints-in-python-debugger
using-virtual-environment-with-python-debugger
vanilla-javascript
variable
vim
visual-mode
visual-studio-code
vs-code
vscode
vscode-go-to-line
walter-isaacson
web-sockets-in-go
websocket-client
websocket-programming
websocket-server
white-screen-of-death
wsod
xcode
xss