Skip to main content

Unofficial Python DB-API 2.0 connector for Tibero

Project description

pytibero

CI PyPI version

Unofficial Python DB-API 2.0 connector for Tibero

pytibero provides a Pythonic DB-API 2.0 interface for Tibero databases. The current implementation uses pyodbc as the transport backend and wraps Tibero ODBC connectivity behind a clean, package-owned API surface.

This is an independent community project and is not officially supported by TmaxSoft. This project is not affiliated with TmaxSoft.

Why pytibero

  • Python DB-API 2.0 compatible module surface
  • Direct host/port or DSN-based Tibero ODBC connections
  • Optional tbcli backend for Tibero's native client library path
  • Explicit autocommit plus routed pyodbc.connect(...) keyword support
  • Package-owned exception hierarchy and type constructors
  • Safe access to common pyodbc connection metadata such as getinfo(...)
  • Dockerized unit-test workflow with a 95% coverage target
  • Docker-based end-to-end test harness for licensed Tibero environments

Installation

Python package

pip install pytibero

System requirements

  • Python 3.10+
  • pyodbc
  • unixODBC or an equivalent ODBC manager
  • A Tibero ODBC driver installed on the host or in the container

Quick Start

import pytibero

with pytibero.connect(
    host="localhost",
    port=8629,
    database="test",
    user="tibero",
    password="tmax",
) as conn:
    cursor = conn.cursor()
    cursor.execute("SELECT 1 FROM dual")
    print(cursor.fetchall())

DSN connection

import pytibero

conn = pytibero.connect(dsn="TIBERO_TEST", user="tibero", password="tmax")

Native tbcli backend

import pytibero

conn = pytibero.connect(
    host="localhost",
    port=8629,
    database="test",
    user="tibero",
    password="tmax",
    backend="tbcli",
    tbcli_library="/opt/tibero7/client/lib/libtbcli.so",
)

backend="tbcli" uses Tibero's native CLI library instead of pyodbc. This path is intended for environments where the vendor client library is available locally.

Advanced connection options

import pytibero

conn = pytibero.connect(
    host="localhost",
    user="tibero",
    password="tmax",
    autocommit=True,
    readonly=True,
    ansi=False,
    ApplicationName="pytibero-app",
)

print(conn.getinfo(17))

readonly, ansi, and similar pyodbc.connect(...) options are forwarded as native connect kwargs, while additional values such as ApplicationName stay in the ODBC connection string.

Testing

Unit tests in Docker

make test-docker

This runs the package test suite inside Docker and enforces a 95% coverage threshold.

End-to-end tests in Docker

export TIBERO_LICENSE_FILE=/abs/path/to/license.xml
make test-e2e-docker

The e2e flow expects a licensed Tibero Docker image and a valid license file. See docs/testing.md for the required environment variables.

Documentation

Project Layout

pytibero/
    __init__.py
    connection.py
    cursor.py
    exceptions.py
    types.py
    protocol.py
    config.py
    tbcli.py
tests/
docs/

License

Apache License 2.0. See LICENSE.

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

pytibero-0.1.0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

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

pytibero-0.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file pytibero-0.1.0.tar.gz.

File metadata

  • Download URL: pytibero-0.1.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytibero-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b60dc36fe11b9a42cf6a26bb4e417ffaa5f942464ce7286692ad01fd092b405
MD5 e91ea6c53edf7010ab79fdba4186816e
BLAKE2b-256 bcc993a8f7783476962bf5ac6d29ce7148ccb1d9f0cab6ea1b715db741edfdf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytibero-0.1.0.tar.gz:

Publisher: publish-pypi.yml on yeongseon/pytibero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytibero-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytibero-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytibero-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d23510ed0d6ad30b7e799538aefb9a0613c1866c1aad74632021c42434ef4345
MD5 592308f9392a8bed3e927f02ccbce568
BLAKE2b-256 48f8f674ceb3c1102b2215f9d40c79d62d9665ee3c4cfffa307c7c15276fec5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytibero-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on yeongseon/pytibero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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