
Develop full stack Python web apps backed by Google Sheets by building a Python API layer, integrating the Google Sheets API, and evolving a JavaScript UI with React and Next.js.
Explore my other work and discover Udemy courses on web scraping, GraphQL, and functional programming with Python, plus databases and JSON identity, all at Handbag.com with year-round discounts.
Explore the Google Sheets http api basics by setting up a Google account, configuring authentication with a service account, enabling apis, and testing requests to read, insert, and create data.
Set up a Google Cloud project, enable the Sheets and Drive APIs, and create a service account key to access the Google Sheets API from Python.
Master Python project hygiene by creating and activating a virtual environment to isolate dependencies, ensure reproducible setups, and manage Google APIs integration with google-auth, google-auth-httplib2, and google-api-python-client.
Set up the sheets service in python by loading credentials.json from a service account and building a Google Sheets API client with spreadsheets and drive scopes.
Learn how to insert a value into an existing Google Sheets using Python and the Sheets API, including manual worksheet creation and URL-based id extraction.
Programmatically create, append, and retrieve data in Google Sheets via the Sheets service, with value options; understand service accounts owning sheets and how to grant access.
Use the Drive API to create a writer permission on a spreadsheet, granting access to an email address and enabling two-way access between the service account and the web view.
Explore the Google Sheets API by building a Python app that authenticates with credentials, creates and edits worksheets, and manages permissions, guided by the discovery document and API documentation.
Set up a fresh Python directory, create and activate a new virtual environment, then install FastAPI, Uvicorn, the Google API client, and auth libraries for the rest api.
Scaffold the api by creating app/main.py as the fast api entry point, define a root get route returning a json message, and run with uvicorn auto-reload.
Define a Google Sheets service class that encapsulates reading, writing, updating, and managing worksheets and workbooks behind a simple interface, instantiated with credentials to build Google Sheets and Drive services.
Explore how to authenticate a Google Sheets service using a service account and credentials.json, load the credentials, and instantiate the service via dependency injection.
Learn how to inject a credentialed Google Sheets service into a FastAPI app using the depends function, wiring a dependency to the /test route and annotating it for better intellisense.
Define a create sheet method on the Google Sheets service, build a request with spreadsheet name and title, and return the new sheet's ID and share link.
Grant writer permissions to a Google Sheets resource in a Python full-stack app, either to a specific user or anyone, via the drive service and error handling.
Explore pydantic models to define and validate the shapes of request and response data in a fast api app, wiring a create sheet model into routes and defaults.
Discover how FastAPI automatically generates interactive OpenAPI documentation, test endpoints in the browser, and validate request bodies with Pydantic models, fostering debugging and rapid API development.
Organize your FastAPI app by creating a dedicated API router for spreadsheet operations and integrating it into the main app to stay modular as it grows.
Add a rename spreadsheet operation to the Google Sheets API by implementing a batch update that changes spreadsheet properties, wiring a route, and handling errors.
Add a route handler to rename a spreadsheet via the API router, requiring a spreadsheet id path parameter and a new name, injecting the sheet service, and returning the result.
Add a delete spreadsheet method to the Google Sheets service, expose it via an HTTP delete route in the API router, and call Drive API files.delete with the spreadsheet id.
Centralize exception handling for Google Sheets-backed app by introducing a decorator that wraps route handlers, using a higher-order function to handle exceptions and refactor repetitive try-except blocks.
Define a new worksheets API router, implement a get worksheet names method, and extract sheet titles from a spreadsheet's metadata to expose all sheet names.
Enable clients to reference worksheets by name by implementing a get worksheet by name method in the Google Sheets service and wiring it to a route handler.
Rename a worksheet by resolving it from the spreadsheet id and worksheet name, then batch update its title to the new name.
Define a read worksheet method to fetch all data from a google sheets range A1:Z, convert headers from the first row, and return a list of dictionaries.
Implement writing data to a worksheet by reshaping a list of dictionaries into headers and rows, then updating the sheet via Google Sheets API with range and user entered values.
Learn to handle rows with asymmetric dimensions in Google Sheets by extracting headers from all rows, preserving discovery order, and updating the service to insert missing values without changing routes.
Learn to append records to a Google Sheets worksheet, using the used range, while automatically adding new columns for new headers and handling gaps.
Refactor the append operation to detect new columns from all records, add missing headers, and safely append rows with multiple dimensions, preventing overwrites and supporting new dimensions.
Implement an auto incrementing id when appending records to a google sheets worksheet by reading existing data to find the max id and use the next value.
Add a new worksheet to a spreadsheet via a batch update add sheet request. Set the title from user input and return the new sheet's title, id, and spreadsheet id.
Learn to clear all content in a specific Google Sheets worksheet using the values.clear method, targeting a spreadsheet id and worksheet name, via a put request and Swagger validation.
Learn to delete a worksheet by deriving its sheet id from the name and issuing a batch update delete sheet request in Google Sheets.
Introduce environment variables to securely manage sensitive data in your full stack Python app, loading from a .env with python-dot-env and os.getenv.
Use Jose to create expiring jwt access tokens with a username and an expiration delta, signed by a secret key using sha-256, and load config from env.
Define a token data model and implement a /token endpoint with an OAuth 2.0 password flow to authenticate users, generate a JWT access token, and return bearer token details.
Uninstall the older jose JWT library and switch to python-jose. Install python-multipart 0.0.9 to support form data in FastAPI, then proceed to integrate the new API router.
Wire up the authentication router in a fastapi app, implement a username/password login flow, generate and verify JWTs, and use bearer tokens to secure subsequent operations.
Define a token-based authentication dependency in FastAPI using OAuth2 password bearer to validate and decode JWTs, protect endpoints, and raise unauthorized errors when credentials fail.
Inject the authentication dependency into protected spreadsheet routes with a current user parameter to trigger token validation via the oauth2 password bearer workflow and enforce 401 if invalid.
Finish the api docs by setting a new title, version, and root path, and remove the default schemas while organizing endpoints with open api tags for authentication, spreadsheets, and worksheets.
Explain how to relax cross-origin resource sharing (CORS) policy in a FastAPI app by using CORS middleware, handling preflight options, and configuring origins, methods, headers, and credentials.
Master a six-step deployment checklist to publish your Python API. Freeze dependencies with pip freeze, configure Vercel, and push to git before deployment.
Lock dependencies and configure deployment by freezing installed packages to requirements.txt, and create a virtual.json with vercel python runtime, routing all paths to main.py for reproducible fastapi app deployment.
Initiate a local git repository, create and populate a .gitignore to exclude pycache, environments, and editor artifacts, then stage, commit, and prepare to push to GitHub.
Relocate the app entry point to the repository root, then create a private GitHub repository and push the local project, ensuring the remote origin and branch are correctly set.
Deploy your Google Sheets backed Python API to the world wide web using Vercel; configure environment variables, deploy from GitHub, and verify endpoints after hosting.
Explore how Google Sheets serves as a database, how a Python API exposes it, and how a Next.js front-end lets multiple clients interact with a single API.
Explore the core web stack from HTML, CSS, and JavaScript to React and Node, then build fast, server-side rendered apps with Next.js and deploy to Vercel.
Set up a new Next.js project using npx create next app, with tailwind CSS, on your local machine, using AMP, version 14.1.3, and explore the source app directory.
Run npm dev start to launch the development server, view the Next.js app at localhost:3000, and experience live changes with hot module reload as you edit pages.
Create a login form component in a Next.js app using React and JSX, manage username and password with useState, and prepare client-side rendering for handling login submission.
Build a login form with username and password inputs, a header, and a login button. Convert inputs into a controlled component and print updated state to console.
Discover styling a login form with Tailwind CSS, applying className in JSX, centering the form with flexbox, and applying utility classes for inputs and a hover, focus button.
Learn how to obtain a JWT from the backend by wiring a login form to post to the /token endpoint, handle responses, and display the access token.
Enhance login interactivity by introducing a loading state and error messaging, disabling the button during requests, and providing clear user feedback.
Refactor the login form to use a next public api base url environment variable, exporting apiBaseUrl from a constants module and importing it for use.
Discover why Next.js variables are server side by default, and how prefixing names with next public makes them accessible on the client in browser components.
Learn to render a dashboard on successful login by lifting the token to the home page scope, using useState, Next.js client components, and conditional rendering.
Define a handle login that updates the token using the local setter and pass it as on login to the login form; on a valid access token, render the dashboard.
Create a new Google Sheets workbook to back the online store. Define an inventory worksheet with id, name, price, and image url, and connect via environment variables and the API.
Seed inventory data from a Google worksheet with starter items, expose a Python API endpoint that returns json, and load those items into the front-end dashboard with JavaScript.
Fetches inventory data via the fetch API in a React dashboard using useEffect and useState, with a bearer token and dynamic API URL, plus loading and error handling.
Render the API-driven products by storing them in state and conditionally displaying a responsive tailwind grid of product cards that show each product’s name and description.
Style the products grid into cards with borders, shadows, and rounded corners. Render full-width images, bold titles, and prices, and add a hover-enabled add-to-cart button.
Refactor the dashboard by extracting a product card component that renders each product from a mapped array, exporting it for reuse, with product as a prop and a unique key.
Connect add to cart button to a stateful cart using useState, update with setCart from the previous state, and wire on add to cart to product card.
Build a header with a view cart button and begin integrating basic cart interactions, including displaying cart length and styling with Tailwind CSS, as groundwork for a full cart experience.
Open and close the cart in a full-stack Python app backed by Google Sheets by managing a state variable and rendering a cart with an overlay and onclose to dismiss.
Position a right-aligned full-height cart container with a white background and large shadow, using Tailwind CSS to enable vertical scrolling for cart items, while the gray inset dims the rest.
Receive the cart as a prop from the dashboard and render its items in a right-side container, showing name and price, with an empty cart message when zero.
Define a remove-from-cart function that takes a product id, updates the cart state by filtering the previous state to exclude that id, and expose it to the cart card interface.
Fixes a cart bug by assigning a unique cart item id to each item, incrementing the id on each add, and using it for removal instead of the product id.
Calculate the cart total using a reducer to accumulate item prices, safely access missing prices, round to two decimals, and update the display as the cart changes.
Introduce a checkout button for the cart, show the total amount, and wire a placeholder checkout action toward creating orders on a Google Sheets worksheet.
Create an orders worksheet in Google Sheets, define data fields (order, date, time, description, price), and set up environment variables and API scaffolding to append records from front end.
Handle checkout from the UI connects the cart to a dynamic fetch post that appends orders to the orders worksheet via the API, using swagger testing and a token prop.
Generate a short, unique order id on the fly with short-uuid, replacing the placeholder, and freeze the UI during processing by disabling the checkout button.
Disable checkout during processing or when cart is empty, update button text with a ternary, and on success reset the cart, close it, and log order details in Google Sheets.
Store the auth token in the browser's local storage to persist user sessions across refreshes, load it with useEffect on page load, and implement a logout to clear it.
Deploy the application by creating a private GitHub repository, committing and pushing changes, then importing the project to Vercel and configuring four environment variables before deploying to the web.
Deploy and test a full stack Python app backed by Google Sheets on Vercel, verify deployed URL and login, update prices, and complete checkout with orders saved in the backend.
Explore the instructor's other Udemy courses on Handbag.com, featuring discounts and topics like web scraping, GraphQL, and functional programming with Python, databases, and JSON identity.
Identify Python data types, including integers, floats, booleans, strings, tuples, lists, sets, dictionaries, and the none type. Use the built-in type function to inspect an object's type.
Explore how variables act as memory pointers that hold values, and how descriptive, case-sensitive names and snake_case improve readability. Learn about reserved keywords and single or multiple value assignments.
Master arithmetic and augmented assignment operators in Python, including addition, subtraction, multiplication, division, exponentiation, and modulo, plus counter increments and operator precedence (Pemdas) illustrated.
Explore integers and floats in Python, learn how division yields floats, convert between int and float with constructors, and understand binary representation and precision pitfalls.
Explore booleans in Python, including True and False, the bool type, and how comparison and logical operators build truthy conditions for programming logic.
Learn how strings work in Python: define with single or double quotes, escape or alternate quotes, create multi-line strings with triple quotes, and perform concatenation and repetition.
Explore how methods differ from functions, focusing on string methods like upper, lower, isalpha, startswith, endswith, and the format method for value substitution and keyword arguments.
Explore Python lists as ordered data structures, learn zero-based and negative indexing, and master slicing concepts and index errors for reliable list handling.
Compare lists and strings as ordered sequences and learn to access elements with indexing and slicing. See that lists are mutable while strings are immutable.
Explore Python list methods and built-in functions, including max, mean, len, and sorted, with append, pop, remove, and join examples that convert lists to strings.
Understand tuples, an immutable, ordered container in Python that mirrors lists but cannot be changed; learn zero-based indexing and when to pair related values, like coordinates.
Explore how sets in Python store unique values with curly braces and how to add or discard elements. Learn union, intersection, difference, convert lists to sets to remove duplicates.
Explore dictionaries in Python, a mutable key-value container. Learn to access values with brackets or get, handle missing keys with None, and add or remove entries using assignment and pop.
Explore dictionary keys and values, including nesting and different value types. Know that keys must be immutable, with tuples as examples, and use methods like keys, values, and items.
Learn how Python uses in and not in to test membership across dictionaries, lists, sets, and strings, returning booleans for keys, items, and characters.
Master controlling the flow of Python programs with if, else, and elif statements, evaluating boolean conditions, using comparisons, and maintaining indentation to define blocks and scope.
Discover how Python evaluates truth values for non-booleans, using 72 as truthy and 0.0 as falsy, and that None and empty tuples, lists, sets, and dictionaries are falsy.
Explore for loops in Python to iterate over iterables, execute a code block for each item, and print greetings or characters from strings, lists, and more.
Learn how the range() immutable sequence defines numbers with start, stop, and step, where stop is exclusive, and how single-argument range uses zero as start for for loops.
Explore how Python while loops run until a condition is met, contrasting with for loops, and see a game cost example that updates balance and next round cost.
Explore break and continue in Python loops, illustrating how break exits a loop when encountering stop and how continue skips certain iterations, with for loops, while loops, and one-line equivalents.
Zip combines two lists into a single iterable of tuples that pair names with scores. Unpack these tuples to print results and extend zip to more iterables like attendance.
Master Python list comprehensions to replace for loops, build and filter lists, apply transformations like squaring numbers, and extract student names with scores above 90.
Define reusable Python functions to compute averages, a did pass check, and enrich student records by adding average scores and a passed flag via a for loop.
Master positional versus keyword arguments by defining a reverse name function, noting that positional relies on order for first and last, while keyword allows flexible order and avoids syntax errors.
Explore lambda functions in Python, learn anonymous inline functions, and use map for one-liner transformations in a functional style.
Explore modules in Python, including the standard library, and learn to import and alias functions like mean from statistics, comparing built-in and custom implementations.
Welcome to the best resource online for learning full-stack Python web development with Google Sheets.
This course offers a truly unique learning experience on Udemy. While there are hundreds of online Python courses to choose from, very few get you building real-world applications that have actual utility from the ground up.
By the end of this course you will have deployed a universal Python web API that could connect to a virtually infinite number of workbooks. Functionally, this will be quite similar to several SaaS (software-as-a-service) businesses that you find on the web, services like SheetDB, SteinHQ, SheetBest, Sheety that offer JSON APIs on top of Google Sheets - obviously for $/month.
In this course, you will develop a Python application that does just that! Except we will write every line of code together and in the end deploy the application to the web for free!
We are going to do this step-by-step, starting with the very basics of setting up service accounts to enable the sheets and drive APIs, then moving on to the implementation of operations like creating and managing worksheets, reading, writing, and appending data, automating common tasks, managing updates, protecting our routes with authentication, and a lot more.
The course features four in-depth sections that guide you from the basics of python all the way to creating and deploying fully functional modern APIs and user interfaces.
In the first section you will:
Uncover the power of Google Sheets as a flexible, cloud-based database alternative
Understand the details of authentication using service accounts
Set up a professional development environment with virtual environments
Learn to programmatically create, read, update, and delete Google Sheets through Python
Explore the secret weapon of API developers: the Discovery Document
Then, we'll dive head-first into Python to:
Craft a robust API using FastAPI, the most modern and lightweight Python web framework
Design elegant object-oriented abstractions for Google Sheets interactions
Implement industry-standard authentication with JSON Web Tokens (JWT)
Master advanced data handling techniques for asymmetric and dynamic data
Build a full CRUD (Create, Read, Update, Delete) API for Google Sheets
Dive deep into error handling and security best practices
Learn deployment strategies to take your API from local to global
Finally, we'll switch gears to user interface (UI) design and development. You will:
Jumpstart your journey into the world of React and Next.js
Design highly responsive, modern UIs with Tailwind CSS
Implement authentication flows
Design an e-commerce storefront from scratch
Master state management for complex user interactions
Deploy your user interface to the web
And if you're new to python, don't worry! There is a full-length python primer included in the course that will get you up to speed in no time. This is included as an appendix to the course and covers all the basics of Python programming. It is designed to be a quick reference for those who are new to Python or need a refresher on the basics.
By the end of this course, you will have:
Built a production-ready universal API that interfaces with Google Sheets
Mastered the full stack: from the backend to the middleware API to the user interface
Gained real-world experience in Python, FastAPI, React, and Next.js
Developed and deployed a portfolio-worthy project to showcase your new skills
I'm excited to have you on board. Let's get started!