DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to query dataframes and databases with SQL in Python notebooks with Marimo

Mix SQL cells that depend on Python values with Python cells, and page through results in interactive dataframes.

Short answer: Install the extras that unlock SQL cells with pip install "marimo[recommended]"; then open a notebook with Marimo edit and add a SQL cell that references a Python variable; Query dataframes, databases, CSVs or warehouses with the built-in SQL engine. All steps.

  • Data and analytics
  • Intermediate
  • 30 minutes
  • From the README
  • Claude Code
  • Codex
  • Cursor
  • Gemini CLI

Who it is forAn analyst who thinks in SQL but needs Python for the rest of the analysis.

The problemSwitching between a SQL client and a notebook breaks the flow and loses reproducibility.

The outcomeA notebook where SQL results come back as Python dataframes and the whole thing is still a .py file.

What you need first

  • Python and pip or conda
  • Optional: marimo[recommended] for SQL cells, AI completion and more
  • Optional: your own API keys or a local model for AI features

Steps

  1. Install the extras that unlock SQL cells with pip install "marimo[recommended]"
  2. Open a notebook with Marimo edit and add a SQL cell that references a Python variable
  3. Query dataframes, databases, CSVs or warehouses with the built-in SQL engine
  4. Page through, search, filter and sort the result in the interactive dataframe viewer
  5. Run pytest on the notebook if you want tests around the analysis

Prompt for your agent

Using marimo-team/marimo, create a notebook that loads <CSV or database>, adds a SQL cell filtered by a Python dropdown value, and shows the result in an interactive dataframe.

Caveat. This card is written from the marimo-team/marimo README, not from a test run by Deduped. Before you start, make sure you have Python and pip or conda. Check the repo for newer instructions before you rely on these steps.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for marimo-team/marimo and "Query dataframes and databases with SQL in Python notebooks"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer