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 Example: "show me the highest and lowest closing price for each month" - 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 hack over a 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.5.tar.gz
.
File metadata
- Download URL: querytograph-0.0.5.tar.gz
- Upload date:
- Size: 5.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 | 596721b61caf4e674c71d8ee8c6785d660eb5270c1372cc964175013b2d98fe4 |
|
MD5 | 45de8e3a90333f879ca7dcb2bcd832e7 |
|
BLAKE2b-256 | 331e384b6b80e5584f8ed20f6f65105b1878317f2676763a53e3ddda7850591b |
File details
Details for the file querytograph-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: querytograph-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.7 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 | 18ca9f8cabd7b40a6532af55299754b93fc20d9ba7915defb3ef173079d0746d |
|
MD5 | 706886e037ccb52a56f913bbfa542749 |
|
BLAKE2b-256 | df6a1f91be3d5817f1a8ff4f6076a07f8bf3ecbf748ae1a7bf72660ca419d510 |