bw2data.backends.utils
#
Module Contents#
Functions#
|
Check exchange data validity when processing |
|
Convert a Database to another backend. |
|
Replace |
|
Transform data from SQLite representation to Python objects. |
- bw2data.backends.utils.convert_backend(database_name, backend)[source]#
Convert a Database to another backend.
bw2data currently supports the default and json backends.
- Args:
database_name (unicode): Name of database.
backend (unicode): Type of database. backend should be recoginized by DatabaseChooser.
Returns False if the old and new backend are the same. Otherwise returns an instance of the new Database object.
- bw2data.backends.utils.replace_cfs(old_key, new_key)[source]#
Replace
old_key
withnew_key
in characterization factors.Returns list of modified methods.
- bw2data.backends.utils.retupleize_geo_strings(value)[source]#
Transform data from SQLite representation to Python objects.
We are using a SQLite3 cursor, which means that the Peewee data conversion code is not called. So
('foo', 'bar')
is stored as a string, not a tuple. This code tries to do this conversion correctly.TODO: Adapt what Peewee does in this case?