adapya: Adabas API for Python with LOB Demo Center Example

What is adapya?

With adapya you can access Adabas databases from Python programs using the Adabas API.

It comes with sample programs to show its use and demonstrates new Adabas features like reading and storing of large binary objects using the extended Adabas API (ACBX).

Python is a scripting language that allows rapid prototyping, object-oriented or functional style programming. It is open source and is used in a large number of projects: http://www.python.org

Notes
adapya does not implement a SQL interface as defined with
the Python DBAPI. You may do Adabas DBAPI access with the
product ADABAS SQL Gateway via the ODBC interface.

Working with adapya requires a good knowledge of the Adabas API.

adapya is a pure Python package: it does not require compilation of extensions. It should work on all platforms where CPython and Adabas are available.

It has been tested on Windows, Solaris and z/Linux. It can access local Adabas databases and with the product NET-WORK remote Adabas databases on all platforms including mainframe z/OS, VSE, BS2000).

Prerequisite for adapya is Python version 2.5, or Python version 2.3 and
2.4 where it requires the extra ctypes package.

adapya licensed under Apache License 2.0

Copyright 2004-2008 Software AG

Licensed under the Apache License, Version 2.0 (the “License”);
you may not use ‘adapya’ except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0                            

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
adapya.pdf (479 KB)
adapya-0.7.0.zip (1.2 MB)

$ uname -sr
SunOS 5.10
$ type python
python not found
$ type perl
perl is /usr/bin/perl
$

:frowning:

[url]http://www.python.org/download/other/[/url]

Hi Matthias,

our Solaris didn’t have Python installed either.

This is the recommended install

cd /tmp
rm -dr Python-2.5.2
wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
tar xfz Python-2.5.2.tgz
cd Python-2.5.2
#  Check if you may want other target directories than system
./configure > configure.txt       
make > make.out
# next requires root if installed to system directories
make install                 

Alternatively, prebuilt packages for Python 2.5.1 plus glibcc 3.4 are found here:

http://sunfreeware.com/programlistsparc9.html#python

For the LOB Demo we installed also:

HTH,
Marbod Mueller

Thanks for your detailed instructions. Since I’m not the administrator of our Solaris host, I got no right to install anything (i. e. outsourcing).

Has this been maintained? A lot of the code has been deprecated, is quite non-pythonic, and at times rather hard to follow. A more modern API written in python 3 would be incredibly helpful.

Hello Jerod,
thank you for you interest in adapya.

Quite some time has passed since its first public release and in the meantime Python has evolved with new releases nearly every year. And recently even IBM has made efforts to have ported Python 2.7 to z/OS with the help of rocketsoftware.com!

Development of adapya has continued and the next update could include the following:

  • Python V3 support
  • pip install
  • smaller packages with base, adabas, broker, replication, analytics, etc.
  • deprecation of the Apache mod_python sample web application replaced by Python’s WSGI
  • API documentation with Sphinx

In the meantime, adapya still can be used with the most recent Python 2.7 runtime of which some people say it still performs better than Python 3.

If you have specific requirements that are not covered with adapya feel free to let us know.

Kind regards,
Marbod Mueller

Is there a new download link? The only version I’ve been able to find is the one posted here which is the same as the python package on pypi circa 2008.

Oh no, currently there is no more recent version available.
I am sorry to say that it will take some more time until there is a new one published.

What sort of time-frame would you ascribe this? 6-months-ish, 1-yr-ish, longer?

Following the instructions in the attached PDF, I was able to install the “Adabas Community Edition Free Trial” successfully.

I tried installing “adapya”, also following the instructions of adapya.pdf, but setup.py did not work.

I made the install of the adapya by hand.

When I ran dblist.py I received the following message:

C:\Users\Flavio> python C:\Python27\Scripts\dblist.py -d 1
Traceback (most recent call last):
File “C:\Python27\Scripts\dblist.py”, line 38, in
From adabas.API import *
File “C:\Python27\Lib\site-packages\adabas\API.py”, line 40, in
Adalink = ctypes.cdll.LoadLibrary (‘libadalnkx.so’)
File “C:\Python27\Lib\ctypes__ init__.py”, line 440, in LoadLibrary
Return self.dlltype (name)
File "C:\Python27\Lib\ctypes_
init__.py", line 362, in init
Self._handle = _dlopen (self._name, mode)
WindowsError: [Error 126] The specified module could not be found

In the “C:\SoftwareAG\common\lib” library there is no file “libadalnkx.so”

Can you help me?

Best Regards,
Flávio

Well, on Windows you would be looking for adalnkx.dll which is in C:\SoftwareAG\AdabasClient\bin

The libadalnkx.so was tried because the adalnkx.dll could not be found.

The directory where adalnkx.dll is located should be set in the PATH variable.

Hello, access adabas in local machine from adapya is ok, is possible to access adabas in a remote machine by IP or another method?

Thank’s for advance.

Flávio.

For remote communication the product NET-WORK can be used.
On the machine where the Python program runs either NET-WORK client (WCL) or NET-WORK server for LUW is needed,
on the target machine NET-WORK server.
For local or remote access the program’s interface is always adalnkx

On which platform is your target database ?

I need help, anyone remains in this site ? email me frnncs@gmail.com, I need to conecct to an Adabas DB from python and this installation didn´t work. Plz Help me ?