bw2io.migrations#

Attributes#

Classes#

Migration

A migration is a set of data that can be used to modify a database.

_Migrations

Functions#

create_core_migrations()

Add pre-defined core migrations data files.

Module Contents#

class bw2io.migrations.Migration(*args, **kwargs)[source]#

Bases: bw2data.data_store.DataStore

A migration is a set of data that can be used to modify a database.

Migrations are stored in the migrations directory of the project. They are stored as JSON files, and are registered in the migrations.json file.

write(data, description)[source]#

Write migration data. Requires a description.

load()[source]#

Load migration data.

validate()[source]#

Validate migration data.

load()[source]#
validate(*args, **kwargs)[source]#
write(data, description)[source]#

Write migration data. Requires a description.

Parameters:
  • data (dict) – Migration data.

  • description (str) – Description of the migration.

_intermediate_dir[source]#
_metadata[source]#
property description[source]#
class bw2io.migrations._Migrations[source]#

Bases: bw2data.serialization.SerializedDict

filename = 'migrations.json'[source]#
bw2io.migrations.create_core_migrations()[source]#

Add pre-defined core migrations data files.

bw2io.migrations.migrations[source]#