My First Python Project Dealing With Finance Data

Bryan Jenks · Intermediate ·📰 AI News & Updates ·6y ago

Key Takeaways

The video demonstrates a personal project using Python to retrieve and calculate investment portfolio data using the Yahoo Finance module and datetime module.

Full Transcript

what's going on everyone I am a little excited about this I've been playing around trying to learn Python and I do a lot of stuff with our but I've been wanting to learn Python for like general-purpose things and just utility like its syntax I've heard a lot of great things and after taking a little bit of a a few lessons trying out a couple minor things I did really like the syntax so I tried to actually create a project something that I actually would really use and so what I wrote was something that would get me all of the information on my current investment portfolio so for each investment I have what's the current clothes price for the last clothes price for the fund or stock what's my current share amount like how many shares do I have and then what's the total amount I have of that item in you know the monetary value and that I wanted to see what it's the entire amount of my current portfolio holdings now none of the data I'm going to show is actually what I have obviously so this is just test data of some like common stocks you know like Tesla Ford ge whatever but I wrote this using only the Yahoo Finance module and date time module I wrote a couple functions other they are kind of duplicated and I'm sure that a lot of this could be abstracted away a little bit with some better usage of Python but I got it working and it was not very difficult I just spent a couple hours just plugging away at this trying to make it work and it works and I'm quite happy with just how I got something to function and actually serve a purpose very easily with this syntax so what does it look like so you can update with a couple tuples in here of just what's your ticker symbol is a string and then the amount of shares you have let's add some decimals because why not so you can have this and then if you have any cash holdings in like a money market or something you can just update that number but this is what feeds everything is just this list of ticker and share counts and then your cash so I can save that and then let's run it so python and it'll tell you for each your stocks what is the last closed price how many shares you have and what is the total amount of value for that ticker or fund or whatever that you have and then at the bottom it'll tell you the entire total of your holdings this one actually shouldn't be displaying total oh I need to round that but yes so this is something I just caught working I am really happy with this if anyone could tell me how I could get rid of all of these completed lines that'll be really hopeful but yeah my first project in Python and I'm quite happy with it let me know what you think

Original Description

▬▬▬▬▬▬▬▬▬▬ ► CHECK THESE OUT ◀︎▬▬▬▬▬▬▬▬▬▬ 📧️ NEWSLETTER: https://bryanjenkstech.ck.page/d4ec0713d5 💬 DISCORD: https://discord.gg/MxCVshN 🗣️ SOCIALS: https://streamerlinks.com/tallguyjenks ▬▬▬▬▬▬▬▬▬▬ ► SUPPORT THE CHANNEL ◀︎▬▬▬▬▬▬▬▬▬▬ 👨🏻‍💻️ GITHUB SPONSOR: https://github.com/sponsors/tallguyjenks 🙏🏻️ AMAZON WISHLIST: https://www.amazon.com/hz/wishlist/ls/17FRLE35NC7G8?ref_=wl_share 😇 PATREON: https://www.patreon.com/bryanjenks?fan_landing=true 🙌🏻️ YOUTUBE MEMBERSHIP: https://www.youtube.com/c/BryanJenksTech/join ☕ BUY ME A COFFEE: https://www.buymeacoffee.com/tallguyjenks 💵 PAYPAL: https://www.paypal.me/tallguyjenks 📊️ FREE STOCKS: http://join.robinhood.com/bryanj67 ▬▬▬▬▬▬▬▬▬▬ ► My Newsletter ◀︎▬▬▬▬▬▬▬▬▬▬ 📧️ NEWSLETTER: https://bryanjenkstech.ck.page/d4ec0713d5 ▬▬▬▬▬▬▬▬▬▬ ► My Gear ◀︎▬▬▬▬▬▬▬▬▬▬ ⚙️GEAR: https://kit.co/tallguyjenks/my-gear ▬▬▬▬▬▬▬▬▬▬ ► Questions? ◀︎▬▬▬▬▬▬▬▬▬▬ ❓️FAQ: https://github.com/BryanJenksCommunity/FAQ/discussions ▬▬▬▬▬▬▬▬▬▬ ► Social ◀︎▬▬▬▬▬▬▬▬▬▬ 💬 DISCORD: https://discord.gg/MxCVshN 🐦 TWITTER: https://twitter.com/tallguyjenks 📺 TWITCH: https://www.twitch.tv/tallguyjenks 📜️ MEDIUM: https://medium.com/@tallguyjenks 💼️ LINKEDIN: https://www.linkedin.com/in/bryanjenks/ 🖥️ GITHUB: https://github.com/tallguyjenks 🌎 WEBSITE: https://www.bryanjenks.dev/ ▬▬▬▬▬▬▬▬▬▬ ► The Rest ◀︎▬▬▬▬▬▬▬▬▬▬ Thanks for watching and if you liked this video please leave a 👍🏻 Subscribe to my channel and click the 🔔 icon for notifications when I post a new video If you read this far put a 🐄 in the comments! ▬▬▬▬▬▬▬▬▬▬ ► TAGS ◀︎▬▬▬▬▬▬▬▬▬▬ #obsidian #zettelkasten #bryanjenks
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Bryan Jenks · Bryan Jenks · 24 of 60

