Skip to main content

Python helper package for interacting with Cardano DB Sync databases

Project description

dbsync-py

Test Suite Documentation PyPI version Python Support License

Python helper package for interacting with Cardano DB Sync databases.

This package provides SQLModel-based ORM models and utilities for interacting with Cardano DB Sync PostgreSQL databases, enabling type-safe access to Cardano blockchain data.

Installation

pip install dbsync-py

Configuration

dbsync-py supports multiple ways to configure database connections:

Option 1: Environment File (.env)

Copy sample.env to .env and modify the values:

cp sample.env .env
# Edit .env with your database configuration

Option 2: Environment Variables

Set environment variables directly:

export DBSYNC_HOST=localhost
export DBSYNC_PORT=5432
export DBSYNC_DATABASE=cexplorer
export DBSYNC_USERNAME=your_username
export DBSYNC_PASSWORD=your_password

Option 3: Complete Database URL

export DBSYNC_DATABASE_URL=postgresql://username:password@localhost:5432/cexplorer

Quick Start

import dbsync_py

# Test database connection
from dbsync_py.utils import quick_connection_check
if quick_connection_check():
    print("✅ Database connection successful!")
else:
    print("❌ Database connection failed")

# Use database sessions
from dbsync_py.session import get_session_context
with get_session_context() as session:
    result = session.execute("SELECT version()")
    print(result.scalar())

Development Status

This project is currently in development. Core database connection utilities are implemented.

License

Apache-2.0

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

dbsync_py-1.1.2.tar.gz (288.4 kB view details)

Uploaded Source

Built Distribution

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

dbsync_py-1.1.2-py3-none-any.whl (102.5 kB view details)

Uploaded Python 3

File details

Details for the file dbsync_py-1.1.2.tar.gz.

File metadata

  • Download URL: dbsync_py-1.1.2.tar.gz
  • Upload date:
  • Size: 288.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dbsync_py-1.1.2.tar.gz
Algorithm Hash digest
SHA256 f5fa86b078613b7ca55f6ecad4b1b5f83779f01f2aac2850a988f1737dd0a36e
MD5 2f7661cceb601a84eac2f4b86b2e3ed4
BLAKE2b-256 1c01f6fc888d6462311f6ae5c4f4df30d191e52ceb6940bf282aa11793fdf779

See more details on using hashes here.

File details

Details for the file dbsync_py-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: dbsync_py-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 102.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dbsync_py-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b61e5da12122e87ce304a1de2c8647637d30de0e75c527e9f94512b9722aa561
MD5 8ba8ec2fa04f201dfcd4df7c79715937
BLAKE2b-256 a8b5a9d9abd299610643758d34c8eaf1883f610c93ad48ed4032523ce6725e2f

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