Skip to main content

Python SDK and CLI for the Renku platform.

Project description

https://img.shields.io/travis/SwissDataScienceCenter/renku-python.svg https://img.shields.io/coveralls/SwissDataScienceCenter/renku-python.svg https://img.shields.io/github/tag/SwissDataScienceCenter/renku-python.svg https://img.shields.io/pypi/dm/renku.svg Documentation Status https://img.shields.io/github/license/SwissDataScienceCenter/renku-python.svg

A Python library for the Renku collaborative data science platform. It allows the user to create projects, manage datasets, and capture data provenance while performing analysis tasks.

NOTE:

renku-python is the python library for Renku that provides an SDK and a command-line interface (CLI). It does not start the Renku platform itself - for that, refer to the Renku docs on running the platform.

Installation

The latest release is available on PyPI and can be installed using pip:

$ pip install renku

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

$ pip install --dev 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.

MacOS

The recommended way of installing Renku on MacOS is via Homebrew.

$ brew tap swissdatasciencecenter/renku
$ brew install renku

Isolated environments using pipx

Install and execute Renku in an isolated environment using pipx. It will guarantee that there are no version conflicts with dependencies you are using for your work and research.

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

Prevously we have recommended to use pipsi. You can still use it or migrate to **pipx**.

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.

Usage

Initialize a 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. The full documentation will soon be available at: https://renku-python.readthedocs.io/

Changes

v0.4.0

(released 2019-03-05)

  • Adds renku mv command which updates dataset metadata, .gitattributes and symlinks.

  • Pulls LFS objects from submodules correctly.

  • Adds listing of datasets.

  • Adds reduced dot format for renku log.

  • Adds doctor command to check missing files in datasets.

  • Moves dataset metadata to .renku/datasets and adds migrate datasets command and uses UUID for metadata path.

  • Gets git attrs for files to prevent duplicates in .gitattributes.

  • Fixes renku show outputs for directories.

  • Runs Git LFS checkout in a worktrees and lazily pulls necessary LFS files before running commands.

  • Asks user before overriding an existing file using renku init or renku runner template.

  • Fixes renku init --force in an empty dir.

  • Renames CommitMixin._location to _project.

  • Addresses issue with commits editing multiple CWL files.

  • Exports merge commits for full lineage.

  • Exports path and parent directories.

  • Adds an automatic check for the latest version.

  • Simplifies issue submission from traceback to GitHub or Sentry. Requires SENTRY_DSN variable to be set and sentry-sdk package to be installed before sending any data.

  • Removes outputs before run.

  • Allows update of directories.

  • Improves readability of the status message.

  • Checks ignored path when added to a dataset.

  • Adds API method for finding ignored paths.

  • Uses branches for init --force.

  • Fixes CVE-2017-18342.

  • Fixes regex for parsing Git remote URLs.

  • Handles --isolation option using git worktree.

  • Renames client.git to client.repo.

  • Supports python -m renku.

  • Allows ‘.’ and ‘-’ in repo path.

v0.3.3

(released 2018-12-07)

  • Fixes generated Homebrew formula.

  • Renames renku pull path to renku storage pull with deprecation warning.

v0.3.2

(released 2018-11-29)

  • Fixes display of workflows in renku log.

v0.3.1

(released 2018-11-29)

  • Fixes issues with parsing remote Git URLs.

v0.3.0

(released 2018-11-26)

  • Adds JSON-LD context to objects extracted from the Git repository (see renku show context --list).

  • Uses PROV-O and WFPROV as provenance vocabularies and generates “stable” object identifiers (@id) for RDF and JSON-LD output formats.

  • Refactors the log output to allow linking files and directories.

  • Adds support for aliasing tools and workflows.

  • Adds option to install shell completion (renku --install-completion).

  • Fixes initialization of Git submodules.

  • Uses relative submodule paths when appropriate.

  • Simplifies external storage configuration.

v0.2.0

(released 2018-09-25)

  • Refactored version using Git and Common Workflow Language.

v0.1.0

(released 2017-09-06)

  • Initial public release as Renga.

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

renku-0.4.1.dev12.tar.gz (160.9 kB view details)

Uploaded Source

Built Distribution

renku-0.4.1.dev12-py2.py3-none-any.whl (154.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file renku-0.4.1.dev12.tar.gz.

File metadata

  • Download URL: renku-0.4.1.dev12.tar.gz
  • Upload date:
  • Size: 160.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for renku-0.4.1.dev12.tar.gz
Algorithm Hash digest
SHA256 6dbbbd88ff7f8bfdca2b7bc144ef2089b5ca67fc97bd6756f201f984dc4924b8
MD5 b3b7c919cc5ced6fd18c2ae5f5ac42be
BLAKE2b-256 54bc5201b8e7b9bbf88531b0c30cdd25e3f6e35e3daa6e3d2ec98023f2a2db62

See more details on using hashes here.

File details

Details for the file renku-0.4.1.dev12-py2.py3-none-any.whl.

File metadata

  • Download URL: renku-0.4.1.dev12-py2.py3-none-any.whl
  • Upload date:
  • Size: 154.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for renku-0.4.1.dev12-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 71630740e1421515a9a535044add744d766d6ff15ad23001d62de04ef5d8d514
MD5 d292f0465dfaaf7d809919f3b93da80c
BLAKE2b-256 f365cd0610f1e0b8109eb280bc0fabd23551e28f77409839429e5bfa6cff74a0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page