Skip to main content

Python Transbase Client

Project description

transbase-python

pypi version test

Python database driver for Transbase
based on Transbase/TCI (Transase C/C++ call interface )
implementing Python database api v2.0 (PEP-249)

Python 3.9
Transbase 8.x

Install

Transbase is available in PyPi

pip install transbase

Example

from transbase import transbase

# connect to transbase database
connection = transbase.connect("//develop.transaction.de:8324/test", "test", "test")

cursor = connection.cursor()

cursor.execute("select no, text, date from test")
# use native python data types in fetch result set (bool, int, float, bytes,...)
# otherwise all values will be fetched as plain "str"
cursor.type_cast = True

row = cursor.fetchone()
print(row)

cursor.close()
connection.close()

DML statements (insert, update, delete) are executed similar.
The number of affected rows can be obtained by .rowcount

cursor.execute("insert into test ( text ) values ( '... kind regards' )");
print(cursor.rowcount) # -> 1

Query parameters can be passed as second argument

# pass parameters as object matching named parameters
cursor.execute(
    "select no, text, date from test where no >= :no and text like :text",
    { "no": 1, "text": "Hello%" }
)

# or as an array for positional parameters
cursor.execute(
    "select no, text, date from test where no >= ? and text like insensitive ?",
    [ 2, "%kind%" ]
)

Troubleshooting

TCI SDK not found

If no prebuild binary wheel could be found on PyPi for your operating system or Python version
you can simply download it after installation by running the python script
(added with installation of this package)

install_tci

Contribution

VS-Code Editor with python extension is recommended.

Development

  • install python 3.9 (TODO: -> 3.11)
  • it is recommended to install and use virtualenv py -m pip install --user virtualenv
  • install required dependencies py -m pip install flake8 coverage requests
  • download tci lib py setup.py get_lib

Test

  • py -m unittest or use vs-code test explorer

Build

Source distribution and wheel including tci sdk

  • py setup.py sdist [bdist_wheel]

Manual Release

Linux wheels need to be renamed matching PEP-600

To publish manually to pypi (or testP) run

  • twine upload [--repository testpypi] dist/*

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

transbase-0.0.5.tar.gz (11.6 kB view details)

Uploaded Source

Built Distributions

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

transbase-0.0.5-cp39-cp39-win_amd64.whl (948.9 kB view details)

Uploaded CPython 3.9Windows x86-64

transbase-0.0.5-cp39-cp39-manylinux_2_34_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

transbase-0.0.5-cp39-cp39-macosx_10_15_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

File details

Details for the file transbase-0.0.5.tar.gz.

File metadata

  • Download URL: transbase-0.0.5.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for transbase-0.0.5.tar.gz
Algorithm Hash digest
SHA256 23d294c84d06c58808fdfaf34ba82219bfae1f96f3b23b34a207a85de89850ec
MD5 ac9f317ea24a6e3add37a433dddf5934
BLAKE2b-256 6a933cac31ea5eaafc2aea34968629b5026f62ba60ca321723dd7fcf53160ce9

See more details on using hashes here.

File details

Details for the file transbase-0.0.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: transbase-0.0.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 948.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for transbase-0.0.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 52acb0c818108ab4dd07c2fb38af25846dbe5ddac73314282fd40cd24376e3bc
MD5 1e70ea962af21630e0ad28a2f130f8b1
BLAKE2b-256 e0a69b28b704a363cff3423f76553bac7e70f75972e233bfcb7996c337dddd4a

See more details on using hashes here.

File details

Details for the file transbase-0.0.5-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: transbase-0.0.5-cp39-cp39-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for transbase-0.0.5-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0d3997fa69301d8d4fed751eb4c23dcc10915578b02d0115c3c05ad818057bc0
MD5 cf109ebfcbb53bedb1079398485e4034
BLAKE2b-256 2086852a48f2c9f29d4d857a09ea7b094d45f91b7b3577c3e136a56b5b78c5aa

See more details on using hashes here.

File details

Details for the file transbase-0.0.5-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: transbase-0.0.5-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for transbase-0.0.5-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8caece9c0552009d615934a02b4ec688d0a41ac96ad688b4e51d749384c05e82
MD5 c91ef87e2abd11ca9dc03a8074177499
BLAKE2b-256 8f748371da3baec877568c9a761668f3b0f2e42bdf119a32311eb771641cdd23

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