RNIT Vanna - Enhanced SQL Generation (v2.0)
RNIT Vanna is an enhanced wrapper around the official Vanna library with custom utilities and smart dependency management.
🚀 New in v2.0: Choose Your Dependencies!
Minimal Installation (50 packages only!)
pip install rnit-vanna
✅ Core Vanna functionality ✅ Basic SQL generation ✅ All RNIT utilities ❌ No heavy ML dependencies unless you need them
Install What You Need
| Use Case | Installation | Packages Added |
|---|---|---|
| OpenAI GPT | pip install rnit-vanna[openai] |
+60 packages |
| Anthropic Claude | pip install rnit-vanna[anthropic] |
+40 packages |
| Local LLMs | pip install rnit-vanna[local] |
+30 packages |
| Just ChromaDB | pip install rnit-vanna[chromadb] |
+50 packages |
| PostgreSQL | pip install rnit-vanna[postgres] |
+5 packages |
| MySQL | pip install rnit-vanna[mysql] |
+3 packages |
| Everything | pip install rnit-vanna[all] |
+110 packages |
💡 Why This Matters
Before (v1.0): Everyone downloads 110+ packages even if they only need basic features Now (v2.0): Download only what you need!
📦 Quick Start
For OpenAI Users
pip install rnit-vanna[openai]
from rnit_vanna import RNITVanna
vn = RNITVanna() # Auto-detects OPENAI_API_KEY from environment
vn.connect_to_sqlite('my_database.sqlite')
sql = vn.generate_sql("Show all users")
For Anthropic Users
pip install rnit-vanna[anthropic]
from rnit_vanna import RNITVanna
vn = RNITVanna(config={'api_key': 'your-anthropic-key'})
For Local LLM Users (No API Key!)
pip install rnit-vanna[local]
from rnit_vanna import RNITVanna
vn = RNITVanna(config={'model': 'llama2'})
🎯 Enhanced Features
RNITVanna Class
- Auto-detects API keys from environment
- Optimized defaults for SQL generation
- Batch training support
- Training history tracking
VannaQuickStart
from rnit_vanna import VannaQuickStart
# Auto-setup and train from SQLite
vn = VannaQuickStart.for_sqlite('database.sqlite', auto_train=True)
# Create a sample project
VannaQuickStart.create_sample_project('my_sql_assistant')
DatabaseInspector
from rnit_vanna import DatabaseInspector
inspector = DatabaseInspector()
db_info = inspector.inspect_sqlite('database.sqlite')
print(inspector.generate_summary(db_info))
TrainingGenerator
from rnit_vanna import TrainingGenerator
generator = TrainingGenerator()
queries = generator.generate_basic_queries(table_name, columns)
🔄 Upgrading from v1.0
If you're upgrading from v1.0:
# Uninstall old version
pip uninstall rnit-vanna
# Install new version with the features you need
pip install rnit-vanna[openai] # or [anthropic], [local], etc.
📊 Dependency Comparison
| Installation | v1.0 | v2.0 (minimal) | v2.0 [openai] | v2.0 [all] |
|---|---|---|---|---|
| Packages | 110+ | 50 | 110 | 110+ |
| Size | ~200MB | ~50MB | ~150MB | ~200MB |
| ChromaDB | ✅ Always | ❌ Optional | ✅ Included | ✅ Included |
| OpenAI | ✅ Always | ❌ Optional | ✅ Included | ✅ Included |
| Anthropic | ❌ Never | ❌ Optional | ❌ Not included | ✅ Included |
🛠️ Development
# Clone the repo
git clone https://github.com/rnit/rnit-vanna
cd rnit-vanna
# Install in development mode with dev tools
pip install -e .[dev]
# Run tests
pytest
📝 Examples
Basic Usage (Works with minimal install!)
from rnit_vanna import DatabaseInspector, TrainingGenerator
# These utilities work even without OpenAI/ChromaDB!
inspector = DatabaseInspector()
db_info = inspector.inspect_sqlite('my_db.sqlite')
generator = TrainingGenerator()
queries = generator.generate_basic_queries('users', db_info['tables']['users']['columns'])
Full Featured (Requires [openai] or [all])
from rnit_vanna import RNITVanna, VannaQuickStart
vn = VannaQuickStart.for_sqlite('database.sqlite', auto_train=True)
sql = vn.generate_sql("Complex question about your data")
df = vn.run_sql(sql)
🤝 Contributing
Contributions welcome! Please feel free to submit a Pull Request.
📄 License
MIT License - see LICENSE file
🙏 Acknowledgments
Built on top of the excellent Vanna.AI library.
Note: This is a wrapper that enhances Vanna. For core Vanna documentation, visit vanna.ai
Metadata
Release files for rnit-vanna 2.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 |
|---|---|---|---|---|
| rnit_vanna-2.0.0.tar.gz | 14.4 kB | Without provenance | Details for rnit_vanna-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rnit_vanna-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for rnit_vanna-2.0.0-py3-none-any.whl |
Total release size: 26.6 kB
Release files / rnit_vanna-2.0.0.tar.gz
| Download URL | rnit_vanna-2.0.0.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b94dad77bd4c836e19738c57c3bbdeaee253dc52693e69b0b48fce025ffaa725
|
|
BLAKE2b-256 checksum How to use checksums |
2f1be255cf3565bfaebe0d186d8e7c21454b34270d432f0b5ef58ca72224cedf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / rnit_vanna-2.0.0-py3-none-any.whl
| Download URL | rnit_vanna-2.0.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
774d21adc77b0dbc7cd87776a51a33d2593f5d63e91a245fcc6d9235b105036f
|
|
BLAKE2b-256 checksum How to use checksums |
7017068d216a77cae613db59eb6adaae1a4cdf71c61e3608f17489013d3639cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for rnit-vanna 2.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.