Skip to main content

Python Transbase Client

Project description

transbase-python

pypi version test

A python client for transbase based on tci implementing python database api v2.0 (PEP-249)

Python 3.9
Transbase 8.4.1

Install

Transbase is available in PyPi

pip install transbase

Example

from transbase import transbase

# change to your transbase connection
client = transbase.connect("//localhost:8024/dbtest", "admin", "admin")

cursor = client.cursor()

cursor.execute("select * from systable")
row = cursor.fetchone()
print(row)

cursor.close()
client.close()

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

cursor.execute("insert into cashbook values (42, default, 100, 'INSERT');");
print(cursor.rowcount) # -> 1

Query parameters can be passed as second argument

# pass parameters as object matching named parameters
cursor.execute(
    "select * from cashbook where nr >= :nr and comment like :comment",
    {"nr": "1", "comment": "Lu%"},
)

# or as an array for positional parameters
cursor.execute(
    "select * from cashbook where nr >= ? and comment like ?",
    ["1", "Lu%"]
)

Troubleshooting

TCI SDK not found

If no prebuild binary wheel could be found on PyPi for your os 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.4.tar.gz (10.4 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.4-cp39-cp39-win_amd64.whl (947.7 kB view details)

Uploaded CPython 3.9Windows x86-64

transbase-0.0.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: transbase-0.0.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for transbase-0.0.4.tar.gz
Algorithm Hash digest
SHA256 87ae18e5efe43912ad0a2c1b50676b777146f086fc6483831acef3707c2cebc3
MD5 7f3a641feae5d2ab08a49adbb7ac236b
BLAKE2b-256 8c52c0d495a41df0027d7dfba645c1023065acdd5291a5aa4bc948c20411934c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transbase-0.0.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 947.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for transbase-0.0.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9c25632a0db771d13552b8e0d3e7c9d4520f724ee2a39d4e34a9678cb8a227c2
MD5 dbcf7fd5f7e8165f8c66beab20fe9c45
BLAKE2b-256 1c42fad1e71ed036d88b3738a6eb1a38c07306a69e8533ce596561017ba7658d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transbase-0.0.4-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.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for transbase-0.0.4-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6a1a7d6fae965d76697839731f917fa1e2eb2cceb66ea649de3da90a4616d6de
MD5 f145d59e1ef4efa0ddbc23d8e2acb539
BLAKE2b-256 fe8af27bc9f3c816b6512caea22bdf4ed055ea29fced2344fe426f993e96de46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transbase-0.0.4-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.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for transbase-0.0.4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fe1fe63c37e0e91fe69c6983fa8a855ffed0194e8824cb573ede82730c8b000b
MD5 c9a13fbf783d16245f55c808244b9007
BLAKE2b-256 8c35e60b823f086e821901c0bef016998543132d66e915f8994577359ac4627a

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