added chapter usage with examples

This commit is contained in:
Felix Lohmeier 2017-11-19 23:29:45 +01:00
parent 2061e804c3
commit 28b4c7466b
1 changed files with 20 additions and 11 deletions

View File

@ -5,20 +5,27 @@ OpenRefine Python Client Library
The OpenRefine Python Client Library provides an interface to The OpenRefine Python Client Library provides an interface to
communicating with an `OpenRefine <http://openrefine.org/>`_ server. communicating with an `OpenRefine <http://openrefine.org/>`_ server.
If you are looking for a ready to use command line interface to OpenRefine then you might be interested in the docker variation of this library: Usage
`felixlohmeier/openrefine-client <https://hub.docker.com/r/felixlohmeier/openrefine-client/>`_. You will find examples for batch processing (e.g. for usage in shell scripts) there. =====
If you are familiar with python and want to go into more depth, then read on!
Features
=============
Command line interface: Command line interface:
- list projects: refine.py --list - list all projects: ``python refine.py --list``
- create project from file: refine.py --create [FILE] - create project from file: ``python refine.py --create [FILE]``
- apply `rules from json file <http://kb.refinepro.com/2012/06/google-refine-json-and-my-notepad-or.html>`_: refine.py --apply [FILE.json] [PROJECTID] - apply `rules from json file <http://kb.refinepro.com/2012/06/google-refine-json-and-my-notepad-or.html>`_: ``python refine.py --apply [FILE.json] [PROJECTID/PROJECTNAME]``
- export project to file: refine.py --export [PROJECTID] --output=FILE.tsv - export project to file: ``python refine.py --export [PROJECTID/PROJECTNAME] --output=FILE.tsv``
- show project metadata: ``python refine.py --info [PROJECTID/PROJECTNAME]``
- delete project: ``python refine.py --delete [PROJECTID/PROJECTNAME]``
- check ``python refine.py --help`` for further options...
If you are familiar with python you may try all functions interactively (``python -i refine.py``) or use this library in your own python scripts. Some Examples:
* show version of OpenRefine server: ``refine.RefineServer().get_version()``
* show total rows of project 2151545447855: ``refine.RefineProject(refine.RefineServer(),'2151545447855').do_json('get-rows')['total']``
* compute clusters of project 2151545447855 and column key: ``refine.RefineProject(refine.RefineServer(),'2151545447855').compute_clusters('key')``
Features
=============
Currently, the following API is supported: Currently, the following API is supported:
@ -118,6 +125,8 @@ One aspect of development is watching HTTP transactions. To that end, I found
format JSON but the `Online JavaScript Beautifier <http://jsbeautifier.org/>`_ format JSON but the `Online JavaScript Beautifier <http://jsbeautifier.org/>`_
will. will.
Executables may be built with `pyinstaller <http://www.pyinstaller.org>`_.
History History
======= =======