---
title: "Python data loading with Supabase"
description: "Supabase's community-built Python SDK can load sample data into a Postgres-backed Supabase project with a few lines of code."
url: "https://swe.quest/articles/python-data-loading-with-supabase-5a7fb214b4f4abda"
canonical: "https://supabase.com/blog/loading-data-supabase-python"
source: "Supabase"
published: "2022-06-17"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["python","postgres","databases"]
---

# Python data loading with Supabase

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2022-06-17, 4 min read, How-to. Original: [https://supabase.com/blog/loading-data-supabase-python](https://supabase.com/blog/loading-data-supabase-python)

## Summary

Supabase's community-built Python SDK can load sample data into a Postgres-backed Supabase project with a few lines of code. The walkthrough creates Vendor and Product tables linked by a foreign key in the dashboard Table Editor, installs the SDK with pip, and stores the project URL and API keys in environment variables. A script then uses Faker and faker-commerce to generate 10 vendors and batch-insert them. It collects the returned vendor IDs and inserts a random number of products for each vendor.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Python](https://swe.quest/tags/python.md) (Languages)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)

## Prerequisites

- Python basics ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- Python virtual environments ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

Supabase, supabase-py, Faker, faker-commerce, PostgreSQL

## Related posts

- [Supabase Wrappers, a Postgres FDW framework written in Rust](https://swe.quest/articles/supabase-wrappers-a-postgres-fdw-framework-written-in-rust-284bf0f40798dcde.md): Supabase · 2022-12-15 · Medium · 9 min read · PostgreSQL, Rust, Data pipelines, Analytics & OLAP
  Supabase Wrappers is an alpha Rust framework, built on pgx, for writing Postgres Foreign Data Wrappers that expose external systems such as Stripe and Firebase as queryable foreign tables.
- [Cal.com launches Expert Marketplace built with Next.js and Supabase.](https://swe.quest/articles/cal-com-launches-expert-marketplace-built-with-next-js-and-supabase-2659e9baa272f3f6.md): Supabase · 2024-06-18 · Medium · 5 min read · PostgreSQL, Frontend, Serverless, Storage systems
  Cal.com's open-source Platform Starter Kit for building expert marketplaces runs on Next.js and Supabase, having switched from SQLite to Postgres via Prisma shortly before launch once file storage was needed.
- [Using Supabase in Replit](https://swe.quest/articles/using-supabase-in-replit-72c3911510319276.md): Supabase · 2021-03-11 · Medium · 3 min read · JavaScript, Databases, PostgreSQL
  Supabase can serve as a hosted Postgres database for Node.js repls on Replit, queried directly through supabase-js.
- [Getting started with Laravel and Postgres](https://swe.quest/articles/getting-started-with-laravel-and-postgres-e9ee98d4a4f87aab.md): Supabase · 2024-01-22 · Medium · 2 min read · PHP, PostgreSQL
  A new Laravel app can be connected to a Supabase-hosted Postgres database in a few steps: scaffold the project with Composer, install Laravel Breeze for built-in authentication, set DB\_CONNECTION=pgsql and DATABASE\_URL to the Supabase pooler connection string, then run migrations and start the dev server.
- [Testing for Vibe Coders: From Zero to Production Confidence](https://swe.quest/articles/testing-for-vibe-coders-from-zero-to-production-confidence-ef662c4266a700c4.md): Supabase · 2025-08-16 · Medium · 14 min read · Testing, PostgreSQL, Identity & auth, CI/CD, TypeScript
  A pragmatic testing strategy for fast-moving Supabase apps prioritizes integration tests against a real local Postgres stack (via \`supabase start\`) over unit tests, reserving unit tests for expensive logic like money and date handling and end-to-end Playwright tests for critical flows.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
