akvo.rsr.dataclasses module
- class akvo.rsr.dataclasses.ContributorData(id: int, period_start: Union[datetime.date, NoneType] = None, parent: Union[int, NoneType] = None, indicator_type: int = 1, indicator_measure: str = '', indicator_cumulative: bool = False, target_value: Union[decimal.Decimal, NoneType] = None, period_actual_value: Union[decimal.Decimal, NoneType] = None, period_actual_comment: str = '', period_narrative: str = '', indicator_baseline_value: Union[decimal.Decimal, NoneType] = None, indicator_target_value: Union[decimal.Decimal, NoneType] = None, project: Union[akvo.rsr.dataclasses.ContributorProjectData, NoneType] = None, updates: List[akvo.rsr.dataclasses.PeriodUpdateData] = <factory>, disaggregation_targets: List[akvo.rsr.dataclasses.DisaggregationTargetData] = <factory>, contributors: List[ForwardRef('ContributorData')] = <factory>, period_disaggregations: List[akvo.rsr.dataclasses.DisaggregationData] = <factory>)[source]
Bases:
ReportingPeriodMixin
- property countries: Set[CountryData]
- property has_contributions
- id: int
- indicator_baseline_value: Decimal | None = None
- indicator_cumulative: bool = False
- indicator_measure: str = ''
- indicator_target_value: Decimal | None = None
- indicator_type: int = 1
- property locations: Set[LocationData]
- parent: int | None = None
- period_actual_comment: str = ''
- period_actual_value: Decimal | None = None
- period_narrative: str = ''
- period_start: date | None = None
- project: ContributorProjectData | None = None
- target_value: Decimal | None = None
- class akvo.rsr.dataclasses.ContributorProjectData(id: Union[int, NoneType] = None, title: str = '', subtitle: str = '', country: Union[str, NoneType] = None, location: Union[akvo.rsr.dataclasses.LocationData, NoneType] = None, aggregate_children: bool = True, aggregate_to_parent: bool = True, sectors: Set[str] = <factory>)[source]
Bases:
object
- aggregate_children: bool = True
- aggregate_to_parent: bool = True
- country: str | None = None
- id: int | None = None
- location: LocationData | None = None
- sectors: Set[str]
- subtitle: str = ''
- title: str = ''
- class akvo.rsr.dataclasses.CountryData(iso_code: str = '', name: str = '')[source]
Bases:
object
- iso_code: str = ''
- name: str = ''
- class akvo.rsr.dataclasses.DisaggregationData(id: int | NoneType = None, category: str = '', type: str = '', value: decimal.Decimal | NoneType = None, numerator: decimal.Decimal | NoneType = None, denominator: decimal.Decimal | NoneType = None)[source]
Bases:
object
- category: str = ''
- denominator: Decimal | None = None
- id: int | None = None
- numerator: Decimal | None = None
- type: str = ''
- value: Decimal | None = None
- class akvo.rsr.dataclasses.DisaggregationTargetData(id: int | NoneType = None, category: str = '', type: str = '', value: decimal.Decimal | NoneType = None)[source]
Bases:
object
- category: str = ''
- id: int | None = None
- type: str = ''
- value: Decimal | None = None
- class akvo.rsr.dataclasses.IndicatorData(id: int, title: str = '', type: int = 1, measure: str = '', cumulative: bool = False, ascending: bool = False, description: str = '', baseline_year: Union[int, NoneType] = None, baseline_value: Union[decimal.Decimal, NoneType] = None, baseline_comment: str = '', target_value: Union[decimal.Decimal, NoneType] = None, target_comment: str = '', periods: List[akvo.rsr.dataclasses.PeriodData] = <factory>)[source]
Bases:
object
- property aggregated_target_value
- ascending: bool = False
- baseline_comment: str = ''
- baseline_value: Decimal | None = None
- baseline_year: int | None = None
- cumulative: bool = False
- description: str = ''
- property has_pending_updates
- id: int
- property is_cumulative
- property is_percentage
- property is_qualitative
- property is_quantitative
- measure: str = ''
- periods: List[PeriodData]
- target_comment: str = ''
- target_value: Decimal | None = None
- title: str = ''
- type: int = 1
- class akvo.rsr.dataclasses.IndicatorType(value)[source]
Bases:
Enum
An enumeration.
- Qualitative = 2
- Quantitative = 1
- class akvo.rsr.dataclasses.LocationData(latitude: float = 0, longitude: float = 0, country: akvo.rsr.dataclasses.CountryData | NoneType = None)[source]
Bases:
object
- country: CountryData | None = None
- latitude: float = 0
- longitude: float = 0
- class akvo.rsr.dataclasses.PeriodData(id: int, period_start: Union[datetime.date, NoneType] = None, period_end: Union[datetime.date, NoneType] = None, target_value: Union[decimal.Decimal, NoneType] = None, target_comment: str = '', period_actual_value: Union[decimal.Decimal, NoneType] = None, actual_comment: str = '', narrative: str = '', indicator_type: int = 1, indicator_measure: str = '', indicator_cumulative: bool = False, updates: List[akvo.rsr.dataclasses.PeriodUpdateData] = <factory>, disaggregation_targets: List[akvo.rsr.dataclasses.DisaggregationTargetData] = <factory>, contributors: List[akvo.rsr.dataclasses.ContributorData] = <factory>, period_disaggregations: List[akvo.rsr.dataclasses.DisaggregationData] = <factory>)[source]
Bases:
ReportingPeriodMixin
- actual_comment: str = ''
- property aggregated_value
- property countries: Set[CountryData]
- property has_pending_updates
- id: int
- indicator_cumulative: bool = False
- indicator_measure: str = ''
- indicator_type: int = 1
- property locations: Set[LocationData]
- narrative: str = ''
- property pending_denominator
- property pending_disaggregations
- property pending_numerator
- property pending_updates
- property pending_value
- period_actual_value: Decimal | None = None
- period_end: date | None = None
- period_start: date | None = None
- target_comment: str = ''
- target_value: Decimal | None = None
- class akvo.rsr.dataclasses.PeriodUpdateData(id: int, user: Union[akvo.rsr.dataclasses.UserData, NoneType] = None, status: str = 'D', value: Union[decimal.Decimal, NoneType] = None, numerator: Union[decimal.Decimal, NoneType] = None, denominator: Union[decimal.Decimal, NoneType] = None, narrative: str = '', created_at: Union[datetime.datetime, NoneType] = None, last_modified_at: Union[datetime.datetime, NoneType] = None, disaggregations: List[akvo.rsr.dataclasses.DisaggregationData] = <factory>)[source]
Bases:
object
- created_at: datetime | None = None
- denominator: Decimal | None = None
- disaggregations: List[DisaggregationData]
- id: int
- property is_approved
- property is_pending
- last_modified_at: datetime | None = None
- narrative: str = ''
- numerator: Decimal | None = None
- status: str = 'D'
- value: Decimal | None = None
- class akvo.rsr.dataclasses.ProjectData(id: int, title: str, subtitle: str, iati_activity_id: str, date_start_planned: Union[datetime.date, NoneType], date_end_planned: Union[datetime.date, NoneType], date_start_actual: Union[datetime.date, NoneType], date_end_actual: Union[datetime.date, NoneType], targets_at: str, recipient_countries: List[str] = <factory>, partners: List[str] = <factory>, results: List[akvo.rsr.dataclasses.ResultData] = <factory>)[source]
Bases:
object
- property country_codes
- date_end_actual: date | None
- date_end_planned: date | None
- date_start_actual: date | None
- date_start_planned: date | None
- iati_activity_id: str
- id: int
- property partner_names
- partners: List[str]
- recipient_countries: List[str]
- results: List[ResultData]
- subtitle: str
- targets_at: str
- title: str
- class akvo.rsr.dataclasses.ReportingPeriodMixin[source]
Bases:
ABC
- property actual_value
- property aggregated_denominator
- property aggregated_disaggregation_targets: List[DisaggregationTargetData]
- property aggregated_disaggregations: List[DisaggregationData]
- property aggregated_indicator_target_value
- property aggregated_numerator
- property aggregated_target_value
- property aggregated_value
- property approved_updates
- contributors: List[ContributorData] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=None)
- disaggregation_targets: List[DisaggregationTargetData] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=None)
- property disaggregations
- indicator_cumulative: bool = False
- indicator_measure: str = ''
- indicator_type: int = 1
- property is_cumulative
- property is_cumulative_future
- property is_percentage
- property is_qualitative
- property is_quantitative
- period_actual_value: Decimal | None = None
- period_disaggregations: List[DisaggregationData] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=None)
- period_start: date | None = None
- target_value: Decimal | None = None
- updates: List[PeriodUpdateData] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=None)
- property updates_denominator
- property updates_numerator
- property updates_value
- class akvo.rsr.dataclasses.ResultData(id: int, title: str = '', description: str = '', type: str = '', aggregation_status: Union[bool, NoneType] = None, indicators: List[akvo.rsr.dataclasses.IndicatorData] = <factory>)[source]
Bases:
object
- aggregation_status: bool | None = None
- description: str = ''
- property has_pending_updates
- property iati_type_name
- id: int
- indicators: List[IndicatorData]
- title: str = ''
- type: str = ''
- class akvo.rsr.dataclasses.ResultWithIndicatorType(type: akvo.rsr.dataclasses.IndicatorType, result: akvo.rsr.dataclasses.ResultData)[source]
Bases:
object
- property indicators
- result: ResultData
- type: IndicatorType
- class akvo.rsr.dataclasses.UserData(email: str = '', first_name: str = '', last_name: str = '')[source]
Bases:
object
- email: str = ''
- first_name: str = ''
- property full_name
- last_name: str = ''
- akvo.rsr.dataclasses.filter_results_by_indicator_type(type: IndicatorType, results: List[ResultData])[source]