skillfed

pandasql

sqldf for pandas

pandasql v0.7.3 2.0M downloads/30d#3,405 on PyPI1,349
License unclear Copyright (c) 2013 Yhat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the… (full text in the JSON record) Abandoned released

What it is and what it does

pandasql is a thin wrapper that translates SQL queries into pandas operations, using SQLite syntax as the query language. It automatically detects pandas DataFrames in the calling scope and treats them as SQL tables, allowing you to write SELECT, JOIN, GROUP BY, and other SQL statements against them. The main entry point is the sqldf function, which takes a SQL query string and a namespace dict (typically globals() or locals()) to resolve DataFrame names.

The package was designed to lower the barrier for people familiar with SQL but new to pandas, providing a more intuitive interface for data manipulation and cleaning. However, it has been abandoned since 2016 with no active maintenance, creating significant compatibility concerns for modern Python and pandas environments.

Use it for:

  • Migrate SQL-based data workflows to Python without rewriting queries as pandas method chains
  • Join multiple DataFrames using familiar SQL INNER/LEFT/RIGHT JOIN syntax
  • Perform GROUP BY aggregations and window functions on DataFrames using SQL
  • Prototype data transformations quickly if you think in SQL rather than pandas idioms

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pandasql lets you query pandas DataFrames using SQL syntax instead of pandas methods, bridging SQL familiarity with DataFrame manipulation.

No. The package is abandoned (last release 2016, no commits since July 2024 in archived repo) and has high install friction. Modern alternatives like DuckDB or Polars provide SQL-on-DataFrames with active maintenance, better performance, and compatibility with current Python versions. Use pandasql only if you have legacy code already depending on it; do not start new projects with it.

Install

pandasql on PyPI

pip

pip install pandasql

uv

uv add pandasql

poetry

poetry add pandasql

Installing pandasql

Before you install

High install friction due to distribution format (egg and tarball only, no wheels). Package is abandoned as of 2016 with no maintenance since then, creating compatibility risk with modern Python and pandas versions.

License in practice

MIT-like permissive license (copyright notice and permission text present) with no SPDX identifier recorded. Permissive for use but license treatment is marked unclear, so verify the exact terms before relying on it commercially.

Quickstart

pip install pandasql
from pandasql import sqldf
pysqldf = lambda q: sqldf(q, globals())
result = pysqldf("SELECT * FROM my_dataframe LIMIT 10;")

Requires pandas to be installed separately; no explicit Python version support declared. Abandoned package may have compatibility issues with modern Python and pandas versions.

Verify before relying

  • Whether pandasql works with current pandas versions (last release 2016, pandas has evolved significantly)
  • Exact Python version compatibility (requires_python is unspecified)
  • Whether SQLite syntax coverage is complete for modern SQL features

Package facts

License Copyright (c) 2013 Yhat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the… (full text in the JSON record) (unclear)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,768 days since the last release
Last repo commit (repository archived)
First released
Downloads 1,963,671/month — #3,405 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pandasql-0.7.3-py2.7.egg; pandasql-0.7.3.tar.gz

Tags

sql query pandas dataframessqldf for pythonsql syntax dataframequery dataframes with sqlpandas sql interfacesqlite dataframe queries
sql-interfaceabandoned

More Database packages