# adapya: Adabas API for Python with LOB Demo Center Example

**URL:** <https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Windows-UNIX, Adabas-Code-Samples\
**Created:** [September 2, 2008, 8:53pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909 "2008-09-02T20:53:08Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [September 2, 2008, 8:53pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/1 "2008-09-02T20:53:08Z")

</div>

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](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](https://techcommunity.softwareag.com/uploads/short-url/gcl9pl2SkAgS6Ylwm3aRGecPJXN.pdf) (479 KB)  
[adapya-0.7.0.zip](https://techcommunity.softwareag.com/uploads/short-url/d1mHUsSksyaA4uzeGDyd92wdXv5.zip) (1.2 MB)

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [September 3, 2008, 11:56am UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/2 "2008-09-03T11:56:31Z")

</div>

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

☹

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [September 3, 2008, 1:51pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/3 "2008-09-03T13:51:28Z")

</div>

[url][http://www.python.org/download/other/[/url]](http://www.python.org/download/other/%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [September 3, 2008, 2:15pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/4 "2008-09-03T14:15:43Z")

</div>

Hi Matthias,

our Solaris didn’t have Python installed either.

This is the recommended install

```auto
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](http://sunfreeware.com/programlistsparc9.html#python)

For the LOB Demo we installed also:

- modpython from source at [http://www.modpython.org/](http://www.modpython.org/)
- PIL (imaging library) [http://www.pythonware.com/products/pil/](http://www.pythonware.com/products/pil/)
- a JPEG decoder from [http://www.ijg.org/](http://www.ijg.org/)  
(files: jpegsrc.v6b.tar.gz)  
see: [http://effbot.org/zone/pil-decoder-jpeg-not-available.htm](http://effbot.org/zone/pil-decoder-jpeg-not-available.htm)

HTH,  
Marbod Mueller

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [September 4, 2008, 4:37pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/5 "2008-09-04T16:37:48Z")

</div>

> [@Marbod Mueller](#):
>
> This is the recommended install

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).

---

<div class="post-metadata">

**Author:** ![Jerod\_Gawne](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jerod\_Gawne](https://techcommunity.softwareag.com/u/Jerod_Gawne)\
**Post date:** [February 11, 2016, 6:05pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/6 "2016-02-11T18:05:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [February 12, 2016, 12:30pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/7 "2016-02-12T12:30:07Z")

</div>

> [@Jerod Gawne](#):
>
> 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](http://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

---

<div class="post-metadata">

**Author:** ![Jerod\_Gawne](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jerod\_Gawne](https://techcommunity.softwareag.com/u/Jerod_Gawne)\
**Post date:** [February 12, 2016, 4:32pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/8 "2016-02-12T16:32:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [February 15, 2016, 11:06am UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/9 "2016-02-15T11:06:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jerod\_Gawne](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jerod\_Gawne](https://techcommunity.softwareag.com/u/Jerod_Gawne)\
**Post date:** [February 25, 2016, 9:23pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/10 "2016-02-25T21:23:00Z")

</div>

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

> [@Marbod Mueller](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Flavio\_Casacurta](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@Flavio\_Casacurta](https://techcommunity.softwareag.com/u/Flavio_Casacurta)\
**Post date:** [January 24, 2017, 8:43pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/11 "2017-01-24T20:43:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [January 25, 2017, 10:08am UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/12 "2017-01-25T10:08:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [January 25, 2017, 11:32am UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/13 "2017-01-25T11:32:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Flavio\_Casacurta](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@Flavio\_Casacurta](https://techcommunity.softwareag.com/u/Flavio_Casacurta)\
**Post date:** [September 21, 2017, 2:42am UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/14 "2017-09-21T02:42:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [September 21, 2017, 11:25am UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/15 "2017-09-21T11:25:48Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Francisco\_Etcheverri](https://avatars.discourse-cdn.com/v4/letter/f/76d3ee/32.png) [@Francisco\_Etcheverri](https://techcommunity.softwareag.com/u/Francisco_Etcheverri)\
**Post date:** [October 18, 2018, 8:37am UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/16 "2018-10-18T08:37:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:50pm UTC](https://techcommunity.softwareag.com/t/adapya-adabas-api-for-python-with-lob-demo-center-example/78909/17 "2021-04-02T14:50:50Z")

</div>


