Skip to main content

SQL Agent Library

Overview

The SQL Agent Library allows users to interact with SQL databases using natural human language. With this library, users can simply describe what data they want to retrieve or manipulate, and the library will convert these descriptions into precise SQL queries and execute them. This simplifies database interactions for those who may not be familiar with SQL syntax but need to access and manage data.

Features

  • Natural Language Processing: Convert human language queries into SQL statements.
  • Database Agnostic: Works with various SQL databases (MySQL, PostgreSQL, SQLite, etc.).
  • Ease of Use: Simple input-output mechanism to facilitate quick querying.
  • Flexibility: Handles a variety of query types including SELECT, INSERT, UPDATE, and DELETE.

Installation

To install the SQL Agent Library, use pip:

pip install sqlagent

Usage

Here's a quick example to get you started:

Step 1: Initiate instance

# Create an instance of the SQLAgent
from sqlagent.agent import SQLAgent
agent = SQLAgent(db_connection_string="your_database_connection_string")

Step 2: Query the Database

await agent.arun("how many tables are there in my db ?")

Configuration

You can configure the SQL Agent Library to connect to your specific database by providing the appropriate connection string during initialization. it's utilizing sqlachemy under the hood

Supported Databases

  • MySQL
  • PostgreSQL
  • SQLite

Contributing

Contributions are welcome! Please read the CONTRIBUTING.md for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

We'd like to thank all contributors and supporters of this project. Your efforts help make database interactions simpler for everyone.

Contact

For any questions or issues, please open an issue on GitHub or contact us at vikyw89@gmail.com.

Metadata

Release files for sqlagent 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlagent 1.0.8
File Size Uploaded
sqlagent-1.0.8.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlagent 1.0.8
File Interpreter ABI Platform
sqlagent-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / sqlagent-1.0.8.tar.gz

Download URL sqlagent-1.0.8.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
473c8e5e00552e5cca917a295b01fa5f50d8b506bf0812a8e33598242451b381
BLAKE2b-256 checksum
How to use checksums
60ce9bb3b9665dd144ad690b428461a706266ad0c645590c67be662ce24331a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-35-generic

Release files / sqlagent-1.0.8-py3-none-any.whl

Download URL sqlagent-1.0.8-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12db249001ee33c9ded4cd209f68cb840fd6ef578472e99152f83d23289b3aa2
BLAKE2b-256 checksum
How to use checksums
53ac45c94c34e67207bb971346de17f6b7c0d5f92c8c5cd7cfd552c936762bb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-35-generic

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page