Skip to content

Commit

Permalink
update to OpenRefine 3.1 and some basic enhancements by psychemedia (#8)
Browse files Browse the repository at this point in the history
update to OpenRefine 3.1 and some basic enhancements by psychemedia

Co-authored-by: Tony Hirst <[email protected]>
  • Loading branch information
betatim and psychemedia authored Jul 25, 2019
2 parents 02f208c + 6a0c4bc commit 077bbff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@

[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/betatim/openrefineder/master)

[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/betatim/openrefineder/master?urlpath=%2Fopenrefine) (launch open refine)

Small demo of using [OpenRefine](http://openrefine.org/) on binder.
Still under 👷🚧🏗!


# Starting OpenRefine in a binder

## Quickstart

[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/betatim/openrefineder/master?urlpath=%2Fopenrefine) (launch binder with option urlpath=/openrefine)

## From JupyterLab home screen

To access OpenRefine wait for the binder to launch. Then click
"New -> OpenRefine session" on the right hand side of the screen.

Expand Down
11 changes: 7 additions & 4 deletions nbopenrefineproxy/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
from notebook.utils import url_path_join as ujoin

from nbserverproxy.handlers import SuperviseAndProxyHandler

import os

class OpenRefineProxyHandler(SuperviseAndProxyHandler):
name = 'OpenRefine'

def get_cmd(self):
cmd = ['openrefine-2.8/refine',
'-p', str(self.port)
path = os.path.join(os.environ['HOME'], 'openrefine-workspace')
os.makedirs(path, exist_ok=True)
cmd = ['openrefine-3.1/refine',
'-p', str(self.port),
'-d',path
]
return cmd

Expand All @@ -33,6 +36,6 @@ def get(self, *args):
def setup_handlers(web_app):
web_app.add_handlers('.*', [
(ujoin(web_app.settings['base_url'], 'openrefine/(.*)'),
OpenRefineProxyHandler, dict(state={})),
OpenRefineProxyHandler, dict(state={'port':3333})),
(ujoin(web_app.settings['base_url'], 'openrefine'), AddSlashHandler)
])
5 changes: 3 additions & 2 deletions postBuild
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
set -e

wget -q -O openrefine-2.8.tar.gz https://github.com/OpenRefine/OpenRefine/releases/download/2.8/openrefine-linux-2.8.tar.gz
tar xzf openrefine-2.8.tar.gz
wget -q -O openrefine-3.1.tar.gz https://github.com/OpenRefine/OpenRefine/releases/download/3.1/openrefine-linux-3.1.tar.gz
tar xzf openrefine-3.1.tar.gz
rm openrefine-3.1.tar.gz

pip install https://github.com/betatim/nbserverproxy/archive/master.zip
jupyter serverextension enable --py nbserverproxy
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git+https://github.com/dbutlerdb/refine-client-py

0 comments on commit 077bbff

Please sign in to comment.