Comments (10)
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.
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.
@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.
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.
from python-itoolkit.
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.
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.
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.
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.
It just calls an XMLSERVICE stored procedure, nothing too special ;)
Glad you got it working.
from python-itoolkit.
Related Issues (20)
- Drop Python 3.4 Support HOT 4
- _direct.py needs more test coverage
- Add type declarations HOT 17
- Transports need a way to indicate failure HOT 1
- Deprecate the trace functions for standard logging
- Run cl command to create a library in an IASP via DirectTransport on a French system failed HOT 1
- On Japanese or French systems run command via DatabaseTransport fails with ibm_db_dbi::Error HOT 3
- Provide a close() API to close database connections
- PyPI page is outdated HOT 5
- Is there a problem with the Japanese environment in iCmd5250 xml output? HOT 3
- What itoolkit version allows qtemp schema table access using iSqlQuery? HOT 6
- Improve README links on PyPI HOT 3
- RTVJOBA example works only with CCSID=37 HOT 3
- Errors using JayDeBeApi HOT 8
- DatabaseTransport should not close a connection HOT 14
- Stderr handling in SSH Transport can yield wrong results
- Running itool.call ends the program and does nothing HOT 7
- XML Special Character errors/handling HOT 1
- Fix license headers on source files HOT 2
- Error calling Receive DataQ API - QRCVDTAQ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-itoolkit.