Handle legislative parameters.
openfisca_core.parameters.Bracket(name=u'', directory_path=None, data=None, file_path=None)[source]¶A scale bracket.
openfisca_core.parameters.Parameter(name, data, file_path=None)[source]¶A parameter of the legislation. Parameters can change over time.
| Parameters: |
|
|---|
Instantiate a parameter without metadata:
>>> Parameter('rate', data = {
"2015-01-01": 550,
"2016-01-01": 600
})
Instantiate a parameter with metadata:
>>> Parameter('rate', data = {
'description': 'Income tax rate applied on salaries',
'values': {
"2015-01-01": {'value': 550, 'metadata': {'reference': 'http://taxes.gov/income_tax/2015'}},
"2016-01-01": {'value': 600, 'metadata': {'reference': 'http://taxes.gov/income_tax/2016'}}
}
})
values_list¶List of the values, in reverse chronological order
update(period=None, start=None, stop=None, value=None)[source]¶Change the value for a given period.
| Parameters: |
|
|---|
openfisca_core.parameters.ParameterAtInstant(name, instant_str, data=None, file_path=None, metadata=None)[source]¶A value of a parameter at a given instant.
openfisca_core.parameters.ParameterNode(name=u'', directory_path=None, data=None, file_path=None)[source]¶A node in the legislation parameter tree.
add_child(name, child)[source]¶Add a new child to the node.
| Parameters: |
|
|---|
openfisca_core.parameters.ParameterNodeAtInstant(name, node, instant_str)[source]¶Parameter node of the legislation, at a given instant.
openfisca_core.parameters.ParameterNotFound(name, instant_str, variable_name=None)[source]¶Exception raised when a parameter is not found in the parameters.
openfisca_core.parameters.ParameterParsingError(message, file=None, traceback=None)[source]¶Exception raised when a parameter cannot be parsed.
openfisca_core.parameters.Scale(name, data, file_path)[source]¶A parameter scale (for instance a marginal scale).
openfisca_core.parameters.VectorialParameterNodeAtInstant(name, vector, instant_str)[source]¶Parameter node of the legislation at a given instant which has been vectorized. Vectorized parameters allow requests such as parameters.housing_benefit[zipcode], where zipcode is a vector
openfisca_core.parameters.load_parameter_file(file_path, name=u'')[source]¶Load parameters from a YAML file (or a directory containing YAML files).
| Returns: | An instance of ParameterNode or Scale or Parameter. |
|---|