Have you ever struggled when running your Python Scripts locally? Very general, isn’t it? Let me enumerate some struggling examples below:

  • Local Storage
  • Network Availability
  • PC always turned on

As I’ve been working with a Python Project that requires frequent execution, the examples above are the main ones that encouraged me to look for how to run away from handling it locally.

And why’s that? Because I’m not always logged in my computer and, even so, I didn’t want to keep executing my Python Script every 15 minutes (or any other frequency).

This scenario led me to define the following Project Structure:

Project Design

Project Design — By the Author

In order to achieve so, I invite you to check the following sessions, in which I covered the step-by-step and the main information regarding each of these Project elements:

  • Google Sheets (1) and API (2)
  • Google Cloud Platform (3) and Linux VM (4)

PS: I grouped the different elements as above because I think it gets easier to follow up the flow. The first group shows you what is our goal and anticipates us the API enablement. The latter group covers the actions needed on Google Platform and, then, move forward with the Linux VM itself (including the Python Script).


1. Google Sheets

As just mentioned, let’s take a look at what is this Python Project. The goal is to update every 15 minutes the current price of each owned Stock (from the Brazilian market).

The initial data is available on Google Sheets (Local Storage is no longer a problem), as the session’s title suggests. Below, you can see the data being considered in this Project:

Image for post

Google Sheets’ Original Data

#google-cloud-platform #linux #investment #python #cloud-computing

This Virtual Machine is saving my time
1.05 GEEK