Metadata-Version: 2.1
Name: import-r
Version: 0.1
Summary: Enables importing R packages and files (like python modules) in python syntax via rpy2.
Home-page: https://github.com/mwort/python-r-import
Author: Michel Wortmann
Author-email: michel.wortmann@ouce.ox.ac.uk
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Provides-Extra: rcli
Provides-Extra: test
License-File: LICENSE

# Python-style imports of R files and packages

An rpy2 wrapper package to enable Python-style imports of R files and packages
and expose them as commandline tools (based on python-fire), including automatic pandas
object conversion if it is installed.

## Setup
```
pip install import-r
```

## Usage
Import any R installed package or R file in your working dir or on either `$RPYPATH` or `$R_LIBS` paths
like any other python module:
```
    from r import test
    import r.test as rtest
    from r import ggplot2
    import r
    r.path.append('dir/to/my/rfiles')
    from r import my_rfile
```
### Commandline interface
Install with cli support (`pip install import-r[cli]`) and then use R files and packages on the commandline
like this:
```
    rcli utils install_packages ggplot2
    rcli path/to/my/rfile.R function1 --arg=2 --flag
```

### Test and release
```
pip install .[test]
pytest
python setup.py sdist
twine upload dist/*
```
Once everything passed successfully, tag and push to github:
```
version=0.1
git commit -m "Release v${version}."
git tag "v$version"
git push; git push --tags
```

## Credit
Michel Wortmann <michel.wortmann@ouce.ox.ac.uk>

MIT Licence


