Chris Mutel avatar Chris Mutel committed a0151d0

Made conversion more verbose

Comments (0)

Files changed (1)

 It looks like you need to upgrade to the ``stats_arrays`` package. This is a new statistical toolkit that replaces the deprecated ``bw_stats_toolkit``. Read more at (
-To do this, enter a Python interpreter, and run the following:
+To do this, use `pip` (or whatever package manager you prefer) to install `stats_arrays`, e.g.:
+    pip install stats_arrays
+Then, enter a Python interpreter, and run the following:
     from bw2data.utils import convert_from_stats_toolkit
-Then leave the Python interpreter, and install the ``stats_arrays`` package, something like this:
-    pip install stats_arrays
     sa = None
     for database in databases:
         print "Working on %s" % database
         db = Database(database)
+        print "\t... loading ..."
         data = db.load()
-        for key, value in data:
+        print "\t... converting ..."
+        new_data = {}
+        for index, (key, value) in enumerate(data.iteritems()):
             if 'exchanges' in value:
                 value['exchanges'] = [update_exchange(exchange
                     ) for exchange in value['exchanges']]
-            data[key] = value
-        db.write(data)
+            new_data[key] = value
+        print "\t... writing ..."
+        db.write(new_data)
-    print "Conversion finished"
+    print "Conversion finished\n"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.