Skip to main content

DPT database API wrappers built using SWIG

Project description

Description

This package provides Python applications with the database API used by DPT.

DPT is a multi-user database system for Microsoft Windows.

The Python application can be as simple as a single-threaded process embedding the DPT API.

The package is available only as a source distribution. It is built with the MinGW toolchain and SWIG, either on Microsoft Windows or on Wine on an operating system able to run Wine.

This version of the package is known to work with MinGW-6.3.0 but not with MinGW-5.3.0, MinGW-4.9.3, or MinGW-4.8.1. Use dpt3.0-dptdb-0.6.5, or later 0.6.n versions, with earlier versions of MinGW if necessary.

Setup will download the DPT API source and documentation zip files if an internet connection is available.

There is no separate documentation for Python.

Installation Instructions

Microsoft Windows

Build dependencies

Download and install the MinGW Installation Manager.

Follow the MinGW instructions to install MSYS and at least the MinGW base and gcc-g++ compiler suite.

Download and install SWIG and Python.

Download and install setuptools in Python if not already present.

Use ‘regedit’ to put the directories containing the MinGW runtime in the path: usually C:MinGWbin and C:MinGWlibgccmingw326.3.0 where the 6.3.0 is an example of a compiler version.

Install the package by typing

python setup.py install

at the command prompt of an MSYS shell with setup.py in the current directory.

Runtime dependencies

  • Python 2.6 or later provided the version (2.6 for example) is the same as the Python used to build dptdb.

  • The MinGW runtime used to build dptdb.

Wine

Build dependencies

Download and install Wine.

Download and install the MinGW Installation Manager under Wine.

Follow the MinGW instructions to install at least the MinGW base and gcc-g++ compiler suite. (MSYS is not needed because the host operating system provides those things.)

Download and install Python if not already present. (Your distribution almost certainly provides Python.)

Download and install GNU make if not already present. (Your distribution almost certainly provides GNU make.)

Download and install Microsoft Windows versions of SWIG and Python under Wine.

Download and install setuptools in Python if not already present.

Download and install setuptools in the Python installed under Wine if not already present.

At February 2016 I am not able to install Python 3.4 or Python 3.5 under Wine 1.8 on FreeBSD 10.1 but Python 3.3 is fine. Installation of setuptools, mine is 12.5, on Python 3.3 works if the flavour of Windows reported by Wine is XP. Changing it in an attempt to install Python 3.5 prevented installation of setuptools on Python 3.3.

Use ‘wine regedit’ to put the directories containing the MinGW runtime in the path: usually C:MinGWbin and C:MinGWlibgccmingw326.3.0 where the 6.3.0 is an example of a compiler version.

Install the package by typing

python setup.py install

at the command prompt of a shell with setup.py in the current directory.

Runtime dependencies

  • Python 2.6 or later provided the version (2.6 for example) is the same as the Python used to build dptdb.

  • The MinGW runtime used to build dptdb.

A directory named like dpt3.0_dptdb-0.5-py2.7.egg is put in site-packages by the install command. The name means version 0.5 of dptdb for Python 2.7 wrapping version 3.0 of the DPT API. This directory contains the dptdb and EGG-INFO directories.

The DPT documentation zip file is in the dptdb directory.

Sample code

The dptdb/test directory contains a simple application which populates a database, using some contrived data, and does some simple data retrievals.

This can be run on Microsoft Windows by typing

python pydpt-test.py

at the command prompt of a shell with pydpt-test.py in the current directory.

The equivalent command to run the sample application under Wine is

wine python pydpt-test.py

at the command prompt of a shell with pydpt-test.py in the current directory.

You may need to use ‘<path to python>/python pydpt-test.py’ if several versions of Python are installed.

The sample application offers seven options which create databases with different numbers of records. Each record has 6 fields and all fields are indexed.

One option, called normal, adds 246,625 records to a database in a 16 Mb file in about 3.33 minutes with transaction backout enabled.

The shortest option adds 246,625 records to a database in a 16 Mb file in about 0.6 minutes with transaction backout disabled.

The longest option adds 7,892,000 records to a database in a 526 Mb file in about 18.75 minutes with transaction backout disabled.

The figures are for a 2Gb 667MHz memory, 1.8GHz CPU, solid state drive, Microsoft Windows XP installation.

Restrictions

dptdb cannot be built under the emulators/wine port on FreeBSD amd64. If dptdb does not build under the emulators/i386-wine port on FreeBSD amd64 (I beleive it should but have not succeeded doing so), use the emulators/wine port on FreeBSD i386, on either 32bit or 64bit hardware.

When used under Wine, very large single-step loads will fail through running out of memory because the test to decide when to complete a chunk of the load and start a new one never says ‘do so’. One workaround is to do multi-step loads, potentially a lot slower as explained in relnotes_V2RX.html from DPT_V3R0_DOCS.ZIP, which was the only way to do this before version 2 release 14 of the DPT API. Another is to split the load into small enough chunks somehow before invoking the single-step process for each chunk.

The “Try to force ‘multi-chunk’ on 32Gb memory” option does enough index updating, see slowest option under Sample code for detail, to cause this failure under Wine on a 2Gb memory machine.

This is known to happen on FreeBSD. It is possible it does not happen on other Operating Systems able to run Wine.

Notes

This package is built from DPT_V3R0_DBMS.ZIP, a recent DPT API source code distribution, by default.

You will need the DPT API documentation to use this package. This is included as DBAPI.html in DPT_V3R0_DOCS.ZIP.

The DPT documentation zip file is in a directory named like C:/Python27/Lib/site-packages/dpt3.0_dptdb-0.5-py2.7.egg/dptdb, using the example at the end of Installation Instructions.

The dptapi.py and _dptapi.pyd modules are built using SWIG and MinGW for a particular version of Python. In particular a _dptapi.pyd built for Python 2.6 will work only on Python 2.6 and so on.

The DPT API distribution contains independent scripts and instructions to build dptdb mentioning much earlier versions of the build dependencies.

This package will work only on a Python built for the Microsoft Windows platform.

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

dpt3.0-dptdb-0.7.0.zip (33.8 kB view details)

Uploaded Source

File details

Details for the file dpt3.0-dptdb-0.7.0.zip.

File metadata

  • Download URL: dpt3.0-dptdb-0.7.0.zip
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.6.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

File hashes

Hashes for dpt3.0-dptdb-0.7.0.zip
Algorithm Hash digest
SHA256 2b23bfc2cb9631baf518adcd5572ea6e0cafdf3995b8da1954552c22b7c237de
MD5 dd4e3e0667415869101e590789331e9c
BLAKE2b-256 fc5bd91698df74d08b3272da81eb3b6c8497ee3337831fb2b39edf13b4246185

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page