Skip to content

Instantly share code, notes, and snippets.

@cmutel
Created April 27, 2024 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmutel/546492be3c4775909f80373e7267e680 to your computer and use it in GitHub Desktop.
Save cmutel/546492be3c4775909f80373e7267e680 to your computer and use it in GitHub Desktop.
import bw2data as bd
db = bd.Database("Transport routes")
# Compatible with legacy - "new_node" is 2.5 only
my_route = bd.new_activity(
name="Transport from CN to EU",
unit="trip",
code="surf-practice"
)
my_route.save()
my_route.new_exchange(
input=china_transport,
amount="200" # tkm
).save()
my_route.new_exchange(
input=sea_transport,
amount="10000" # tkm
).save()
my_route.new_exchange(
input=eur_transport,
amount="100" # tkm
).save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment