python fis mtm/pip sql/rpc接口
fispip的Python项目详细描述
https://github.com/fopina/pygtm
的继任者安装
只需使用pip:
$ pip install pyfispip
或者从github安装最新版本:
$ pip install git+https://github.com/fopina/pyfispip/
用法
在代码中使用它(检查examples文件夹):
>>>fromfispipimportPIP>>>pip=PIP()>>>pip.connect('localhost',61315,'1','XXX')>>>pip.executeSQL('SELECT TJD FROM CUVAR')(['60960'],['D'])
或快速使用cli:
$ python -m fispip -h usage: __main__.py [-h][-u USER][-p PWD][-P PORT][-S TYPE][-s] host params [params ...] Python FIS MTM/PIP SQL/RPC Interface positional arguments: host Hostname to connect params For RPC: MRPC_ID [MRPC_PARAM1 [MRPC_PARAM...]] For SQL: SQL_STATEMENT optional arguments: -h, --help show this help message and exit -u USER, --user USER PIP Username (default: 1) -p PWD, --password PWD PIP Password (default: XXX) -P PORT, --port PORT MTM port (default: 61315) -S TYPE, --server TYPE PIP server type(default: SCA$IBS) -s, --sql Execute SQL statement (default action is RPC) $ python -m fispip localhost -s select tjd from cuvar 60960