Skip to main content

DataLink SDK

A lightweight, unified database connector SDK for Python. Connect to MySQL, PostgreSQL, MongoDB, and Redis using a single consistent interface.


Installation

pip install datalink-sdk

Supported Databases

Driver Key
MySQL mysql
PostgreSQL postgres
MongoDB mongodb
Redis redis

Quick Start

from datalink_sdk import DataLinkClient

# MySQL
conn = DataLinkClient.get_connection("mysql", {
    "host": "localhost",
    "user": "root",
    "password": "secret",
    "database": "mydb",
    "port": 3306,
})

# PostgreSQL
conn = DataLinkClient.get_connection("postgres", {
    "host": "localhost",
    "user": "postgres",
    "password": "secret",
    "database": "mydb",
    "port": 5432,
})

# MongoDB
conn = DataLinkClient.get_connection("mongodb", {
    "uri": "mongodb://localhost:27017",
})

# Redis
conn = DataLinkClient.get_connection("redis", {
    "host": "localhost",
    "port": 6379,
    "password": None,
})

Exception Handling

from datalink_sdk import DataLinkClient, DataLinkConnectionError, UnsupportedDriverError

try:
    conn = DataLinkClient.get_connection("mysql", config)
except DataLinkConnectionError as e:
    print(f"Connection failed: {e}")
except UnsupportedDriverError as e:
    print(f"Unknown driver: {e}")

Exceptions Reference

Exception When raised
DataLinkException Base exception for all DataLink SDK errors
DataLinkConnectionError Connection to the database failed
UnsupportedDriverError Driver type not recognised
DataLinkConfigError Configuration is invalid or missing fields

Project Structure

datalink_sdk/
├── core/
│   ├── base_driver.py       # Abstract base class for all drivers
│   ├── client.py            # DataLinkClient — main entry point
│   └── exceptions.py        # All SDK exceptions
├── drivers/
│   ├── mysql.py
│   ├── postgres.py
│   ├── mongodb.py
│   └── redis.py
└── config/
    └── settings.py

License

MIT

Release files for datalink-sdk 1.0.0

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

Source distribution (sdist)

Source distribution for datalink-sdk 1.0.0
File Size Uploaded
datalink_sdk-1.0.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datalink-sdk 1.0.0
File Interpreter ABI Platform
datalink_sdk-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 kB

Release history Release notifications | RSS feed

This release

1.0.0 This release

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