Skip to main content

A smart and efficient database orchestration layer that simplifies multi-database interactions with intuitive operations and seamless Pandas integration.

Project description

Neuro-DB: Simplifying Multi-Database Interactions in Python

Neuro-DB is a powerful orchestration layer that bridges the gap between developers and databases. It provides an intuitive, unified interface to manage multiple database connections effortlessly, with seamless Pandas integration for querying, inserting, and updating records across multiple database types, including PostgreSQL, MySQL, SQL Server, and SQLite.


Key Features

  • 🔗 Multi-Database Connectivity – Supports PostgreSQL, MySQL, SQL Server, and SQLite.
  • Simplified Operations – Intuitive methods like get_df, upsert_df, and execute_query.
  • 🐼 Seamless Pandas Integration – Read from and write directly to databases using Pandas DataFrames.
  • 🔒 Secure Connection Management – Environment-based credential handling for enhanced security.
  • 📈 Logging & Performance Tracking – Monitor and optimize query execution.
  • ⚙️ Async and Sync Support – Handle operations efficiently with async execution.
  • 🛠 Minimal Setup Required – Easy-to-use interface with powerful functionality.

Installation

Install Neuro-DB via pip:

pip install neuro-db

Quick Start

1. Configure your databases

from neuro_db import DatabaseManager

db_configs = {
    "postgres_main": {
        "dialect": "postgresql",
        "user": "admin",
        "password": "securepass",
        "host": "localhost",
        "port": 5432,
        "database": "company_db"
    }
}

db = DatabaseManager(db_configs)

2. Perform database operations

Fetch data as a Pandas DataFrame

df = db.get_df("postgres_main", "SELECT * FROM employees WHERE department = %s", params=("HR",))
print(df.head())

Upsert data from a Pandas DataFrame

import pandas as pd

data = pd.DataFrame([
    {"id": 1, "name": "Alice", "department": "HR"},
    {"id": 2, "name": "Bob", "department": "IT"}
])

db.upsert_df("postgres_main", "employees", data, unique_key="id")

Write DataFrame directly to a table

df.to_sql("employees_backup", db.get_connection("postgres_main"), if_exists="replace", index=False)

Execute raw SQL queries

result = db.execute_query("postgres_main", "UPDATE employees SET status = %s WHERE id = %s", params=("active", 1))

Supported Databases

Neuro-DB supports the following databases out of the box:

  • PostgreSQL (via psycopg2)
  • MySQL/MariaDB (via pymysql)
  • SQL Server (via pyodbc)
  • SQLite (built-in Python module)

Configuration Options

You can configure Neuro-DB via environment variables or a YAML/JSON configuration file.
Example YAML config:

databases:
  mysql_db:
    dialect: mysql
    user: root
    password: password123
    host: localhost
    port: 3306
    database: sales_db

  sqlite_db:
    dialect: sqlite
    database: my_local.db

Why Choose Neuro-DB?

  • Unified API Across Databases – Work consistently across different database systems.
  • Boost Productivity – Focus on building applications without database complexity.
  • Optimized Performance – Built-in query optimizations and best practices.
  • Production-Ready – With logging, retries, and error handling baked in.

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Submit a pull request.

License

This project is licensed under the Apache 2.0 License – free to use with attribution.


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

neurodb-0.0.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurodb-0.0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file neurodb-0.0.1.tar.gz.

File metadata

  • Download URL: neurodb-0.0.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for neurodb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 55215a7fdf015ea5b87c20a331c68ca32b6eecf231b01734b928e8c472f348af
MD5 804eadef98e1f9ec7e10ccf1ad62a4b7
BLAKE2b-256 5c5e7f615099f6ba4b8fdb7891e86bd752885906ced9ad7a885295675e0a8da9

See more details on using hashes here.

File details

Details for the file neurodb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: neurodb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for neurodb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90d264c4e790fc57b5e00f4bf954090223f183b73305d4a9734ae37812dc6f30
MD5 637f9d9222ccd971992317e7d31f751e
BLAKE2b-256 b88a1f64ba5d8efa1dffef8eb305d6d398aa21d01106a99cb8c6b0ae59975d99

See more details on using hashes here.

Supported by

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