Databases

Utils functions to manipulate databases

lca_algebraic.resetDb(db_name, foreground=True)[source]

Creates and/or cleanup a database.

Parameters

db_namestr

Name of the database

foreground:

If true (default), the database is set as foreground.

lca_algebraic.deleteDb(db_name)[source]

Delete a database

lca_algebraic.setForeground(db_name)[source]

Set a db as being a foreground database. Foreground databases are considered to be parametric by lca_algebraic. Internally, their activities are developped as Sympy formulas.

lca_algebraic.setBackground(db_name)[source]

Set a db as being a background database.

lca_algebraic considers background databases as bring static / non parametric. It does not perform the algebraic expansion meccanism on them and just call Brightway to compute the impacts for their activities.

lca_algebraic.list_databases()[source]

Returns a pandas dataframe listing all database, their status (foreground/background) and numer of activities

Import / export

lca_algebraic.export_db(db_name, filename)[source]

This function exports a database to the BW2Package format, including the definition of parameters

lca_algebraic.import_db(filename)[source]

Import Db from BW2Package with linked parameters (as produced by export_db)