Intersystems Cache Object-Relational Mapper based on Intersystems Python Binding module.
This module is an enhanced OOP porting of Intersystems Cache-Python binding. It serves the purpose of an object-relational mapper in python for Intersystems Cache database There are three classes implemented:
-
CacheClient This is the super class of CachePython module. It wraps two functions from intersys.pythonbind module pythonbind3.connection() and pythonbind3.database().
-
CacheQuery A subclass of CacheClient that wraps methods and adds extra functionality in intersys.pythonbind.database and intersys.pythonbind.query classes
-
CacheClass A subclass of CacheClient, that wraps methods and adds extra functionality in intersys.pythonbind.database and intersys.pythonbind.object classes
The intersys.pythonbind package is a Python C extension that provides Python application with transparent connectivity to the objects stored in the Caché database.
The Caché Object Server, a high performance server process, manages communication between Python clients and a Caché database server. It communicates using standard networking protocols (TCP/IP), and can run on any platform supported by Caché.
Open and view cacheorm.py The code released here was originally written and used as a module of TRIADB project.
There are two folders in this release:
- testCacheORM contains python jupyter notebook files that demonstrate CacheQuery and CacheClass
- testCacheBinding are tests written for Intersystems Cache python binding
One can simply compare tests with demos to appreciate the work in this project to leverage intersystems cache python binding.
Currently there is no documentation written for the project. Python jupyter notebooks in testCacheORM folder demonstrate the use of CacheQuery and CacheClass. You may also study the code that is well commented (see cacheorm.py).
I wrote these SocketReceiver, SocketSender classes for Python 3 so now it is super easy for anyone to run a simple TCP socket communication test on two Python consoles. This was done in order to capture "writes" from Caché. In that case you need to redirect your IO and write the data to python console.
Caché provides client-side Python support through the intersys.pythonbind
module, which implements the connection and caching mechanisms required to communicate with a Caché server. This module must be compiled and installed in your environment. Set up your environment variables to support C compilation and linking, as described in the installation guide of Intersystems Cache Python Binding. Also make sure that you are using Python 3 interpreter when you run the setup.
If installation is successful the module will be placed under your python site-packages in a folder with the name pythonbind3-1.0-py3.6-linux-x86_64.egg
. Now you may run any of the sample programs that are provided by Intersystems Cache to verify that Python interpreter references properly intersys.pythonbind
module.
If you passed successfully this stage then download CacheORM, unzip it and rename the folder as CacheORM
. Locate your Python 3 installation and copy the folder under site-packages
e.g. ../lib/python3.6/site-packages/CacheORM/
Finally try to execute my tests and demos. I have also placed jupyter notebook files at my Microsoft Azure library and you can ONLY view them or download and open them locally at your machine (I think you must login first).