Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🐼 Contributing to PandasAI
# 🐼 Contributing to PandaAI

Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright (c) 2023 Sinaptik GmbH
Portions of this software are licensed as follows:

- All content that resides under any "pandasai/ee/" directory of this repository, if such directories exists, are licensed under the license defined in "pandasai/ee/LICENSE".
- All third party components incorporated into the PandasAI Software are licensed under the original license provided by the owner of the applicable component.
- All third party components incorporated into the PandaAI Software are licensed under the original license provided by the owner of the applicable component.
- Content outside of the above mentioned directories or restrictions above is available under the "MIT Expat" license as defined below.

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![PandasAI](assets/logo.png)
# ![PandaAI](assets/logo.png)

[![Release](https://img.shields.io/pypi/v/pandasai?label=Release&style=flat-square)](https://pypi.org/project/pandasai/)
[![CI](https://github.com/sinaptik-ai/pandas-ai/actions/workflows/ci.yml/badge.svg)](https://github.com/sinaptik-ai/pandas-ai/actions/workflows/ci.yml/badge.svg)
Expand All @@ -8,27 +8,27 @@
[![Downloads](https://static.pepy.tech/badge/pandasai)](https://pepy.tech/project/pandasai) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1ZnO-njhL7TBOYPZaqvMvGtsjckZKrv2E?usp=sharing)

PandasAI is a Python platform that makes it easy to ask questions to your data in natural language. It helps non-technical users to interact with their data in a more natural way, and it helps technical users to save time, and effort when working with data.
PandaAI is a Python platform that makes it easy to ask questions to your data in natural language. It helps non-technical users to interact with their data in a more natural way, and it helps technical users to save time, and effort when working with data.

# 🚀 Deploying PandasAI
# 🚀 Deploying PandaAI

PandasAI can be used in a variety of ways. You can easily use it in your Jupyter notebooks or Streamlit apps, or you can deploy it as a REST API such as with FastAPI or Flask.
PandaAI can be used in a variety of ways. You can easily use it in your Jupyter notebooks or Streamlit apps, or you can deploy it as a REST API such as with FastAPI or Flask.

If you are interested in the managed PandasAI Cloud or our self-hosted Enterprise Offering, [contact us](https://forms.gle/JEUqkwuTqFZjhP7h8).
If you are interested in the managed PandaAI Cloud or our self-hosted Enterprise Offering, [contact us](https://forms.gle/JEUqkwuTqFZjhP7h8).

# 🔧 Getting started

You can find the full documentation for PandasAI [here](https://pandas-ai.readthedocs.io/en/latest/).
You can find the full documentation for PandaAI [here](https://pandas-ai.readthedocs.io/en/latest/).

You can either decide to use PandasAI in your Jupyter notebooks, Streamlit apps, or use the client and server architecture from the repo.
You can either decide to use PandaAI in your Jupyter notebooks, Streamlit apps, or use the client and server architecture from the repo.

## ☁️ Using the platform

[![PandasAI platform](assets/demo.gif?raw=true)](https://www.youtube.com/watch?v=kh61wEy9GYM)
[![PandaAI platform](assets/demo.gif?raw=true)](https://www.youtube.com/watch?v=kh61wEy9GYM)

### 📦 Installation

PandasAI platform is uses a dockerized client-server architecture. You will need to have Docker installed in your machine.
PandaAI platform is uses a dockerized client-server architecture. You will need to have Docker installed in your machine.

```bash
git clone https://github.com/sinaptik-ai/pandas-ai/
Expand All @@ -50,7 +50,7 @@ This will start the client and server, and you can access the client at `http://

### 📦 Installation

You can install the PandasAI library using pip or poetry.
You can install the PandaAI library using pip or poetry.

With pip:

Expand All @@ -66,7 +66,7 @@ poetry add pandasai

### 🔍 Demo

Try out the PandasAI library yourself in your browser:
Try out the PandaAI library yourself in your browser:

[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1ZnO-njhL7TBOYPZaqvMvGtsjckZKrv2E?usp=sharing)

Expand Down Expand Up @@ -111,7 +111,7 @@ The total sales for the top 3 countries by sales is 16500.

#### Visualize charts

You can also ask PandasAI to generate charts for you:
You can also ask PandaAI to generate charts for you:

```python
df.chat(
Expand All @@ -123,7 +123,7 @@ df.chat(

#### Multiple DataFrames

You can also pass in multiple dataframes to PandasAI and ask questions relating them.
You can also pass in multiple dataframes to PandaAI and ask questions relating them.

```python
import os
Expand Down Expand Up @@ -160,15 +160,15 @@ You can find more examples in the [examples](examples) directory.

## 📜 License

PandasAI is available under the MIT expat license, except for the `pandasai/ee` directory (which has it's [license here](https://github.com/Sinaptik-AI/pandas-ai/blob/master/pandasai/ee/LICENSE) if applicable.
PandaAI is available under the MIT expat license, except for the `pandasai/ee` directory (which has it's [license here](https://github.com/Sinaptik-AI/pandas-ai/blob/master/pandasai/ee/LICENSE) if applicable.

If you are interested in managed PandasAI Cloud or self-hosted Enterprise Offering, [contact us](https://forms.gle/JEUqkwuTqFZjhP7h8).
If you are interested in managed PandaAI Cloud or self-hosted Enterprise Offering, [contact us](https://forms.gle/JEUqkwuTqFZjhP7h8).

## Resources

- [Docs](https://pandas-ai.readthedocs.io/en/latest/) for comprehensive documentation
- [Examples](examples) for example notebooks
- [Discord](https://discord.gg/kF7FqH2FwS) for discussion with the community and PandasAI team
- [Discord](https://discord.gg/kF7FqH2FwS) for discussion with the community and PandaAI team

## 🤝 Contributing

Expand Down
2 changes: 1 addition & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"navigation": [
{
"group": "Overview",
"pages": ["v3/introduction", "v3/getting-started"],
"pages": ["v3/introduction", "v3/getting-started", "v3/output-formats"],
"version": "v3"
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/v2/advanced-security-agent.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Advanced Security Agent"
description: "Enhance the PandasAI library with the Security Agent to secure applications from malicious code generation"
description: "Enhance the PandaAI library with the Security Agent to secure applications from malicious code generation"
---

## Introduction to the Advanced Security Agent

The `AdvancedSecurityAgent` (currently in beta) extends the capabilities of the PandasAI library by adding a Security layer to identify if query can generate malicious code.
The `AdvancedSecurityAgent` (currently in beta) extends the capabilities of the PandaAI library by adding a Security layer to identify if query can generate malicious code.

> **Note:** Usage of the Security Agent may be subject to a license. For more details, refer to the [license documentation](https://github.com/Sinaptik-AI/pandas-ai/blob/master/pandasai/ee/LICENSE).

Expand Down
6 changes: 3 additions & 3 deletions docs/v2/cache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "The cache is a SQLite database that stores the results of previous

# Cache

PandasAI uses a cache to store the results of previous queries. This is useful for two reasons:
PandaAI uses a cache to store the results of previous queries. This is useful for two reasons:

1. It allows the user to quickly retrieve the results of a query without having to wait for the model to generate a response.
2. It cuts down on the number of API calls made to the model, reducing the cost of using the model.
Expand All @@ -14,7 +14,7 @@ The cache is stored in a file called `cache.db` in the `/cache` directory of the

## Disabling the cache

The cache can be disabled by setting the `enable_cache` parameter to `False` when creating the `PandasAI` object:
The cache can be disabled by setting the `enable_cache` parameter to `False` when creating the `PandaAI` object:

```python
df = SmartDataframe('data.csv', {"enable_cache": False})
Expand All @@ -24,7 +24,7 @@ By default, the cache is enabled.

## Clearing the cache

The cache can be cleared by deleting the `cache.db` file. The file will be recreated automatically when the next query is made. Alternatively, the cache can be cleared by calling the `clear_cache()` method on the `PandasAI` object:
The cache can be cleared by deleting the `cache.db` file. The file will be recreated automatically when the next query is made. Alternatively, the cache can be cleared by calling the `clear_cache()` method on the `PandaAI` object:

```python
import pandas_ai as pai
Expand Down
16 changes: 8 additions & 8 deletions docs/v2/connectors.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Connectors"
description: "PandasAI provides connectors to connect to different data sources."
description: "PandaAI provides connectors to connect to different data sources."
---

PandasAI mission is to make data analysis and manipulation more efficient and accessible to everyone. This includes making it easier to connect to data sources and to use them in your data analysis and manipulation workflow.
PandaAI mission is to make data analysis and manipulation more efficient and accessible to everyone. This includes making it easier to connect to data sources and to use them in your data analysis and manipulation workflow.

PandasAI provides a number of connectors that allow you to connect to different data sources. These connectors are designed to be easy to use, even if you are not familiar with the data source or with PandasAI.
PandaAI provides a number of connectors that allow you to connect to different data sources. These connectors are designed to be easy to use, even if you are not familiar with the data source or with PandaAI.

To use a connector, you first need to install the required dependencies. You can do this by running the following command:

Expand All @@ -21,7 +21,7 @@ Have a look at the video of how to use the connectors:

## SQL connectors

PandasAI provides connectors for the following SQL databases:
PandaAI provides connectors for the following SQL databases:

- PostgreSQL
- MySQL
Expand All @@ -32,11 +32,11 @@ PandasAI provides connectors for the following SQL databases:
- Yahoo Finance
- Airtable

Additionally, PandasAI provides a generic SQL connector that can be used to connect to any SQL database.
Additionally, PandaAI provides a generic SQL connector that can be used to connect to any SQL database.

### PostgreSQL connector

The PostgreSQL connector allows you to connect to a PostgreSQL database. It is designed to be easy to use, even if you are not familiar with PostgreSQL or with PandasAI.
The PostgreSQL connector allows you to connect to a PostgreSQL database. It is designed to be easy to use, even if you are not familiar with PostgreSQL or with PandaAI.

To use the PostgreSQL connector, you only need to import it into your Python code and pass it to a `SmartDataframe` or `SmartDatalake` object:

Expand Down Expand Up @@ -66,7 +66,7 @@ df.chat('What is the total amount of payments in the last year?')

### MySQL connector

Similarly to the PostgreSQL connector, the MySQL connector allows you to connect to a MySQL database. It is designed to be easy to use, even if you are not familiar with MySQL or with PandasAI.
Similarly to the PostgreSQL connector, the MySQL connector allows you to connect to a MySQL database. It is designed to be easy to use, even if you are not familiar with MySQL or with PandaAI.

To use the MySQL connector, you only need to import it into your Python code and pass it to a `SmartDataframe` or `SmartDatalake` object:

Expand Down Expand Up @@ -96,7 +96,7 @@ df.chat('What is the total amount of loans in the last year?')

### Sqlite connector

Similarly to the PostgreSQL and MySQL connectors, the Sqlite connector allows you to connect to a local Sqlite database file. It is designed to be easy to use, even if you are not familiar with Sqlite or with PandasAI.
Similarly to the PostgreSQL and MySQL connectors, the Sqlite connector allows you to connect to a local Sqlite database file. It is designed to be easy to use, even if you are not familiar with Sqlite or with PandaAI.

To use the Sqlite connector, you only need to import it into your Python code and pass it to a `SmartDataframe` or `SmartDatalake` object:

Expand Down
2 changes: 1 addition & 1 deletion docs/v2/contributing.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🐼 Contributing to PandasAI
# 🐼 Contributing to PandaAI

Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.

Expand Down
4 changes: 2 additions & 2 deletions docs/v2/custom-response.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Custom Response"
---

PandasAI offers the flexibility to handle chat responses in a customized manner. By default, PandasAI includes a ResponseParser class that can be extended to modify the response output according to your needs.
PandaAI offers the flexibility to handle chat responses in a customized manner. By default, PandaAI includes a ResponseParser class that can be extended to modify the response output according to your needs.

You have the option to provide a custom parser, such as `StreamlitResponse`, to the configuration object like this:

Expand All @@ -16,7 +16,7 @@ from pandasai import SmartDatalake
from pandasai.responses.response_parser import ResponseParser

# This class overrides default behaviour how dataframe is returned
# By Default PandasAI returns the SmartDataFrame
# By Default PandaAI returns the SmartDataFrame
class PandasDataFrame(ResponseParser):

def __init__(self, context) -> None:
Expand Down
8 changes: 4 additions & 4 deletions docs/v2/custom-whitelisted-dependencies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Custom whitelisted dependencies"
---

By default, PandasAI only allows to run code that uses some whitelisted modules. This is to prevent malicious code from being executed on the server or locally.
By default, PandaAI only allows to run code that uses some whitelisted modules. This is to prevent malicious code from being executed on the server or locally.

The whitelisted modules are:

Expand All @@ -18,7 +18,7 @@ These libraries are sandboxed for security reasons, so that malicious code canno

However, it is possible to add custom modules to the whitelist. This can be done by passing a list of modules to the `custom_whitelisted_dependencies` parameter when instantiating the `Agent` class.

**Note**: PandasAI cannot sandbox arbitrary code execution for custom libraries that are whitelisted. If you add a custom library to the whitelist, arbitrary code execution will be possible for that library. Whitelisting a custom library means that the library is "trusted" and can be used without any limitations. **Only whitelist libraries that are under your control or that you trust**.
**Note**: PandaAI cannot sandbox arbitrary code execution for custom libraries that are whitelisted. If you add a custom library to the whitelist, arbitrary code execution will be possible for that library. Whitelisting a custom library means that the library is "trusted" and can be used without any limitations. **Only whitelist libraries that are under your control or that you trust**.

For example, to add the `scikit-learn` module to the whitelist:

Expand All @@ -29,6 +29,6 @@ agent = Agent("data.csv", config={
})
```

The `custom_whitelisted_dependencies` parameter accepts a list of strings, where each string is the name of a module. The module must be installed in the environment where PandasAI is running.
The `custom_whitelisted_dependencies` parameter accepts a list of strings, where each string is the name of a module. The module must be installed in the environment where PandaAI is running.

Please, make sure you have installed the module in the environment where PandasAI is running. Otherwise, you will get an error when trying to run the code.
Please, make sure you have installed the module in the environment where PandaAI is running. Otherwise, you will get an error when trying to run the code.
28 changes: 14 additions & 14 deletions docs/v2/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: "Examples"
---

Here are some examples of how to use PandasAI.
Here are some examples of how to use PandaAI.
More [examples](https://github.com/Sinaptik-AI/pandas-ai/tree/main/examples) are included in the repository along with samples of data.

## Working with pandas dataframes

Using PandasAI with a Pandas DataFrame
Using PandaAI with a Pandas DataFrame

```python
import os
Expand Down Expand Up @@ -35,7 +35,7 @@ print(response)

## Working with CSVs

Example of using PandasAI with a CSV file
Example of using PandaAI with a CSV file

```python
import os
Expand All @@ -55,13 +55,13 @@ print(response)

## Working with Excel files

Example of using PandasAI with an Excel file. In order to use Excel files as a data source, you need to install the `pandasai[excel]` extra dependency.
Example of using PandaAI with an Excel file. In order to use Excel files as a data source, you need to install the `pandasai[excel]` extra dependency.

```console
pip install pandasai[excel]
```

Then, you can use PandasAI with an Excel file as follows:
Then, you can use PandaAI with an Excel file as follows:

```python
import os
Expand All @@ -81,7 +81,7 @@ print(response)

## Working with Parquet files

Example of using PandasAI with a Parquet file
Example of using PandaAI with a Parquet file

```python
import os
Expand All @@ -101,13 +101,13 @@ print(response)

## Working with Google Sheets

Example of using PandasAI with a Google Sheet. In order to use Google Sheets as a data source, you need to install the `pandasai[google-sheet]` extra dependency.
Example of using PandaAI with a Google Sheet. In order to use Google Sheets as a data source, you need to install the `pandasai[google-sheet]` extra dependency.

```console
pip install pandasai[google-sheet]
```

Then, you can use PandasAI with a Google Sheet as follows:
Then, you can use PandaAI with a Google Sheet as follows:

```python
import os
Expand All @@ -128,13 +128,13 @@ Remember that at the moment, you need to make sure that the Google Sheet is publ

## Working with Modin dataframes

Example of using PandasAI with a Modin DataFrame. In order to use Modin dataframes as a data source, you need to install the `pandasai[modin]` extra dependency.
Example of using PandaAI with a Modin DataFrame. In order to use Modin dataframes as a data source, you need to install the `pandasai[modin]` extra dependency.

```console
pip install pandasai[modin]
```

Then, you can use PandasAI with a Modin DataFrame as follows:
Then, you can use PandaAI with a Modin DataFrame as follows:

```python
import os
Expand Down Expand Up @@ -163,13 +163,13 @@ print(response)

## Working with Polars dataframes

Example of using PandasAI with a Polars DataFrame (still in beta). In order to use Polars dataframes as a data source, you need to install the `pandasai[polars]` extra dependency.
Example of using PandaAI with a Polars DataFrame (still in beta). In order to use Polars dataframes as a data source, you need to install the `pandasai[polars]` extra dependency.

```console
pip install pandasai[polars]
```

Then, you can use PandasAI with a Polars DataFrame as follows:
Then, you can use PandaAI with a Polars DataFrame as follows:

```python
import os
Expand All @@ -194,7 +194,7 @@ print(response)

## Plotting

Example of using PandasAI to plot a chart from a Pandas DataFrame
Example of using PandaAI to plot a chart from a Pandas DataFrame

```python
import os
Expand Down Expand Up @@ -241,7 +241,7 @@ print(response)

## Working with multiple dataframes (using the SmartDatalake)

Example of using PandasAI with multiple dataframes. In order to use multiple dataframes as a data source, you need to use a `SmartDatalake` instead of a `SmartDataframe`. You can instantiate a `SmartDatalake` as follows:
Example of using PandaAI with multiple dataframes. In order to use multiple dataframes as a data source, you need to use a `SmartDatalake` instead of a `SmartDataframe`. You can instantiate a `SmartDatalake` as follows:

```python
import os
Expand Down
Loading
Loading