netto.data_loader
Data loader for tax and social security data.
This module loads tax data from JSON files and provides validation using Pydantic models. All data is organized in individual yearly files for better maintainability and auditability.
The loaded data is exposed as module-level variables for easy import: - tax_curve: Tax brackets by year - social_security_curve: Social security rates by year - soli_curve: Solidarity tax parameters by year - correction_factor_pensions: Pension deduction factors by year
Attributes
Classes
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
Functions
|
Load tax curve for a specific year. |
|
Load social security data for a specific year. |
|
Load solidarity tax data for a specific year. |
|
Load pension correction factor for a specific year. |
|
Load tax curves for all available years. |
|
Load social security data for all available years. |
|
Load solidarity tax data for all available years. |
|
Load pension correction factors for all available years. |
Module Contents
- class netto.data_loader.TaxBracket(/, **data: Any)[source]
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- __pydantic_complete__[source]
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- class netto.data_loader.TaxCurve(/, **data: Any)[source]
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- __pydantic_complete__[source]
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_extra__[source]
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- brackets: dict[str, TaxBracket] = None[source]
- class netto.data_loader.SocialSecurityEntry(/, **data: Any)[source]
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- __pydantic_complete__[source]
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- class netto.data_loader.SocialSecurity(/, **data: Any)[source]
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- __pydantic_complete__[source]
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_extra__[source]
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.
- pension: SocialSecurityEntry[source]
- unemployment: SocialSecurityEntry[source]
- health: SocialSecurityEntry[source]
- nursing: SocialSecurityEntry[source]
- class netto.data_loader.SoliCurve(/, **data: Any)[source]
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- __pydantic_complete__[source]
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- class netto.data_loader.PensionFactor(/, **data: Any)[source]
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- __pydantic_complete__[source]
Whether model building is completed, or if there are still undefined fields.
- __pydantic_decorators__[source]
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__[source]
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__[source]
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_serializer__[source]
The pydantic-core SchemaSerializer used to dump instances of the model.
- __pydantic_validator__[source]
The pydantic-core SchemaValidator used to validate instances of the model.
- __pydantic_fields__[source]
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__[source]
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- netto.data_loader.load_tax_curve(year: int) dict[int, dict][source]
Load tax curve for a specific year.
- Parameters:
year (int) – Tax year to load
- Returns:
Tax curve data as dictionary with integer keys (0-3)
- Return type:
dict
Examples
>>> curve = load_tax_curve(2022) >>> curve[0]['step'] 10347
- netto.data_loader.load_social_security(year: int) dict[source]
Load social security data for a specific year.
- Parameters:
year (int) – Tax year to load
- Returns:
Social security data
- Return type:
dict
Examples
>>> social_sec = load_social_security(2022) >>> social_sec['pension']['limit'] 84600
- netto.data_loader.load_soli(year: int) dict[source]
Load solidarity tax data for a specific year.
- Parameters:
year (int) – Tax year to load
- Returns:
Soli data
- Return type:
dict
Examples
>>> soli = load_soli(2022) >>> soli['end_rate'] 0.055
- netto.data_loader.load_pension_factor(year: int) float[source]
Load pension correction factor for a specific year.
- Parameters:
year (int) – Tax year to load
- Returns:
Pension correction factor
- Return type:
float
Examples
>>> factor = load_pension_factor(2022) >>> factor 0.88
- netto.data_loader.load_all_tax_curves() dict[int, dict[int, dict]][source]
Load tax curves for all available years.
- Returns:
Tax curves for all years
- Return type:
dict
- netto.data_loader.load_all_social_security() dict[int, dict][source]
Load social security data for all available years.
- Returns:
Social security data for all years
- Return type:
dict
- netto.data_loader.load_all_soli() dict[int, dict][source]
Load solidarity tax data for all available years.
- Returns:
Soli data for all years
- Return type:
dict