GeoPandas AI is an extension of GeoPandas allowing you to interact with your spatial data in natural language.
Project description
GeoPandas AI
GeoPandas AI is a powerful Python library that brings natural language processing capabilities to your geospatial data analysis workflow. It allows you to interact with GeoDataFrames using natural language queries, making geospatial analysis more accessible and intuitive.
Features
- Natural language interaction with GeoDataFrames
- Support for multiple LLM providers through LiteLLM
- Built-in support for Jupyter notebooks
Installation
pip install geopandas-ai
Quick Start
GeoPandas AI is designed to work seamlessly with GeoPandas. Most function available in GeoPandas are also available in GeoPandas AI.
Example Usage 1
import geopandasai as gpdai
gdfai = gpdai.read_file("path/to/your/geodatafile.geojson")
gdfai.chat("Plot the data")
gdfai.improve("Change the title to something more selling and add a basemap")
Example Usage 2
import geopandasai as gpdai
gdfai = gpdai.read_file("path/to/your/geodatafile.geojson")
gdfai.chat("Plot the data").chat("Change the title to something more selling and add a basemap")
Configuration
GeoPandas AI uses LiteLLM to support multiple LLM providers. You can configure your preferred provider in two ways:
- Using the
set_active_lite_llm_configfunction:
from geopandasai import set_active_lite_llm_config
set_active_lite_llm_config({
"model": "your_model_name",
# Add provider-specific configuration
})
- Using environment variables:
export LITELLM_CONFIG='{"model": "your_model_name", ...}'
Please refer to https://docs.litellm.ai/docs/providers for more details on configuring LiteLLM.
Adding Custom Libraries
GeoPandas AI allows you to extend its capabilities by adding custom libraries that can be used in the generated code. There are two ways to add libraries:
- Globally using
set_libraries:
from geopandasai import set_libraries
# Add libraries that will be available for all chat queries
set_libraries(['numpy', 'scipy', 'shapely'])
- Per-query using the
user_provided_librariesparameter:
# Add libraries for a specific query
result = gdfai.chat(
"calculate the convex hull using scipy",
user_provided_libraries=['scipy', 'numpy']
)
By default, the following libraries are always available:
- pandas
- matplotlib.pyplot
- folium
- geopandas
- contextily
Note: Make sure any additional libraries you specify are installed in your environment.
Requirements
- Python 3.8+
- GeoPandas
- LiteLLM
- Matplotlib
- Folium
- Contextily
License
MIT + Commercial Platform Restriction (see LICENSE.md)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geopandas_ai-0.0.17.tar.gz.
File metadata
- Download URL: geopandas_ai-0.0.17.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ec96ffa63ac42896d9bc3f543466d25f5c3daa0910d84f470c745edb32a2021
|
|
| MD5 |
8d9ea647c005e428316919cd76678ebe
|
|
| BLAKE2b-256 |
2678f97a90c830a699784799bb04e9e6ecf24d047b332a5d8b5569a653d12376
|
Provenance
The following attestation bundles were made for geopandas_ai-0.0.17.tar.gz:
Publisher:
python-publish.yml on GaspardMerten/geopandas-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geopandas_ai-0.0.17.tar.gz -
Subject digest:
1ec96ffa63ac42896d9bc3f543466d25f5c3daa0910d84f470c745edb32a2021 - Sigstore transparency entry: 212840658
- Sigstore integration time:
-
Permalink:
GaspardMerten/geopandas-ai@23989cf4003df83bde4e3e5df3ead0c04ddf788f -
Branch / Tag:
refs/tags/v0.0.17 - Owner: https://github.com/GaspardMerten
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@23989cf4003df83bde4e3e5df3ead0c04ddf788f -
Trigger Event:
push
-
Statement type:
File details
Details for the file geopandas_ai-0.0.17-py3-none-any.whl.
File metadata
- Download URL: geopandas_ai-0.0.17-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6950648ffb47baddcd8b155561f5f68176334a2a77d2adf4073e48d687d4faaa
|
|
| MD5 |
f8321127326999ab32957989d77aa4de
|
|
| BLAKE2b-256 |
326442ea4579a44cf2a75c7d54b7a229ae5fe1832b9b4e7a0a149a731bc3efbc
|
Provenance
The following attestation bundles were made for geopandas_ai-0.0.17-py3-none-any.whl:
Publisher:
python-publish.yml on GaspardMerten/geopandas-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geopandas_ai-0.0.17-py3-none-any.whl -
Subject digest:
6950648ffb47baddcd8b155561f5f68176334a2a77d2adf4073e48d687d4faaa - Sigstore transparency entry: 212840662
- Sigstore integration time:
-
Permalink:
GaspardMerten/geopandas-ai@23989cf4003df83bde4e3e5df3ead0c04ddf788f -
Branch / Tag:
refs/tags/v0.0.17 - Owner: https://github.com/GaspardMerten
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@23989cf4003df83bde4e3e5df3ead0c04ddf788f -
Trigger Event:
push
-
Statement type: