Google Refine -> OpenRefine
This commit is contained in:
parent
eade7dafe0
commit
bbd4d84c96
16
README.rst
16
README.rst
|
@ -1,9 +1,9 @@
|
|||
===================================
|
||||
Google Refine Python Client Library
|
||||
OpenRefine Python Client Library
|
||||
===================================
|
||||
|
||||
The Google Refine Python Client Library provides an interface to
|
||||
communicating with a Google Refine server.
|
||||
The OpenRefine Python Client Library provides an interface to
|
||||
communicating with an `OpenRefine <http://openrefine.org/>`_ server.
|
||||
|
||||
Currently, the following API is supported:
|
||||
|
||||
|
@ -43,8 +43,8 @@ Currently, the following API is supported:
|
|||
Configuration
|
||||
=============
|
||||
|
||||
By default the Google Refine server URL is http://127.0.0.1:3333
|
||||
The environment variables ``GOOGLE_REFINE_HOST`` and ``GOOGLE_REFINE_PORT``
|
||||
By default the OpenRefine server URL is http://127.0.0.1:3333
|
||||
The environment variables ``OPENREFINE_HOST`` and ``OPENREFINE_PORT``
|
||||
enable overriding the host & port.
|
||||
|
||||
In order to run all tests, a live Refine server is needed. No existing projects
|
||||
|
@ -103,6 +103,12 @@ One aspect of development is watching HTTP transactions. To that end, I found
|
|||
format JSON but the `Online JavaScript Beautifier <http://jsbeautifier.org/>`_
|
||||
will.
|
||||
|
||||
History
|
||||
=======
|
||||
|
||||
OpenRefine used to be called Google Refine, and this library used to be called
|
||||
the Google Refine Python Client Library.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
Google Refine Facets, Engine, and Facet Responses.
|
||||
OpenRefine Facets, Engine, and Facet Responses.
|
||||
"""
|
||||
|
||||
# Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
Google Refine history: parsing responses.
|
||||
OpenRefine history: parsing responses.
|
||||
"""
|
||||
|
||||
# Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved.
|
||||
|
|
|
@ -33,8 +33,8 @@ import urlparse
|
|||
from google.refine import facet
|
||||
from google.refine import history
|
||||
|
||||
REFINE_HOST = os.environ.get('GOOGLE_REFINE_HOST', '127.0.0.1')
|
||||
REFINE_PORT = os.environ.get('GOOGLE_REFINE_PORT', '3333')
|
||||
REFINE_HOST = os.environ.get('OPENREFINE_HOST', os.environ.get('GOOGLE_REFINE_HOST', '127.0.0.1'))
|
||||
REFINE_PORT = os.environ.get('OPENREFINE_PORT', os.environ.get('GOOGLE_REFINE_PORT', '3333'))
|
||||
|
||||
|
||||
class RefineServer(object):
|
||||
|
@ -245,7 +245,7 @@ def RowsResponseFactory(column_index):
|
|||
|
||||
|
||||
class RefineProject:
|
||||
"""A Google Refine project."""
|
||||
"""An OpenRefine project."""
|
||||
|
||||
def __init__(self, server, project_id=None):
|
||||
if not isinstance(server, RefineServer):
|
||||
|
|
|
@ -37,9 +37,9 @@ from google.refine import refine
|
|||
PARSER = optparse.OptionParser(
|
||||
usage='usage: %prog [--help | OPTIONS] [project ID/URL]')
|
||||
PARSER.add_option('-H', '--host', dest='host',
|
||||
help='Google Refine hostname')
|
||||
help='OpenRefine hostname')
|
||||
PARSER.add_option('-P', '--port', dest='port',
|
||||
help='Google Refine port')
|
||||
help='OpenRefine port')
|
||||
PARSER.add_option('-o', '--output', dest='output',
|
||||
help='Output filename')
|
||||
# Options that are more like commands
|
||||
|
|
4
setup.py
4
setup.py
|
@ -26,8 +26,8 @@ def read(filename):
|
|||
|
||||
setup(name='refine-client',
|
||||
version='0.2.1',
|
||||
description=('The Google Refine Python Client Library provides an '
|
||||
'interface to communicating with a Google Refine server.'),
|
||||
description=('The OpenRefine Python Client Library provides an '
|
||||
'interface to communicating with an OpenRefine server.'),
|
||||
long_description=read('README.rst'),
|
||||
author='Paul Makepeace',
|
||||
author_email='paulm@paulm.com',
|
||||
|
|
|
@ -4,7 +4,7 @@ test_refine.py
|
|||
|
||||
These tests require a connection to a Refine server either at
|
||||
http://127.0.0.1:3333/ or by specifying environment variables
|
||||
GOOGLE_REFINE_HOST and GOOGLE_REFINE_PORT.
|
||||
OPENREFINE_HOST and OPENREFINE_PORT.
|
||||
"""
|
||||
|
||||
# Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved.
|
||||
|
@ -37,7 +37,7 @@ class RefineServerTest(refinetest.RefineTestCase):
|
|||
self.assertTrue(item in version_info)
|
||||
|
||||
def test_version(self):
|
||||
self.assertTrue(self.server.version in ('2.0', '2.1'))
|
||||
self.assertTrue(self.server.version in ('2.0', '2.1', '2.5'))
|
||||
|
||||
|
||||
class RefineTest(refinetest.RefineTestCase):
|
||||
|
|
|
@ -9,7 +9,7 @@ changes expected to be observed explained in the tutorial.
|
|||
|
||||
These tests require a connection to a Refine server either at
|
||||
http://127.0.0.1:3333/ or by specifying environment variables
|
||||
GOOGLE_REFINE_HOST and GOOGLE_REFINE_PORT.
|
||||
OPENREFINE_HOST and OPENREFINE_PORT.
|
||||
"""
|
||||
|
||||
# Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved.
|
||||
|
|
Loading…
Reference in New Issue