bw2io.export
#
Submodules#
Package Contents#
Classes#
Export a Gephi graph for a selection of activities from a database. |
|
Export a Gephi graph for a database. |
Functions#
|
Export a Gephi graph for a database for all activities whose names include the string |
|
Fake docstring |
|
|
|
Export database database_name to a CSV file. |
|
Export database database_name to an Excel spreadsheet. |
- class bw2io.export.DatabaseSelectionToGEXF(database, keys)[source]#
Bases:
DatabaseToGEXF
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.write_lci_csv(database_name, objs=None, sections=None, dirpath=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.
Default directory is
projects.output_dir
, setdirpath
to have save the file somewhere else.Returns the filepath of the exported file.
- bw2io.export.write_lci_excel(database_name, objs=None, sections=None, dirpath=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.
Default directory is
projects.output_dir
, setdirpath
to have save the file somewhere else.Returns the filepath of the exported file.