{ "info": { "author": "drestebon", "author_email": "sanestebon@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4" ], "description": "SClib\n=====\n\nA simple hack that allows easy and straightforward evaluation of C functions\nwithin python code, boosting flexibility for better trade-off between\ncomputation power and feature availability, such as visualization and existing\ncomputation routines in SciPy.\n\n\nAt the core of SClib [#]_ is ctypes [Hell]_, which actually does the whole\nwork: it maps Python data to C compatible data and provides a way to call\nfunctions in DLLs or shared libraries. SClib acts as glue: it puts things\ntogether for the user, to provide him with an easy to use interface.\n\n.. [#] The code for SClib and example use are availible at \n\nThe requirements for SClib are very simple: call a function on an array of\nnumbers of arbitrary type and size and return the output of the function, again\nof arbitrary type and size.\n\nThe resulting interface is also very simple: A library is initialized in the\npython side with the path to the DLL (or shared library) and a list with the\nnames of the functions to be called:\n\n.. code-block:: python\n\n In [1]: import SClib as sc\n In [2]: lib = sc.Clib('test.so', ['fun'])\n\nThe functions are then available as a members of the library and can be called\nwith the appropriate number of arguments, which are one dimensional arrays of\nnumbers. The function returns a list containing the output arrays of the\nfunction:\n\n.. code-block:: python\n\n In [3]: out, = lib.fun([0])\n\nIn the C counterpart, the function declaration must be accompanied with\nspecifications of the inputs and outputs lengths and types. This is\naccomplished with the helper macros defined in sclib.h:\n\n.. code-block:: c\n\n #include \n PYO(fun, 1, 1);\n PYO_TYPES(fun, 1, INT);\n PYI(fun, 1, 1);\n PYI_TYPES(fun, 1, INT);\n void fun(int * out, int * in) {\n *out = 42;\n }\n\nAn arbitrary number of inputs or outputs can be specified, for example:\n\n.. code-block:: c\n\n #include \n #include \n PYO(fun, 2, 1, 2);\n PYO_TYPES(fun, 2, INT, FLOAT);\n PYI(fun, 2, 1, 2);\n PYI_TYPES(fun, 2, INT, FLOAT);\n void fun(int * out0, float * out1,\n int * in0, float * in1) {\n *out0 = 42*in0[0];\n out1[0] = in1[0]*in1[1];\n out1[1] = powf(in1[0], in1[1]);\n }\n\nIn the function declaration, all the outputs must precede the inputs and must\nbe placed in the same order as in the PY macros.\n\nThese specifications are processed during compilation time, but only the number\nof inputs and outputs is static, the lengths of each component can be\noverridden at run time:\n\n.. code-block:: python\n\n In [4]: lib.INPUT_LEN['fun'] = [10, 1]\n In [5]: lib.retype()\n\nIn these use cases the length of the arguments should be given to the function\nthrough an extra integer argument.\n\nIn the function body, both inputs and outputs should be treated as one\ndimensional arrays.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/drestebon/SClib", "keywords": "C libraries", "license": "GPLv2", "maintainer": null, "maintainer_email": null, "name": "SClib", "package_url": "https://pypi.org/project/SClib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/SClib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/drestebon/SClib" }, "release_url": "https://pypi.org/project/SClib/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "wrapper for C functions", "version": "1.0.0" }, "last_serial": 1212648, "releases": { "1.0.0": [ { "comment_text": "built for Linux-3.16.1-1-ARCH-x86_64-with-glibc2.3.4", "digests": { "md5": "03125e906e420eee46873ada92750298", "sha256": "9f9d6776055d5f188cd8ce3dfa184c6a796665086b069b239edc77f100b2c6ab" }, "downloads": -1, "filename": "SClib-1.0.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "03125e906e420eee46873ada92750298", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 6720, "upload_time": "2014-09-04T10:10:15", "url": "https://files.pythonhosted.org/packages/3e/fd/d27880221579b65d231b0150c0d7e1b10a850cc7d103c87323188c1000e0/SClib-1.0.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "e590858f42050e24ec0021b12cab6cb2", "sha256": "0057bbfc3bee874a5c0100d31d80d80afb702a609e1d568e8a02323fd3e2ad8f" }, "downloads": -1, "filename": "SClib-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e590858f42050e24ec0021b12cab6cb2", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6783, "upload_time": "2014-09-04T10:10:18", "url": "https://files.pythonhosted.org/packages/8c/4a/d5e3576dd665368494b3e6e61dba0499cd434de10ab9496ecaf1fa0c5e56/SClib-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91ecbf892389d69e9503ab393e2ae8f3", "sha256": "9f9e8d15652bd02b638c3e5bbaf55fc2e23d6e2d6e990669fb134777a32fbf66" }, "downloads": -1, "filename": "SClib-1.0.0.tar.gz", "has_sig": false, "md5_digest": "91ecbf892389d69e9503ab393e2ae8f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5650, "upload_time": "2014-09-04T10:10:12", "url": "https://files.pythonhosted.org/packages/90/de/343fd8a2b84e7c355f6b1db8cbc828542d9e651637f14dd2ccda6b1139f0/SClib-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-3.16.1-1-ARCH-x86_64-with-glibc2.3.4", "digests": { "md5": "03125e906e420eee46873ada92750298", "sha256": "9f9d6776055d5f188cd8ce3dfa184c6a796665086b069b239edc77f100b2c6ab" }, "downloads": -1, "filename": "SClib-1.0.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "03125e906e420eee46873ada92750298", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 6720, "upload_time": "2014-09-04T10:10:15", "url": "https://files.pythonhosted.org/packages/3e/fd/d27880221579b65d231b0150c0d7e1b10a850cc7d103c87323188c1000e0/SClib-1.0.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "e590858f42050e24ec0021b12cab6cb2", "sha256": "0057bbfc3bee874a5c0100d31d80d80afb702a609e1d568e8a02323fd3e2ad8f" }, "downloads": -1, "filename": "SClib-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e590858f42050e24ec0021b12cab6cb2", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6783, "upload_time": "2014-09-04T10:10:18", "url": "https://files.pythonhosted.org/packages/8c/4a/d5e3576dd665368494b3e6e61dba0499cd434de10ab9496ecaf1fa0c5e56/SClib-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91ecbf892389d69e9503ab393e2ae8f3", "sha256": "9f9e8d15652bd02b638c3e5bbaf55fc2e23d6e2d6e990669fb134777a32fbf66" }, "downloads": -1, "filename": "SClib-1.0.0.tar.gz", "has_sig": false, "md5_digest": "91ecbf892389d69e9503ab393e2ae8f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5650, "upload_time": "2014-09-04T10:10:12", "url": "https://files.pythonhosted.org/packages/90/de/343fd8a2b84e7c355f6b1db8cbc828542d9e651637f14dd2ccda6b1139f0/SClib-1.0.0.tar.gz" } ] }