Skip to main content

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

Chart

There are 3 textboxes which you have to key in

  1. 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"
  2. Data Folder
    Folder which contains Pandas dataframes in csv or pkl (pickle)
  3. 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

franziss@gmail.com

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

querytograph-0.0.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

querytograph-0.0.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file querytograph-0.0.4.tar.gz.

File metadata

  • Download URL: querytograph-0.0.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for querytograph-0.0.4.tar.gz
Algorithm Hash digest
SHA256 600f96f841d6b0ea5ed38c8fb7ddb7e7abe2e9d688c80b62fa2ab25370cfa0f4
MD5 a3af60ba1f55880b4effd60f9ede0d0f
BLAKE2b-256 15cf5be5d119f1262b2a6dee45403afc9b56c56fde1cf9fd5724379189fa2f2f

See more details on using hashes here.

File details

Details for the file querytograph-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for querytograph-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 22d11e25e20567ff33271a6d327cdd46b52b69177eb5826446a86d87fdf7df51
MD5 6731234cb705f65ce14fbcb5dbddd7be
BLAKE2b-256 1e7e07e0b505f73c2df2a07faec28ef0032371e00659e84dd9fca16cde9cfa4e

See more details on using hashes here.

Supported by

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