pyRserve


NamepyRserve JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/ralhei/pyRserve
SummaryA Python client to remotely access the R statistic package via network
upload_time2023-07-03 09:38:53
maintainer
docs_urlNone
authorRalph Heinkel
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4
licenseMIT license
keywords r rserve
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            Overview
=========

What pyRserve does
------------------

pyRserve is a library for connecting Python to `R  <http://www.r-project.org/>`_
(an excellent statistic package). Running `Rserve <http://www.rforge.net/Rserve/>`_
in R attaches the R-interpreter to a network socket, waiting for pyRserve to connect to it.
Through such a connection, variables can be get and set in R from Python,
and also R-functions can be called remotely.

In contrast to `rpy or rpy2 <https://rpy2.github.io/>`_ the R process does not have to
run on the same machine, it can run on a remote machine and all variable  access and
function calls will be delegated there through the network.

Furthermore - and this makes everything feel very pythonic - all data structures will
automatically be converted from native R to native Python and numpy types and back.


Supported platforms
----------------------------

This package has been mainly developed under Linux, and hence should run on all standard unix
platforms, as well as on MacOS. pyRserve has also been successfully used on Windows machines.
Unittests have been used on the Linux and MacOS side, however they might just work fine for Windows.

It has been tested to work with Python 2.7.x, 3.6 to 3.9.

The latest development has been tested with some previous and current versions of R and Rserve.

License
-------
pyRserve has been written by Ralph Heinkel `(ralph-heinkel.com) <https://ralph-heinkel.com/>`_ and is
released under `MIT license <https://github.com/ralhei/pyRserve/blob/master/LICENSE>`_.


Quick installation
-------------------
From your unix/macOS,windows command line run::

    pip install pyRserve

For a fully functional setup also R and Rserve have to be installed. See section
`installation <https://pyrserve.readthedocs.io/en/latest/installation.html>`_ in the pyRserve
documentation for instructions.


Quick usage
------------
Open a **first shell** and start up the R server, by calling the module `Rserve` that provides
the actual network connectivity for R::

    $ R CMD Rserve

R (Rserve) will now listen on port 6311 (on localhost). Of course Rserve can be configured to
listen on an exposed port and hence will be accessible from remote hosts as well.

Open a **second shell**, start Python, import pyRserve, and initialize the connection to Rserve::

    $ python
    >>> import pyRserve
    >>> conn = pyRserve.connect()

The default connection will be done on ``localhost:6311``. Other hosts can be reached by
calling ``pyRserve.connect(host=..., port=...)`` as well.


The ``conn`` object provides a namespace called ``conn.r`` that directly maps all variables
and other global symbols (like functions etc) and hence makes them accessible from Python.

Now create a vector in R, access the vector from Python (will be converted into a numpy array), and
call the ``sum()``-function in R::

    >>> conn.r("vec <- c(1, 2, 4)")
    >>> conn.r.vec                 # access vector 'vec' as an attribute of 'conn.r'
    array([1., 2., 4.])
    >>> conn.r.sum(conn.r.vec)     # 'sum' in running in the R-interpreter, returning the result to Python
    7.0

The other way around also works::

    >>> conn.r.somenumber = 444         # set a variable called 'somenumber' in the R interpreter...
    >>> conn.r("somenumber * 2")        # ... and double the number
    888.0


Source code repository
----------------------
pyRserve is now hosted on GitHub at `<https://github.com/ralhei/pyRserve>`_.


Documentation
----------------
Documentation can be found at `<https://pyrserve.readthedocs.io>`_.


Support
--------
For discussion of pyRserve and getting help please use the Google newsgroup
available at `<http://groups.google.com/group/pyrserve>`_.

Issues with the code (like bugs, etc.) should be reported on GitHub at
`<https://github.com/ralhei/pyRserve/issues>`_.


