Skip to main content

Google‑native alternative to LangChain's create_pandas_dataframe_agent by Ariamehr A

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ariamehr_gemini_pandas_agent-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ariamehr_gemini_pandas_agent-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file ariamehr_gemini_pandas_agent-0.1.0.tar.gz.

File metadata

File hashes

Hashes for ariamehr_gemini_pandas_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6aa8c5f95b7ef290673079adeabe9d954a28d85a7c34422c4aeddf48383f4c4d
MD5 a23b2b70e839233d2897fbcbce9c61a5
BLAKE2b-256 5b74e6755c61f9d37ae96d6e0a61770df5877fb0686fcf2688ea8b16067cb9fd

See more details on using hashes here.

File details

Details for the file ariamehr_gemini_pandas_agent-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ariamehr_gemini_pandas_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b6c25331b8226286f2d40e5de8b0e33e1a6d1f99ba0e950103e22d881fd542a
MD5 1516bef0f469368dadfcee98354e68bb
BLAKE2b-256 25a255518a46f49de452cfb39e245116fa62fea20bef6e0a65b3982dfbec373f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page