Skip to main content

Ariamehr's Gemini Pandas Agent

A Google-native alternative to LangChain's create_pandas_dataframe_agent, powered by Gemini and LangGraph.

Created by Ariamehr A

Installation

pip install ariamehr-gemini-pandas-agent

Quick Start

import pandas as pd
import google.generativeai as genai
from ariamehr_gpandas_agent import create_pandas_dataframe_agent

# Configure Gemini
genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel("gemini-2.0-pro")

# Load your data
df = pd.read_csv("your_data.csv")

# Create the agent
agent = create_pandas_dataframe_agent(model, df, allow_dangerous_code=False)

# Ask questions about your data
response = agent.run("What is the average value in column X?")
print(response)

Features

  • 🚀 Powered by Google's Gemini API and LangGraph
  • 🔒 Secure Python AST-based code execution
  • 📊 Support for single or multiple DataFrames
  • 🎯 Simple, LangChain-compatible interface
  • 🛡️ Safe by default with optional dangerous code allowance

Security Note

By default, the agent runs in a secure mode that prevents potentially dangerous imports. If you need to allow specific imports, use allow_dangerous_code=True, but be aware of the security implications.

License

MIT License - see LICENSE file for details.

Author

Created by Ariamehr A

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for ariamehr-gemini-pandas-agent 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ariamehr-gemini-pandas-agent 0.1.0
File Size Uploaded
ariamehr_gemini_pandas_agent-0.1.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ariamehr-gemini-pandas-agent 0.1.0
File Interpreter ABI Platform
ariamehr_gemini_pandas_agent-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / ariamehr_gemini_pandas_agent-0.1.0.tar.gz

Download URL ariamehr_gemini_pandas_agent-0.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6aa8c5f95b7ef290673079adeabe9d954a28d85a7c34422c4aeddf48383f4c4d
BLAKE2b-256 checksum
How to use checksums
5b74e6755c61f9d37ae96d6e0a61770df5877fb0686fcf2688ea8b16067cb9fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / ariamehr_gemini_pandas_agent-0.1.0-py3-none-any.whl

Download URL ariamehr_gemini_pandas_agent-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b6c25331b8226286f2d40e5de8b0e33e1a6d1f99ba0e950103e22d881fd542a
BLAKE2b-256 checksum
How to use checksums
25a255518a46f49de452cfb39e245116fa62fea20bef6e0a65b3982dfbec373f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page