Metadata-Version: 2.3
Name: cosmiclode.cosmic-nexus
Version: 0.1.0
Summary: A package for connecting to various databases (PostgreSQL, MySQL, SQL Server).
License: MIT License
         
         Copyright (c) 2025 Celestial Four
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Keywords: database,SQL,PostgreSQL,MySQL,SQL Server,connector
Author: vinod901
Author-email: yerrapureddyvinodreddy@gmail.com
Requires-Python: >=3.7
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pandas
Requires-Dist: sqlalchemy
Description-Content-Type: text/markdown

# Cosmic Nexus 🚀

**Cosmic Nexus** is a Python package under the `cosmiclode` monorepo designed to provide robust and efficient database connectivity. It simplifies working with PostgreSQL, MySQL, and SQL Server by offering a unified interface with context management, error handling, and Pandas integration.

---

## ✨ Features

- **Database Abstraction**: Consistent interface across supported databases.
- **Connection Management**: Automatic connection handling and pooling (if supported).
- **Factory Pattern**: Easily create connectors using `DBConnectorFactory`.
- **Context Management**: Ensures clean resource management with `with` blocks.
- **Error Handling**: Custom exceptions for clear debugging.
- **Pandas Integration**: Query results are returned as DataFrames.

---

## 📦 Installation

```bash
pip install cosmiclode.cosmic-nexus
```
To install database-specific extras:

```bash
pip install "cosmiclode.cosmic-nexus[postgresql]"
pip install "cosmiclode.cosmic-nexus[mysql]"
pip install "cosmiclode.cosmic-nexus[sqlserver]"
```

## 🚀 Quick Start

```python
from cosmiclode.cosmic_nexus import DBConnectorFactory
from cosmiclode.cosmic_nexus.exceptions import ConnectionError, QueryError

config = {
    "type": "postgresql",
    "host": "localhost",
    "database": "my_db",
    "user": "user",
    "password": "pass",
    "port": 5432
}

try:
    connector = DBConnectorFactory.create_connector(config)
    with connector as db:
        df = db.execute_query("SELECT * FROM my_table;")
        print(df)
except (ConnectionError, QueryError) as e:
    print(f"Error: {e}")
```

## 📚 Usage Notes

- Use `%s` placeholders for parameters to avoid SQL injection.
- SQL Server requires a full ODBC connection string in the config.

```python
sqlserver_config = {
    "type": "sqlserver",
    "connection_string": "DRIVER={ODBC Driver 17 for SQL Server};SERVER=...;UID=...;PWD=..."
}
```


## 📝 License  
This project is licensed under the MIT License.

---

## ✨ Author  
**Vinod Yerrapureddy**  
📧 yerrapureddyvinodreddy@gmail.com  
🌐 [vinodreddy.netlify.app](https://vinodreddy.netlify.app)  
🔗 [LinkedIn](https://linkedin.com/in/your-profile)  
🍥 Anime fan | 💻 Data engineer | 🛠️ Systems hacker

