A Python package from the DS library collection
Project description
ds-provider-postgresql-py-lib
A PostgreSQL provider for the DS resource plugin ecosystem.
Installation
pip install ds-provider-postgresql-py-lib
Features
- PostgreSQL linked service with connection pooling and health checks.
- PostgreSQL dataset implementation with support for:
read()create()update()upsert()delete()purge()
- DS resource typing via:
ds.resource.linked_service.postgresqlds.resource.dataset.postgresql
Usage
Public exports
from ds_provider_postgresql_py_lib import (
PostgreSQLDataset,
PostgreSQLDatasetSettings,
PostgreSQLLinkedService,
PostgreSQLLinkedServiceSettings,
__version__,
)
Minimal linked service example
import os
import uuid
from ds_provider_postgresql_py_lib import (
PostgreSQLLinkedService,
PostgreSQLLinkedServiceSettings,
)
linked_service = PostgreSQLLinkedService(
id=uuid.uuid4(),
name="postgres-linked-service",
version="1.0.0",
settings=PostgreSQLLinkedServiceSettings(
uri=os.getenv("DATABASE_URI", ""),
),
)
linked_service.connect()
ok, message = linked_service.test_connection()
print(ok, message)
Minimal dataset read example
import os
import uuid
from ds_provider_postgresql_py_lib import (
PostgreSQLDataset,
PostgreSQLDatasetSettings,
PostgreSQLLinkedService,
PostgreSQLLinkedServiceSettings,
)
from ds_provider_postgresql_py_lib.dataset.postgresql import ReadSettings
dataset = PostgreSQLDataset(
id=uuid.uuid4(),
name="postgres-dataset",
version="1.0.0",
linked_service=PostgreSQLLinkedService(
id=uuid.uuid4(),
name="postgres-linked-service",
version="1.0.0",
settings=PostgreSQLLinkedServiceSettings(
uri=os.getenv("DATABASE_URI", ""),
),
),
settings=PostgreSQLDatasetSettings(
schema="public",
table="test",
read=ReadSettings(limit=10),
),
)
dataset.linked_service.connect()
dataset.read()
print(dataset.output)
Requirements
- Python 3.11+
- See
pyproject.tomlfor the full dependency set.
Documentation
- Repository: https://github.com/grasp-labs/ds-provider-postgresql-py-lib
- Docs: https://grasp-labs.github.io/ds-provider-postgresql-py-lib/
Development
git clone https://github.com/grasp-labs/ds-provider-postgresql-py-lib.git
cd ds-provider-postgresql-py-lib
uv sync --all-extras --dev
make test
License
Apache-2.0. See LICENSE-APACHE.
Support
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 ds_provider_postgresql_py_lib-0.1.0b1.tar.gz.
File metadata
- Download URL: ds_provider_postgresql_py_lib-0.1.0b1.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33f062baeae9541e12a39f825537c6626c72f7a0c0d0623ed400ea58cfeb213e
|
|
| MD5 |
8e67dd2926c3626b1d995d2d212dfd39
|
|
| BLAKE2b-256 |
508dab111796f95d44ce527d188403bdca6371a3a1d7065e38e4a2784d57b08f
|
File details
Details for the file ds_provider_postgresql_py_lib-0.1.0b1-py3-none-any.whl.
File metadata
- Download URL: ds_provider_postgresql_py_lib-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
623d6bea055ecf5875907eaeadc7a17ccf7e4c81c88bc7d6a3d8b061a6086836
|
|
| MD5 |
ab2174040daec55b5c36dc3395723b21
|
|
| BLAKE2b-256 |
462100410f72aecc5b9943de84f3973890f2228d1d8f905892d1f980d792efa0
|