1 rsync for Linux Backups - The Final Barrier to Migration
rsync for Linux Backups - The Final Barrier to Migration
Bryan Jenks
2 (un)Installing Packages From The (AUR) Arch Linux User Repository
(un)Installing Packages From The (AUR) Arch Linux User Repository
Bryan Jenks
3 Full RStudio Set Up On Arch Linux
Full RStudio Set Up On Arch Linux
Bryan Jenks
4 Fix RMarkdown Compilation Outside Of RStudio on Arch Linux
Fix RMarkdown Compilation Outside Of RStudio on Arch Linux
Bryan Jenks
5 Markdown Document Autocompilation on Arch Linux
Markdown Document Autocompilation on Arch Linux
Bryan Jenks
6 Cronjobs, Cronie, & Crontab on Arch Linux
Cronjobs, Cronie, & Crontab on Arch Linux
Bryan Jenks
7 Setting Up Slack With i3 on Arch Linux
Setting Up Slack With i3 on Arch Linux
Bryan Jenks
8 VS Codium (VS Code) on Arch Linux With A Shell Script
VS Codium (VS Code) on Arch Linux With A Shell Script
Bryan Jenks
9 Vimwiki Plugin For Vim Research Management on Arch Linux
Vimwiki Plugin For Vim Research Management on Arch Linux
Bryan Jenks
10 Neomutt with Protonmail on Arch Linux - LARBS - Thinkpad x220
Neomutt with Protonmail on Arch Linux - LARBS - Thinkpad x220
Bryan Jenks
11 Command Line Task Management With Taskwarrior and Taskell On Arch Linux / Thinkpad x220
Command Line Task Management With Taskwarrior and Taskell On Arch Linux / Thinkpad x220
Bryan Jenks
12 Exploring My Fitbit Data With R in RStudio on Arch Linux
Exploring My Fitbit Data With R in RStudio on Arch Linux
Bryan Jenks
13 Tellico Collections On Arch Linux
Tellico Collections On Arch Linux
Bryan Jenks
14 LaTeX, Biber, and Live Compilation on Arch Linux
LaTeX, Biber, and Live Compilation on Arch Linux
Bryan Jenks
15 R Markdown Programming Language Support
R Markdown Programming Language Support
Bryan Jenks
16 R Markdown to make HTML Wiki's with Tabbed pages
R Markdown to make HTML Wiki's with Tabbed pages
Bryan Jenks
17 Announcement: New Video Series on R - "Comprehensive R Package Reviews"
Announcement: New Video Series on R - "Comprehensive R Package Reviews"
Bryan Jenks
18 R Package Review Episode 1: Magrittr
R Package Review Episode 1: Magrittr
Bryan Jenks
19 R Package Review Episode 2: Vitae
R Package Review Episode 2: Vitae
Bryan Jenks
20 My R Workflow for Reproduce-able & Portable Analysis
My R Workflow for Reproduce-able & Portable Analysis
Bryan Jenks
21 R Package Review Episode 2: Here
R Package Review Episode 2: Here
Bryan Jenks
22 Introduction to Regular Expressions
Introduction to Regular Expressions
Bryan Jenks
23 My Workflow for Reading, Organizing, and Maintaining Articles, Papers, & Books
My Workflow for Reading, Organizing, and Maintaining Articles, Papers, & Books
Bryan Jenks
My First Python Project Dealing With Finance Data
My First Python Project Dealing With Finance Data
Bryan Jenks
25 R Package Review Episode 4: Beepr
R Package Review Episode 4: Beepr
Bryan Jenks
26 RMarkdown Customized Styles with CSS and HTML Output
RMarkdown Customized Styles with CSS and HTML Output
Bryan Jenks
27 RMarkdown Custom ID Selectors for Dynamic Headers and CSS
RMarkdown Custom ID Selectors for Dynamic Headers and CSS
Bryan Jenks
28 HTML Headers in RMarkdown Documents For Personal/Corporate Branding
HTML Headers in RMarkdown Documents For Personal/Corporate Branding
Bryan Jenks
29 My Semi-Complete VimWiki Workflow
My Semi-Complete VimWiki Workflow
Bryan Jenks
30 How To Make An Automated Resume With Github
How To Make An Automated Resume With Github
Bryan Jenks
31 How I Use Fuzzy Finding In the Terminal with fzf (workflow++)
How I Use Fuzzy Finding In the Terminal with fzf (workflow++)
Bryan Jenks
32 How I Organize and Create My Research Notes (Research Workflow++)
How I Organize and Create My Research Notes (Research Workflow++)
Bryan Jenks
33 How I Use fzf.vim To Improve My Programming Workflow
How I Use fzf.vim To Improve My Programming Workflow
Bryan Jenks
34 Website Updates, JavaScript, R, Shiny, Vue.js And More
Website Updates, JavaScript, R, Shiny, Vue.js And More
Bryan Jenks
35 How To Use AWK (Tutorial)
How To Use AWK (Tutorial)
Bryan Jenks
36 Bash Script Review: My Battery Power i3Blocks Module
Bash Script Review: My Battery Power i3Blocks Module
Bryan Jenks
37 Channel Updates, Where I've Been, And Where I Want To Go With YouTube
Channel Updates, Where I've Been, And Where I Want To Go With YouTube
Bryan Jenks
38 How To Use Neomutt 📨 From MuttWizard  (Basics Tutorial)
How To Use Neomutt 📨 From MuttWizard (Basics Tutorial)
Bryan Jenks
39 How To Use Jupyter Notebooks 📔 (Basics Tutorial)
How To Use Jupyter Notebooks 📔 (Basics Tutorial)
Bryan Jenks
40 How To Use Trello In 2020 (The Definitive Guide)
How To Use Trello In 2020 (The Definitive Guide)
Bryan Jenks
41 Macbook Pro 16 Inch 2020: Unboxing and Review
Macbook Pro 16 Inch 2020: Unboxing and Review
Bryan Jenks
42 How To Use Github's New Personal README and Wakatime
How To Use Github's New Personal README and Wakatime
Bryan Jenks
43 How I Set Up My 2020 Macbook Pro 16
How I Set Up My 2020 Macbook Pro 16
Bryan Jenks
44 My First Week At WGU (Western Governors University), Coffee, And Channel Updates
My First Week At WGU (Western Governors University), Coffee, And Channel Updates
Bryan Jenks
45 The Best Academic Resources & Citation Managers: OrcID, Zotero, Mendeley & More!
The Best Academic Resources & Citation Managers: OrcID, Zotero, Mendeley & More!
Bryan Jenks
46 R Package Review Episode 5: TodoR
R Package Review Episode 5: TodoR
Bryan Jenks
47 R Package Review Episode 6: Patchwork
R Package Review Episode 6: Patchwork
Bryan Jenks
48 Interview With Bryan of Norseman Leather Works
Interview With Bryan of Norseman Leather Works
Bryan Jenks
49 Zettelkasten Work in Obsidian for Research | VOD
Zettelkasten Work in Obsidian for Research | VOD
Bryan Jenks
50 How I Live With Adult ADHD (Attention Deficit Hyperactivity Disorder) [Time Stamped]
How I Live With Adult ADHD (Attention Deficit Hyperactivity Disorder) [Time Stamped]
Bryan Jenks
51 Zettelkasten Research Work in Obsidian | VOD
Zettelkasten Research Work in Obsidian | VOD
Bryan Jenks
52 Obsidian VS Roam Research: Why I Chose Obsidian
Obsidian VS Roam Research: Why I Chose Obsidian
Bryan Jenks
53 My 2020 Comprehensive Obsidian Workflow For Zettelkasten and Evergreen Notes
My 2020 Comprehensive Obsidian Workflow For Zettelkasten and Evergreen Notes
Bryan Jenks
54 How I Use Raindrop.io As The Entry Point of My Zettelkasten Workflow In Obsidian
How I Use Raindrop.io As The Entry Point of My Zettelkasten Workflow In Obsidian
Bryan Jenks
55 Comprehensive Overview | Obsidian Block References & Transclusion | Sorry Roam!
Comprehensive Overview | Obsidian Block References & Transclusion | Sorry Roam!
Bryan Jenks
56 Easy YouTube Timestamps From Final Cut Pro X With Python!
Easy YouTube Timestamps From Final Cut Pro X With Python!
Bryan Jenks
57 NEW | Obsidian Insiders Release 0.9.10 | Plugins & Official API
NEW | Obsidian Insiders Release 0.9.10 | Plugins & Official API
Bryan Jenks
58 TOP 5️⃣️ | FAVORITE THINGS IN OBSIDIAN
TOP 5️⃣️ | FAVORITE THINGS IN OBSIDIAN
Bryan Jenks
59 Comprehensive Obsidian & Git Sync Workflow 🔄️ | Your Mind Under Version Control
Comprehensive Obsidian & Git Sync Workflow 🔄️ | Your Mind Under Version Control
Bryan Jenks
60 Obsidian Mermaid Livestream Highlights | Zettelkasten Resources, YouTube Advice, Data Science
Obsidian Mermaid Livestream Highlights | Zettelkasten Resources, YouTube Advice, Data Science
Bryan Jenks

