A lightweight, unified database connector SDK for Python.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datalink_sdk-1.0.0.tar.gz.
File metadata
- Download URL: datalink_sdk-1.0.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f1ddcbf3833b4b659fe928e3d1a94e7d476fc33fdfbbe68569fcdcd8a9faa7b
|
|
| MD5 |
b3264c740da2a452fac11e1b846e34d1
|
|
| BLAKE2b-256 |
2f04c676293291c371dde1873e9ab1506deb06244ad1ef78a2d8ea8d46f95a64
|
Provenance
The following attestation bundles were made for datalink_sdk-1.0.0.tar.gz:
Publisher:
publish.yml on rishabhsingh06029/datalink_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datalink_sdk-1.0.0.tar.gz -
Subject digest:
2f1ddcbf3833b4b659fe928e3d1a94e7d476fc33fdfbbe68569fcdcd8a9faa7b - Sigstore transparency entry: 1161786522
- Sigstore integration time:
-
Permalink:
rishabhsingh06029/datalink_sdk@26b9f9380d1b791ebd34c28f30a7d5f9a70a7d81 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/rishabhsingh06029
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@26b9f9380d1b791ebd34c28f30a7d5f9a70a7d81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file datalink_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: datalink_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63443758c818eeb69c31ae722c1f772814b0cb2e613cfeea43836e3e46cbea9f
|
|
| MD5 |
6fa967513996044417bb20fe90e13926
|
|
| BLAKE2b-256 |
b67d973cd630583e84c08bf2fe5af334d72e3cf2862761604a1f30a3b352020f
|
Provenance
The following attestation bundles were made for datalink_sdk-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on rishabhsingh06029/datalink_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datalink_sdk-1.0.0-py3-none-any.whl -
Subject digest:
63443758c818eeb69c31ae722c1f772814b0cb2e613cfeea43836e3e46cbea9f - Sigstore transparency entry: 1161786763
- Sigstore integration time:
-
Permalink:
rishabhsingh06029/datalink_sdk@26b9f9380d1b791ebd34c28f30a7d5f9a70a7d81 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/rishabhsingh06029
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@26b9f9380d1b791ebd34c28f30a7d5f9a70a7d81 -
Trigger Event:
push
-
Statement type: