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%"]
)

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.3.tar.gz (8.7 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.3-cp39-cp39-win_amd64.whl (946.5 kB view details)

Uploaded CPython 3.9Windows x86-64

transbase-0.0.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: transbase-0.0.3.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for transbase-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f4342a15ebdd7f147cf7623ab180cb4e07ea8babfe4b0b7635da49fe033cd2a5
MD5 d586f57d106410eaf3191acc23b7aa2c
BLAKE2b-256 8cf1c54d236c2045d53c12d66fd5e41e190be0763071848a0f6d129d5dd20f29

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transbase-0.0.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 946.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for transbase-0.0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ca72998f92fb2b4bd15c5a4653483a1c5b3194424b8d657abe886aefcaadaf4b
MD5 17e495f865e5d1b14fb5795899a939b6
BLAKE2b-256 962926b35008484434f1cc3baf277ff147b55b6e2699f4fe415a698ecfa40866

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transbase-0.0.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for transbase-0.0.3-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4afe30a68974f6f45d347d7d7bc4cc7000aaf3df0691ebdb4d609cfdddd96578
MD5 f50fb4ea974ddb0208b8d7e0bc7194fd
BLAKE2b-256 2f21b3de4aed8a354d430a059f80c00b9f10f010c14812ba3c014ebf60d381b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transbase-0.0.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for transbase-0.0.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 20530d90367d2d21659c77f626c6be08dcea6bcba9026f7d88d1d10257629588
MD5 7a25039cbf7e7800c0c25dfc75f025cc
BLAKE2b-256 13e49b393e010ac63122838bcde2251dacfb2f26bf6dcf61d8047d3e90345010

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