Giter Site home page Giter Site logo

Comments (10)

deliego avatar deliego commented on May 30, 2024

So I just realised, itoolkit is exclusively for IBM i systems and that is why it cannot find any i Series libraries/headers to install. My goal was to run a python script from a Windows machine using itoolkit to gather data from remote IBM i systems.

from python-itoolkit.

kadler avatar kadler commented on May 30, 2024

The only thing that requires to be built on IBM i is the DirectTransport/iLibCall, since it calls directly via PASE memory. In the master branch, this code was refactored to be buildable on non-IBM i systems, just giving an error if used. I'm not ready to build a new release yet with that code, since there's other things I want to clean up first, however there was a way to disable building the direct transport with the previous code: pip install --global-option=build_ext --global-option='--disable-libcall' itoolkit

This works for me on Linux and should work on Windows too, but I haven't tried.

from python-itoolkit.

jkyeung avatar jkyeung commented on May 30, 2024

@deliego - If "gathering data" just means retrieving data from the database, you don't need itoolkit. You can use pyodbc instead. However, if you mean you want to call programs or service programs (*PGM or *SRVPGM objects) and get their return values, then itoolkit is probably your best choice. In either case, you can use ODBC as the connection between your PC and the IBM i.

One thing you can do to "install" itoolkit without building it is simply to copy the source (the itoolkit directory which is found inside src) to a directory of your choice and use it from there. You could put it in your Python's site-packages if you want.

from python-itoolkit.

deliego avatar deliego commented on May 30, 2024

Thanks @kadler and @jkyeung . I can return to this project again, I was pulled onto another one for a while.
Yes indeed that both methods mentioned place the itoolkit files in the right location but does not compile the direct.c or ilibcall.c into libraries. I am able to gather some data using pyodbc as suggested but that doesn't give me enough and I have to get data that is only available using commands on those systems and then parsing the data. For this I'll need iLibcall.

@kadler You mentioned it's not ready to be released yet. Do you have a "beta" version or know of a workaround? :)

Thank you so much for all your help, much appreciated!

from python-itoolkit.

jkyeung avatar jkyeung commented on May 30, 2024

from python-itoolkit.

kadler avatar kadler commented on May 30, 2024

I think @deliego means he is using pyodbc to query the database but he needs to use itoolkit to call programs and commands which cannot be called directly through pyodbc.

Of course you can do this, it's just not documented:

import pyodbc
from itoolkit.db2.idb2call import iDB2Call

transport = iDB2Call(pyodbc.connect('DSN=mydsn'))
...

And since all of our examples show using iLibCall, it's easy to see how one would come to the assumption that it was required to be able to use itoolkit.

from python-itoolkit.

deliego avatar deliego commented on May 30, 2024

Thanks @kadler. Yes, I need to run commands like "DSPSYSSTS" and others to get job info on remote systems, so the code will not be local to the systems.
Does iDB2Call require the XMLSERVICE enabled on those servers?

from python-itoolkit.

kadler avatar kadler commented on May 30, 2024

The entire product is built around XMLSERVICE, so yes it needs to be installed and enabled on those servers, but this is done out of the box with any recent IBM i release at sufficient PTF level (look for objects in QXMLSERV library). If you want to use the HTTP transport you'll have to set up the XMLSERVICE CGI handler in an Apache instance, but that's not needed for the Database or any other transports.

from python-itoolkit.

deliego avatar deliego commented on May 30, 2024

It works! I'm able to run those commands over my pyodbc conn transport (I really don't know how you do it under the hood, but it works). I didn't have to compile the C libraries either, I was able to use your suggestion of installing it with the --disable-libcall option.

Thanks so much!! :)

from python-itoolkit.

kadler avatar kadler commented on May 30, 2024

It just calls an XMLSERVICE stored procedure, nothing too special ;)

Glad you got it working.

from python-itoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.