A helper class that provides all methods required to save the data from a dataset into Open Spending in an efficient way.
Read the loaders.rst in the /doc folder.
Update the entry to be classified with classifier. entry is mutated, but not returned.
return:None
This method has to be called as the last method when using the loader. It will add additional, required data to the database.
create a :class:wdmmg.model.`classifier`. The name has to be unique for the taxonomy. The classifier will be updated with the values for label, description and **classifier Note that the classifier for (name, taxonomy) is only created or updated if it is not already in the _cache.
Arguments:
Returns: An wdmmg.model.Classifier object
Describe the data you save on entries with the key key. Describe it with a label and a description.
Returns: None
Raises: TypeError if one of the arguments is of the wrong type.
Create or update an wdmmg.model.Entity object in the database when the method is called with a name for the first time. The entity is identified soley by it’s name. The entry will only be created if it is not in the _cache.
Returns: The created Entity object
Create or update an wdmmg.model.Entry object in the database.
A dict containing at least these information:
If entry does not contain a currency, the currency of the loader object is used.
Returns: A mongodb query spec that can be used with wdmmg.model.Entry.find_one() to get the object.
Raises: AssertionError in some cases if the Entry violates the datamodel (fixme: full assertions and description!)
Create a view. The view will be computed when you call finalize().
Returns: A wdmmg.lib.views.View object.
Ensure an index is created for the collection of modelcls exists for the combination of keys. The index will be ascending for all keys.
Get the classifier object with the name name for the taxonomy taxonomy. This will be cached to speed up the loader
Returns: An wdmmg.model.Classifier object if found or None.
Get a default wdmmg.model.Entity object that represents the society (general public) to use across all datasets. This can be called only one time.