Python implementation of the Common Information Model.
Project description
PyCIM is a Python implementation of the IEC Common Information Model. Current features include:
Support for IEC 61970 14v15 and IEC 61968 10v31.
Class and attribute documentation integrated as Python docstrings.
Transparent bi-directional reference handling using Python properties.
CIM RDF/XML parsing and serialisation according to IEC 61970-552.
Installation
PyCIM has no dependencies beyond Python 2.5 or later. It can be easy_installed using setuptools:
$ easy_install PyCIM
Alternatively, download and unpack the tarball and install:
$ tar zxf PyCIM-14.15.tar.gz $ python setup.py install
On UNIX systems, use sudo for the latter command if you need to install the scripts to a directory that requires root privileges:
$ sudo python setup.py install
The development Git repository can be cloned from GitHub:
$ git clone https://github.com/rwl/PyCIM.git
Using PyCIM
To use PyCIM with the Python interpreter, iPython is recommended. For example, to instantiate a ConnecticityNode:
In [1]: from CIM14.IEC61970.Core import ConnectivityNode In [2]: node = ConnectivityNode(name='Node 1')
To associate the node with a Terminal:
In [3]: from CIM14.IEC61970.Core import Terminal In [4]: t = Terminal(name='T1', ConnectivityNode=node) In [5]: node.Terminals[0].name Out[5]: 'T1'
To add a Terminal to a ConnectivityNode:
In [6]: t2 = Terminal() In [7]: node.addTerminals(t2) In [8]: t2.ConnectivityNode.name Out[8]: 'Node 1'
To view the docstring for an attribute:
In [9]: t.connected? Type: bool Base Class: <type 'bool'> String Form: False Namespace: Interactive Docstring: bool(x) -> bool Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
To parse a CIM RDF/XML file:
In[1]: import logging In[2]: logging.basicConfig(level=logging.INFO) In[3]: from PyCIM import cimread In[4]: d = cimread('path/to/input_file.xml') INFO:PyCIM.RDFXMLReader:Created 5660 CIM objects in 1.04s.
The cimread function returns a Python dictionary that maps UUIDs to CIM objects. To serialise the dictionary of objects:
In[5]: from PyCIM import cimwrite In[6]: cimwrite(d, 'path/to/output_file.xml') INFO:PyCIM.RDFXMLWriter:5660 CIM objects serialised in 1.14s.
For further information refer to the API documentation.
License
PyCIM is licensed under the GNU Lesser General Public License version 2.1 to allow commercial use while ensuring it remains free and open source.
Credits
PyCIM is developed by Richard Lincoln (r.w.lincoln@gmail.com).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file PyCIM-14.15.1.tar.gz
.
File metadata
- Download URL: PyCIM-14.15.1.tar.gz
- Upload date:
- Size: 568.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a510b882ef0e63b03f1a551e74e654940a2951f182c6d9e432d2e901e103b03 |
|
MD5 | 37845161eefb9794ca31fa55b2ac5330 |
|
BLAKE2b-256 | 6bb3713bece49cee6a5f1832fe169541faabdcb6006c6dbaadecfc196065aa49 |
File details
Details for the file PyCIM-14.15.1.win32.exe
.
File metadata
- Download URL: PyCIM-14.15.1.win32.exe
- Upload date:
- Size: 887.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb974f9012f23d7d12582ba5a56f92c6119775dce16b8e15299a576677b39439 |
|
MD5 | 6d409779e59d8625628f821328b8edf0 |
|
BLAKE2b-256 | 8f037e853294464fe624a6f260e246b3651276a072cbdfcfd99458ec728fc846 |
File details
Details for the file PyCIM-14.15.1.win32-py2.6.msi
.
File metadata
- Download URL: PyCIM-14.15.1.win32-py2.6.msi
- Upload date:
- Size: 557.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63daab1303873f11f021f98dec5a3f743cce474dac7779c0723d52637129d724 |
|
MD5 | 95a4599fac3df332684707521c3aabe9 |
|
BLAKE2b-256 | 4cb0c107f912f6566318fbe01820f3ac12704f1a91dfd8f71192b7fe895619dd |
File details
Details for the file PyCIM-14.15.1-py2.6.egg
.
File metadata
- Download URL: PyCIM-14.15.1-py2.6.egg
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58e10b179725ce2baad7d0bb833d77e731486bb2f877c8724785f44c83e02d81 |
|
MD5 | 8e32e3c41b08485f750a4f7f592666c2 |
|
BLAKE2b-256 | 575b21b4c0b6963bc27e9caea2d3a7bbba84f0215216271fd267fdea25ceaee8 |
File details
Details for the file PyCIM-14.15.1-py2.5.egg
.
File metadata
- Download URL: PyCIM-14.15.1-py2.5.egg
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4751e1c4d6a04c98d3be4d2792cec4a13967ab5ae55da3f91b6a923d40d2fbd7 |
|
MD5 | 703d41b273c1956cf4e52da2b9457ee4 |
|
BLAKE2b-256 | 5ce0e4a8f46e3003f089eb0ce361fcc44b905411fc0f9dc3559f5d9910e7b1a6 |