Renku Python Library, CLI and Service — Renku 0.11.2.dev14+dirty documentation

Join us on GitHub

# Renku Python Library, CLI and Service

A Python library for the Renku collaborative data science platform. It includes a CLI and SDK for end-users as well as a service backend. It provides functionality for the creation and management of projects and datasets, and simple utilities to capture data provenance while performing analysis tasks.

NOTE:

  `renku-python` is the python library and core service for Renku - it does not start the Renku platform itself - for that, refer to the Renku docs on running the platform.

## Renku for Users

### Installation

Renku releases and development versions are available from PyPI. You can install it using any tool that knows how to handle PyPI packages. Our recommendation is to use :code:pipx.

#### `pipx`

First, install pipx and make sure that the `$PATH` is correctly configured.

    $ python3 -m pip install --user pipx
    $ pipx ensurepath

Once `pipx` is installed use following command to install `renku`.

    $ pipx install renku
    $ which renku
    ~/.local/bin/renku

`pipx` installs renku into its own virtual environment, making sure that it does not pollute any other packages or versions that you may have already installed.

Note

If you install renku as a dependency in a virtual environment and the environment is active, your shell will default to the version installed in the virtual environment, not the version installed by `pipx`.

To install a development release:

    $ pipx install --pip-args pre renku

#### `pip`

    $ pip install renku

The latest development versions are available on PyPI or from the Git repository:

    $ pip install --pre renku
    # - OR -
    $ pip install -e git+https://github.com/SwissDataScienceCenter/renku-python.git#egg=renku

Use following installation steps based on your operating system and preferences if you would like to work with the command line interface and you do not need the Python library to be importable.

#### Docker

The containerized version of the CLI can be launched using Docker command.

    $ docker run -it -v "$PWD":"$PWD" -w="$PWD" renku/renku-python renku

It makes sure your current directory is mounted to the same place in the container.

## Getting Started

Interaction with the platform can take place via the command-line interface (CLI).

Start by creating for folder where you want to keep your Renku project:

    $ mkdir -p ~/temp/my-renku-project
    $ cd ~/temp/my-renku-project
    $ renku init

Create a dataset and add data to it:

    $ renku dataset create my-dataset
    $ renku dataset add my-dataset https://raw.githubusercontent.com/SwissDataScienceCenter/renku-python/master/README.rst

Run an analysis:

    $ renku run wc < data/my-dataset/README.rst > wc_readme

Trace the data provenance:

    $ renku log wc_readme

These are the basics, but there is much more that Renku allows you to do with your data analysis workflows.

For more information about using renku, refer to the renku –help.

## Project Information

- License
- Authors
- Contributing
- Changes
- Glossary

## Full Table of Contents

- How does this compare …
  - … to `Makefile`
- Renku Command Line
  - `renku` (base command)
  - `renku init`
  - `renku config`
  - `renku dataset`
  - `renku run`
  - `renku log`
  - `renku status`
  - `renku update`
  - `renku rerun`
  - `renku rm`
  - `renku mv`
  - `renku workflow`
  - `renku save`
  - `renku show`
  - `renku storage`
  - `renku doctor`
  - `renku migrate`
  - `renku githooks`
  - Error Tracking
- Models
  - Projects
  - Datasets
  - Provenance
  - Renku Workflow
  - Renku Workflow Conversion
  - Tools and Workflows
  - File References
- Low-level API
  - Datasets
  - Repository
  - Git Internals
- Plugin Support
  - `renku run` hooks