The video shows how to create a Python project to retrieve and calculate investment portfolio data, including stock prices and share amounts. The project uses the Yahoo Finance module and datetime module to fetch data and perform calculations.

Key Takeaways
  1. Import the necessary modules (Yahoo Finance and datetime)
  2. Define a function to retrieve stock prices and share amounts
  3. Create a list of tuples containing ticker symbols and share counts
  4. Update the list with cash holdings
  5. Run the script to calculate and display portfolio holdings
💡 Using Python and the Yahoo Finance module, you can easily retrieve and calculate investment portfolio data, making it a useful tool for personal finance management.

Related AI Lessons

You Are Not Behind. The World Is.
You're not behind, the world is still adapting to AI, and it's okay to take your time to learn and grow
Medium · AI
Career choice with the advent of AI - pure Computer Science or learn software with a background of core engineering area
Learn how to choose between a Computer Science and Engineering career path or combining programming with a core engineering background in the age of AI
Dev.to AI
The AI Hype Cycle: Calm Before the Next Breakthrough?
Understand the AI hype cycle to anticipate the next breakthrough and make informed decisions
Medium · Programming
AI won’t replace scientists. It will make the current model of science obsolete
AI is not replacing scientists, but rather making the current model of science obsolete, enabling new forms of discovery and collaboration
Medium · Data Science
Up next
Motorist saved by human chain | 9 News Australia
9 News Australia
Watch →