bw2io.export#

Submodules#

Package Contents#

Classes#

DatabaseSelectionToGEXF

Export a Gephi graph for a selection of activities from a database.

DatabaseToGEXF

Export a Gephi graph for a database.

Functions#

keyword_to_gephi_graph(database, keyword)

Export a Gephi graph for a database for all activities whose names include the string keyword.

lci_matrices_to_excel(database_name[, include_descendants])

Fake docstring

lci_matrices_to_matlab(database_name)

write_lci_csv(database_name[, objs, sections])

Export database database_name to a CSV file.

write_lci_excel(database_name[, objs, sections])

Export database database_name to an Excel spreadsheet.

class bw2io.export.DatabaseSelectionToGEXF(database, keys)[source]#

Bases: DatabaseToGEXF

Inheritance diagram of bw2io.export.DatabaseSelectionToGEXF

Export a Gephi graph for a selection of activities from a database.

Also includes all inputs for the filtered activities.

Parameters
  • database (*) – Database name.

  • keys (*) – The activity keys to export.

class bw2io.export.DatabaseToGEXF(database, include_descendants=False)[source]#

Bases: object

Export a Gephi graph for a database.

Call .export() to export the file after class instantiation.

Parameters
  • database (*) – Database name.

  • include_descendants (*) – Include databases which are linked from database.

Warning

include_descendants is not yet implemented.

export()#

Export the Gephi XML file. Returns the filepath of the created file.

get_data(E)#

Get Gephi nodes and edges.

bw2io.export.keyword_to_gephi_graph(database, keyword)[source]#

Export a Gephi graph for a database for all activities whose names include the string keyword.

Parameters
  • database (*) – Database name.

  • keyword (*) – Keyword to search for.

Returns

The filepath of the exported file.

bw2io.export.lci_matrices_to_excel(database_name, include_descendants=True)[source]#

Fake docstring

bw2io.export.lci_matrices_to_matlab(database_name)[source]#
bw2io.export.write_lci_csv(database_name, objs=None, sections=None)[source]#

Export database database_name to a CSV file.

Not all data can be exported. The following constraints apply:

  • Nested data, e.g. {‘foo’: {‘bar’: ‘baz’}} are excluded. CSV is not a great format for nested data. However, tuples are exported, and the characters :: are used to join elements of the tuple.

  • The only well-supported data types are strings, numbers, and booleans.

Returns the filepath of the exported file.

bw2io.export.write_lci_excel(database_name, objs=None, sections=None)[source]#

Export database database_name to an Excel spreadsheet.

Not all data can be exported. The following constraints apply:

  • Nested data, e.g. {‘foo’: {‘bar’: ‘baz’}} are excluded. Spreadsheets are not a great format for nested data. However, tuples are exported, and the characters :: are used to join elements of the tuple.

  • The only well-supported data types are strings, numbers, and booleans.

Returns the filepath of the exported file.