Index: source/python/classes/GribTools.py
===================================================================
--- source/python/classes/GribTools.py	(revision 274f9efe4b8438ab5238967e39adc200c624b56e)
+++ source/python/classes/GribTools.py	(revision 2e62398d43c2586c3df4e4f2916fb5f6cfa4f56d)
@@ -44,14 +44,9 @@
 # ------------------------------------------------------------------------------
 import os
-from gribapi import grib_new_from_file, grib_is_defined, grib_get, \
-     grib_release, grib_set, grib_write, grib_index_read, \
-     grib_index_new_from_file, grib_index_add_file,  \
-     grib_index_write
-
-
-# from eccodes import (codes_grib_new_from_file, codes_is_defined, codes_get,
-                     # codes_release, codes_set, codes_write, codes_index_read,
-                     # codes_index_new_from_file, codes_index_add_file,
-                     # codes_index_write)
+
+from eccodes import (codes_grib_new_from_file, codes_is_defined, codes_get,
+                     codes_release, codes_set, codes_write, codes_index_read,
+                     codes_index_new_from_file, codes_index_add_file,
+                     codes_index_write)
 
 # ------------------------------------------------------------------------------
@@ -109,5 +104,5 @@
 
         while 1:
-            gid = grib_new_from_file(fileid)
+            gid = codes_new_from_file(fileid)
 
             if gid is None:
@@ -121,9 +116,9 @@
             i = 0
             for wherekey in wherekeynames:
-                if not grib_is_defined(gid, wherekey):
+                if not codes_is_defined(gid, wherekey):
                     raise Exception("where key was not defined")
 
                 select = (select and (str(wherekeyvalues[i]) ==
-                                      str(grib_get(gid, wherekey))))
+                                      str(codes_get(gid, wherekey))))
                 i += 1
 
@@ -131,8 +126,8 @@
                 llist = []
                 for key in keynames:
-                    llist.extend([str(grib_get(gid, key))])
+                    llist.extend([str(codes_get(gid, key))])
                 return_list.append(llist)
 
-            grib_release(gid)
+            codes_release(gid)
 
         fileid.close()
@@ -182,5 +177,5 @@
 
         while 1:
-            gid = grib_new_from_file(fin)
+            gid = codes_new_from_file(fin)
 
             if gid is None:
@@ -193,9 +188,9 @@
             i = 0
             for wherekey in wherekeynames:
-                if not grib_is_defined(gid, wherekey):
+                if not codes_is_defined(gid, wherekey):
                     raise Exception("where Key was not defined")
 
                 select = (select and (str(wherekeyvalues[i]) ==
-                                      str(grib_get(gid, wherekey))))
+                                      str(codes_get(gid, wherekey))))
                 i += 1
 
@@ -203,10 +198,10 @@
                 i = 0
                 for key in keynames:
-                    grib_set(gid, key, keyvalues[i])
+                    codes_set(gid, key, keyvalues[i])
                     i += 1
 
-            grib_write(gid, fout)
-
-            grib_release(gid)
+            codes_write(gid, fout)
+
+            codes_release(gid)
 
         fin.close()
@@ -250,5 +245,5 @@
 
         while 1:
-            gid = grib_new_from_file(fin)
+            gid = codes_new_from_file(fin)
 
             if gid is None:
@@ -261,19 +256,19 @@
             i = 0
             for key in keynames:
-                if not grib_is_defined(gid, key):
+                if not codes_is_defined(gid, key):
                     raise Exception("Key was not defined")
 
                 if selectWhere:
                     select = (select and (str(keyvalues[i]) ==
-                                          str(grib_get(gid, key))))
+                                          str(codes_get(gid, key))))
                 else:
                     select = (select and (str(keyvalues[i]) !=
-                                          str(grib_get(gid, key))))
+                                          str(codes_get(gid, key))))
                 i += 1
 
             if select:
-                grib_write(gid, fout)
-
-            grib_release(gid)
+                codes_write(gid, fout)
+
+            codes_release(gid)
 
         fin.close()
@@ -306,5 +301,5 @@
 
         if os.path.exists(index_file):
-            iid = grib_index_read(index_file)
+            iid = codes_index_read(index_file)
             print("Use existing index file: %s " % (index_file))
         else:
@@ -312,10 +307,10 @@
                 print("Inputfile: %s " % (filename))
                 if iid is None:
-                    iid = grib_index_new_from_file(filename, index_keys)
+                    iid = codes_index_new_from_file(filename, index_keys)
                 else:
-                    grib_index_add_file(iid, filename)
+                    codes_index_add_file(iid, filename)
 
             if iid is not None:
-                grib_index_write(iid, index_file)
+                codes_index_write(iid, index_file)
 
         print('... index done')
