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.6.tar.gz (12.9 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.6-cp39-cp39-win_amd64.whl (927.0 kB view details)

Uploaded CPython 3.9Windows x86-64

transbase-0.0.6-cp39-cp39-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

transbase-0.0.6-cp39-cp39-macosx_11_0_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

File details

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

File metadata

  • Download URL: transbase-0.0.6.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for transbase-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e8aee25ad8c806ddebb9a8824070cfccc93d0261e31b47f6d0c421a25ab1008a
MD5 cc4bae63d7885ca99e2595321726bdf8
BLAKE2b-256 e5d880c0f0084fc180f87e667cb0259175cc1651d5d1e6001b4af3e5dadc36e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transbase-0.0.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 927.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for transbase-0.0.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 51265b3093d6f30ff96557eed40103806f74366064a40da6ea0e9f76ca316af5
MD5 c1e3fe6ea0bfd64a8f668a2ec4c5acbe
BLAKE2b-256 c66abd78791888d092a4e09e975e58297fcbba48d978dcd7e6f3b93f3c92ca5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transbase-0.0.6-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0c50c7be5cd96930d3b4a3b4637c78e4700829cfcd5b38a7d506b99e13425661
MD5 49c05a63ad6df258a30d09e7735141f9
BLAKE2b-256 3e6ebae1f9fb23c5e000a483878328dcc4c4377d21c27fd58c2f1586491e0559

See more details on using hashes here.

File details

Details for the file transbase-0.0.6-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for transbase-0.0.6-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 aab72d857b6a88b9dae5609cdf2cbcaf1f4dccc1034dc6c811011e601bbc24df
MD5 49ff48f0a70f7ab86ce7d0c709fe4ae3
BLAKE2b-256 8b14f11f1f40a1688d7ed167726d1f3fad488d939c5108cc1c8e94dadadbc18e

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