README.md
Natural Language MySQL Schema Creator
A Python package that converts natural language commands into MySQL database schemas through both CLI and interactive modes.
Features
-
🗣️ Natural language processing for schema creation
-
🔒 Secure database connections with parameterized queries
-
💻 Interactive CLI mode with guided prompts
-
📝 Support for both text input and file input
-
🛠️ Schema validation and error recovery
-
🔄 Connection pooling for better performance
-
🧪 Dry-run mode for SQL preview
Installation
bash
pip install MySQL_NLP_CLI
python -m spacy download en_core_web_sm
Usage
Command Line Interface
bash
Natural language input
mysql_nlp_cli -t "Create database 'ecommerce' with table users (id int primary key)" -u root
File input
mysql_nlp_cli -f schema.txt -u root --dry-run
Interactive mode
mysql_nlp_cli -i -u root
Natural Language Examples
Input:
text
Create database 'inventory' with tables:
-
products (id int primary key, name varchar(255) not null, price decimal(10,2))
-
orders (order_id int auto_increment, product_id int, quantity int)
Generated SQL:
sql
CREATE DATABASE inventory CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
USE inventory;
CREATE TABLE products (
id INT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
price DECIMAL(10,2)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE orders (
order_id INT AUTO_INCREMENT,
product_id INT,
quantity INT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Interactive Mode Demo
text
$ mysql_nlp_cli -i -u root
=== MySQL Schema Creator ===
Database name: my_shop
Add table? [Y/n]: y
Table name: customers
Column name: id
Data type: INT
Primary key? [y/N]: y
Nullable? [Y/n]: n
Add another column? [Y/n]: y
Column name: email
Data type: VARCHAR
Length: 255
Nullable? [Y/n]: n
Unique constraint? [y/N]: y
[1] Continue to database creation
[2] Preview SQL
[3] Cancel
Choice: 2
Generated SQL:
...
Configuration
Environment variables (optional):
env
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=root
Features
-
Natural Language Processing
-
Automatic type conversion
-
Constraint detection (primary key, nullability)
-
Multi-table support
-
Complex column definitions
-
-
Security
-
Password masking
-
SQL injection prevention
-
Connection encryption
-
Schema validation
-
-
Interactive Mode
-
Step-by-step guidance
-
Real-time validation
-
Error recovery
-
SQL preview
-
Contributing
-
Fork the repository
-
Create your feature branch (
git checkout -b feature/awesome-feature) -
Commit your changes (
git commit -am 'Add awesome feature') -
Push to the branch (
git push origin feature/awesome-feature) -
Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Troubleshooting
Q: Getting "Language model not found" error
bash
python -m spacy download en_core_web_sm
Q: MySQL connection issues
-
Verify MySQL server is running
-
Check firewall settings
-
Validate user permissions
Q: Schema validation errors
-
Ensure names follow [a-zA-Z0-9_] pattern
-
Check for duplicate primary keys
-
Verify supported data types
This documentation provides users with comprehensive information about the package while maintaining professional formatting and clear organization. The README includes:
-
Badges for quick info
-
Feature highlights
-
Installation instructions
-
Usage examples
-
Configuration guidance
-
Development guidelines
-
Troubleshooting common issues
-
License information
Metadata
Release files for MySQL-NLP-CLI 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mysql_nlp_cli-1.0.0.tar.gz | 9.8 kB | Without provenance | Details for mysql_nlp_cli-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| MySQL_NLP_CLI-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for MySQL_NLP_CLI-1.0.0-py3-none-any.whl |
Total release size: 21.2 kB
Release files / mysql_nlp_cli-1.0.0.tar.gz
| Download URL | mysql_nlp_cli-1.0.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc3a3b373238e69c6cde97a378919174c2228dc0e6e4aff6682c2ef3044e9a74
|
|
BLAKE2b-256 checksum How to use checksums |
c53268ef7d654da74a02b276ebe980829bccf57acb0ec3d292e9297447b15877
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / MySQL_NLP_CLI-1.0.0-py3-none-any.whl
| Download URL | MySQL_NLP_CLI-1.0.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34d239844b455c3a1268f18ac4ad69883bab8a36878954c7f1eb39afc12c7fdc
|
|
BLAKE2b-256 checksum How to use checksums |
4a30521b9748c3607c0ce0bece884890b0f566e833f3c6bda74b6b4090062d36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for MySQL-NLP-CLI 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.