Missing features
-----------------
* Authentication is implemented in Rserve but not yet in pyRserve
* TLS encryption is not implemented yet in pyRserve. However using ssh tunnels
  can solve security issues in the meantime (see documentation).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ralhei/pyRserve",
    "name": "pyRserve",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4",
    "maintainer_email": "",
    "keywords": "R Rserve",
    "author": "Ralph Heinkel",
    "author_email": "rh@ralph-heinkel.com",
    "download_url": "https://files.pythonhosted.org/packages/71/51/b48fcaa750645788bc935f397b979bab078ed52840bb5c6796e9bb7d62cb/pyRserve-1.0.2.tar.gz",
    "platform": "unix",
    "description": "Overview\n=========\n\nWhat pyRserve does\n------------------\n\npyRserve is a library for connecting Python to `R  <http://www.r-project.org/>`_\n(an excellent statistic package). Running `Rserve <http://www.rforge.net/Rserve/>`_\nin R attaches the R-interpreter to a network socket, waiting for pyRserve to connect to it.\nThrough such a connection, variables can be get and set in R from Python,\nand also R-functions can be called remotely.\n\nIn contrast to `rpy or rpy2 <https://rpy2.github.io/>`_ the R process does not have to\nrun on the same machine, it can run on a remote machine and all variable  access and\nfunction calls will be delegated there through the network.\n\nFurthermore - and this makes everything feel very pythonic - all data structures will\nautomatically be converted from native R to native Python and numpy types and back.\n\n\nSupported platforms\n----------------------------\n\nThis package has been mainly developed under Linux, and hence should run on all standard unix\nplatforms, as well as on MacOS. pyRserve has also been successfully used on Windows machines.\nUnittests have been used on the Linux and MacOS side, however they might just work fine for Windows.\n\nIt has been tested to work with Python 2.7.x, 3.6 to 3.9.\n\nThe latest development has been tested with some previous and current versions of R and Rserve.\n\nLicense\n-------\npyRserve has been written by Ralph Heinkel `(ralph-heinkel.com) <https://ralph-heinkel.com/>`_ and is\nreleased under `MIT license <https://github.com/ralhei/pyRserve/blob/master/LICENSE>`_.\n\n\nQuick installation\n-------------------\nFrom your unix/macOS,windows command line run::\n\n    pip install pyRserve\n\nFor a fully functional setup also R and Rserve have to be installed. See section\n`installation <https://pyrserve.readthedocs.io/en/latest/installation.html>`_ in the pyRserve\ndocumentation for instructions.\n\n\nQuick usage\n------------\nOpen a **first shell** and start up the R server, by calling the module `Rserve` that provides\nthe actual network connectivity for R::\n\n    $ R CMD Rserve\n\nR (Rserve) will now listen on port 6311 (on localhost). Of course Rserve can be configured to\nlisten on an exposed port and hence will be accessible from remote hosts as well.\n\nOpen a **second shell**, start Python, import pyRserve, and initialize the connection to Rserve::\n\n    $ python\n    >>> import pyRserve\n    >>> conn = pyRserve.connect()\n\nThe default connection will be done on ``localhost:6311``. Other hosts can be reached by\ncalling ``pyRserve.connect(host=..., port=...)`` as well.\n\n\nThe ``conn`` object provides a namespace called ``conn.r`` that directly maps all variables\nand other global symbols (like functions etc) and hence makes them accessible from Python.\n\nNow create a vector in R, access the vector from Python (will be converted into a numpy array), and\ncall the ``sum()``-function in R::\n\n    >>> conn.r(\"vec <- c(1, 2, 4)\")\n    >>> conn.r.vec                 # access vector 'vec' as an attribute of 'conn.r'\n    array([1., 2., 4.])\n    >>> conn.r.sum(conn.r.vec)     # 'sum' in running in the R-interpreter, returning the result to Python\n    7.0\n\nThe other way around also works::\n\n    >>> conn.r.somenumber = 444         # set a variable called 'somenumber' in the R interpreter...\n    >>> conn.r(\"somenumber * 2\")        # ... and double the number\n    888.0\n\n\nSource code repository\n----------------------\npyRserve is now hosted on GitHub at `<https://github.com/ralhei/pyRserve>`_.\n\n\nDocumentation\n----------------\nDocumentation can be found at `<https://pyrserve.readthedocs.io>`_.\n\n\nSupport\n--------\nFor discussion of pyRserve and getting help please use the Google newsgroup\navailable at `<http://groups.google.com/group/pyrserve>`_.\n\nIssues with the code (like bugs, etc.) should be reported on GitHub at\n`<https://github.com/ralhei/pyRserve/issues>`_.\n\n\nMissing features\n-----------------\n* Authentication is implemented in Rserve but not yet in pyRserve\n* TLS encryption is not implemented yet in pyRserve. However using ssh tunnels\n  can solve security issues in the meantime (see documentation).\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "A Python client to remotely access the R statistic package via network",
    "version": "1.0.2",
    "project_urls": {
        "Changelog": "https://pyrserve.readthedocs.io/en/latest/changelog.html",
        "Documentation": "https://pyrserve.readthedocs.io/",
        "Homepage": "https://github.com/ralhei/pyRserve",
        "PyPI": "https://pypi.org/project/pyRserve/",
        "Tracker": "https://github.com/ralhei/pyRserve/issues"
    },
    "split_keywords": [
        "r",
        "rserve"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "abda044a8d6348d7680a9b8053c5dddd1957ee1b73d8bff9b884bb69c18fa2fd",
                "md5": "dc0e6ca0b1558e96f0471542faeb9e85",
                "sha256": "5119c9f642b3a309c16ca153b280925215140346be7b457090dbcf791a43bbca"
            },
            "downloads": -1,
            "filename": "pyRserve-1.0.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dc0e6ca0b1558e96f0471542faeb9e85",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4",
            "size": 32493,
            "upload_time": "2023-07-03T09:38:51",
            "upload_time_iso_8601": "2023-07-03T09:38:51.239251Z",
            "url": "https://files.pythonhosted.org/packages/ab/da/044a8d6348d7680a9b8053c5dddd1957ee1b73d8bff9b884bb69c18fa2fd/pyRserve-1.0.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7151b48fcaa750645788bc935f397b979bab078ed52840bb5c6796e9bb7d62cb",
                "md5": "6daf46707db814deee41217095a6d001",
                "sha256": "323e963994d09b1bdc2896950b5333ed2cc02fcec40175c607c402845c5e58fd"
            },
            "downloads": -1,
            "filename": "pyRserve-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6daf46707db814deee41217095a6d001",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4",
            "size": 31611,
            "upload_time": "2023-07-03T09:38:53",
            "upload_time_iso_8601": "2023-07-03T09:38:53.004169Z",
            "url": "https://files.pythonhosted.org/packages/71/51/b48fcaa750645788bc935f397b979bab078ed52840bb5c6796e9bb7d62cb/pyRserve-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-03 09:38:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ralhei",
    "github_project": "pyRserve",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pyrserve"
}
        
Elapsed time: 0.08465s