Using ChatGPT to convert your plain English queries into graphs
Project description
QueryToGraph
QueryToGraph is a Python library that allows user to use simple English to create graph from a dataframe or csv file. It uses ChatGPT as the underlying engine.
For security's sake, it does not send the raw data to ChatGPT but only the data schema (i.e. the data field names) is sent.
Installation
You can install QueryToGraph using pip:
pip install querytograph
Sorry I have only tested this library in Linux.
Usage
You need to have an paid OpenAI account and you need to set your OpenAI API Key in your environment variable. You can set it in the terminal:
export OPENAI_API_KEY="put your key here, don't copy this line as it is!"
Alternatively, you could do this from inside your Jupyter notebook or Python script:
import
os.environ["OPENAI_API_KEY"="put your key here, don't copy this line as it is!"
To use QueryToGraph, in your Jupyter notebook or Python script:
import querytograph
qtg = querytograph.QueryToGraph()
qtg.run_gr()
Go to your browser and use it, e.g. http://127.0.0.1:7861
There are 3 textboxes which you have to key in
- Query
Question by the user, which will be used to generate the graph - Data Folder
Folder which contains Pandas dataframes in csv or pkl (pickle) - Table Name
Filename of the dataframe that the user wants to query on. Do not require the exact name
Contributing
Contributions are welcome! Please contact me at franziss@gmail.com This was a hack over my weekend and I am sure there are bounds to have bugs... sorry.. =)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
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
Built Distribution
File details
Details for the file querytograph-0.0.1.tar.gz
.
File metadata
- Download URL: querytograph-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46ae7578af5802e4910260a6d15d244a5ca92ea58449cd94c5be8b43c86e0f39 |
|
MD5 | 84a384fc232b03d12c56d22d348a5163 |
|
BLAKE2b-256 | dd00a83f7c119764d2aec276b7916482cfd0b555e7c0fc82d35bf9119a7a1ff7 |
File details
Details for the file querytograph-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: querytograph-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 349ae1259dd49a65bd874dc7b27f412a794da57b542d358277056f9d85e35512 |
|
MD5 | 221df24fc2e99cfa0619c6a38f14b53b |
|
BLAKE2b-256 | 4ed607536665acc6caf71f1cae3ca9814c3963eb4b675499706d4cb96c238e20 |