hapi-schema 0.8.2__tar.gz → 0.8.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/PKG-INFO +1 -1
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/changelog.md +6 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/_version.py +2 -2
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_food_price.py +2 -2
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_food_security.py +2 -1
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_funding.py +6 -3
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_national_risk.py +11 -6
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_views_as_tables.py +11 -10
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/enums.py +2 -3
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_wfp_commodity.py +1 -1
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/.config/coveragerc +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/.config/pre-commit-config.yaml +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/.config/pytest.ini +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/.config/ruff.toml +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/.github/workflows/publish.yaml +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/.github/workflows/run-python-tests.yaml +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/.gitignore +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/LICENSE +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/README.md +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/contributing.md +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/docker/docker-compose.yml +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/initialize_test_db.sh +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/pyproject.toml +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/requirements.txt +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/__init__.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_admin1.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_admin2.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_conflict_event.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_currency.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_dataset.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_humanitarian_needs.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_location.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_operational_presence.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_org.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_org_type.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_patch.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_population.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_poverty_rate.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_refugees.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_resource.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_sector.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_wfp_commodity.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/db_wfp_market.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/__init__.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/base.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/constraints.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/hapi_views_code_generator.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/view_as_table_code_generator.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/view_as_table_definitions.toml +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/view_params.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/views.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/conftest.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/__init__.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_admin1.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_admin2.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_conflict_event.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_currency.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_dataset.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_food_price.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_food_security.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_funding.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_humanitarian_needs.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_location.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_national_risk.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_operational_presence.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_org.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_org_type.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_patch.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_population.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_poverty_rate.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_refugees.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_resource.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_sector.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/sample_data/data_wfp_market.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_admin1.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_admin2.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_conflict_event.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_currency.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_dataset.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_food_price.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_food_security.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_funding.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_humanitarian_needs.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_location.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_national_risk.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_operational_presence.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_org.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_org_type.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_patch.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_population.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_poverty_rate.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_refugees.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_resource.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_sector.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_views_as_tables.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_wfp_commodity.py +0 -0
- {hapi_schema-0.8.2 → hapi_schema-0.8.3}/tests/test_wfp_market.py +0 -0
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 0.8.3
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- fixed WFP commodity enum
|
|
12
|
+
- change FLOAT to DECIMAL in funding, national\_risk, and food\_security
|
|
13
|
+
|
|
8
14
|
## 0.8.2
|
|
9
15
|
|
|
10
16
|
Miscellaneous fixes for pipelines
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"""FoodPrice table and view."""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from decimal import Decimal
|
|
4
5
|
|
|
5
6
|
from sqlalchemy import (
|
|
6
7
|
DateTime,
|
|
7
8
|
Enum,
|
|
8
|
-
Float,
|
|
9
9
|
ForeignKey,
|
|
10
10
|
String,
|
|
11
11
|
select,
|
|
@@ -57,7 +57,7 @@ class DBFoodPrice(Base):
|
|
|
57
57
|
price_type: Mapped[PriceType] = mapped_column(
|
|
58
58
|
Enum(PriceType), primary_key=True
|
|
59
59
|
)
|
|
60
|
-
price: Mapped[
|
|
60
|
+
price: Mapped[Decimal] = mapped_column(nullable=False)
|
|
61
61
|
reference_period_start: Mapped[datetime] = mapped_column(
|
|
62
62
|
DateTime, primary_key=True
|
|
63
63
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Food security table and view."""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from decimal import Decimal
|
|
4
5
|
|
|
5
6
|
from sqlalchemy import (
|
|
6
7
|
DateTime,
|
|
@@ -46,7 +47,7 @@ class DBFoodSecurity(Base):
|
|
|
46
47
|
population_in_phase: Mapped[int] = mapped_column(
|
|
47
48
|
Integer, nullable=False, index=True
|
|
48
49
|
)
|
|
49
|
-
population_fraction_in_phase: Mapped[
|
|
50
|
+
population_fraction_in_phase: Mapped[Decimal] = mapped_column(
|
|
50
51
|
Float, nullable=False, index=True
|
|
51
52
|
)
|
|
52
53
|
reference_period_start: Mapped[datetime] = mapped_column(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Funding subcategory table and view."""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from decimal import Decimal
|
|
4
5
|
|
|
5
6
|
from sqlalchemy import (
|
|
6
7
|
CheckConstraint,
|
|
@@ -55,11 +56,13 @@ class DBFunding(Base):
|
|
|
55
56
|
|
|
56
57
|
appeal_type: Mapped[str] = mapped_column(String(32), nullable=False)
|
|
57
58
|
|
|
58
|
-
requirements_usd: Mapped[
|
|
59
|
+
requirements_usd: Mapped[Decimal] = mapped_column(
|
|
60
|
+
nullable=False, index=True
|
|
61
|
+
)
|
|
59
62
|
|
|
60
|
-
funding_usd: Mapped[
|
|
63
|
+
funding_usd: Mapped[Decimal] = mapped_column(nullable=False, index=True)
|
|
61
64
|
|
|
62
|
-
funding_pct: Mapped[
|
|
65
|
+
funding_pct: Mapped[Decimal] = mapped_column(nullable=False, index=True)
|
|
63
66
|
|
|
64
67
|
reference_period_start: Mapped[datetime] = mapped_column(
|
|
65
68
|
DateTime,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""NationalRisk table and view."""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from decimal import Decimal
|
|
4
5
|
|
|
5
6
|
from sqlalchemy import (
|
|
6
7
|
CheckConstraint,
|
|
@@ -55,14 +56,18 @@ class DBNationalRisk(Base):
|
|
|
55
56
|
Enum(RiskClass), nullable=False
|
|
56
57
|
)
|
|
57
58
|
global_rank: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
58
|
-
overall_risk: Mapped[
|
|
59
|
-
hazard_exposure_risk: Mapped[
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
overall_risk: Mapped[Decimal] = mapped_column(Float, nullable=False)
|
|
60
|
+
hazard_exposure_risk: Mapped[Decimal] = mapped_column(
|
|
61
|
+
Float, nullable=False
|
|
62
|
+
)
|
|
63
|
+
vulnerability_risk: Mapped[Decimal] = mapped_column(Float, nullable=False)
|
|
64
|
+
coping_capacity_risk: Mapped[Decimal] = mapped_column(
|
|
65
|
+
Float, nullable=False
|
|
66
|
+
)
|
|
67
|
+
meta_missing_indicators_pct: Mapped[Decimal] = mapped_column(
|
|
63
68
|
Float, nullable=True
|
|
64
69
|
)
|
|
65
|
-
meta_avg_recentness_years: Mapped[
|
|
70
|
+
meta_avg_recentness_years: Mapped[Decimal] = mapped_column(
|
|
66
71
|
Float, nullable=True
|
|
67
72
|
)
|
|
68
73
|
reference_period_start: Mapped[datetime] = mapped_column(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
from decimal import Decimal
|
|
2
3
|
|
|
3
4
|
from sqlalchemy import (
|
|
4
5
|
Boolean,
|
|
@@ -67,7 +68,7 @@ class DBFoodSecurityVAT(Base):
|
|
|
67
68
|
ipc_phase: Mapped[str] = mapped_column(String(12), primary_key=True)
|
|
68
69
|
ipc_type: Mapped[str] = mapped_column(String(17), primary_key=True)
|
|
69
70
|
population_in_phase: Mapped[int] = mapped_column(Integer, index=True)
|
|
70
|
-
population_fraction_in_phase: Mapped[
|
|
71
|
+
population_fraction_in_phase: Mapped[Decimal] = mapped_column(
|
|
71
72
|
Float, index=True
|
|
72
73
|
)
|
|
73
74
|
reference_period_start: Mapped[datetime] = mapped_column(
|
|
@@ -95,9 +96,9 @@ class DBFundingVAT(Base):
|
|
|
95
96
|
location_ref: Mapped[int] = mapped_column(Integer, primary_key=True)
|
|
96
97
|
appeal_name: Mapped[str] = mapped_column(String(256))
|
|
97
98
|
appeal_type: Mapped[str] = mapped_column(String(32))
|
|
98
|
-
requirements_usd: Mapped[
|
|
99
|
-
funding_usd: Mapped[
|
|
100
|
-
funding_pct: Mapped[
|
|
99
|
+
requirements_usd: Mapped[Decimal] = mapped_column(Float, index=True)
|
|
100
|
+
funding_usd: Mapped[Decimal] = mapped_column(Float, index=True)
|
|
101
|
+
funding_pct: Mapped[Decimal] = mapped_column(Float, index=True)
|
|
101
102
|
reference_period_start: Mapped[datetime] = mapped_column(
|
|
102
103
|
DateTime, index=True
|
|
103
104
|
)
|
|
@@ -162,14 +163,14 @@ class DBNationalRiskVAT(Base):
|
|
|
162
163
|
location_ref: Mapped[int] = mapped_column(Integer, primary_key=True)
|
|
163
164
|
risk_class: Mapped[str] = mapped_column(String(9))
|
|
164
165
|
global_rank: Mapped[int] = mapped_column(Integer)
|
|
165
|
-
overall_risk: Mapped[
|
|
166
|
-
hazard_exposure_risk: Mapped[
|
|
167
|
-
vulnerability_risk: Mapped[
|
|
168
|
-
coping_capacity_risk: Mapped[
|
|
169
|
-
meta_missing_indicators_pct: Mapped[
|
|
166
|
+
overall_risk: Mapped[Decimal] = mapped_column(Float)
|
|
167
|
+
hazard_exposure_risk: Mapped[Decimal] = mapped_column(Float)
|
|
168
|
+
vulnerability_risk: Mapped[Decimal] = mapped_column(Float)
|
|
169
|
+
coping_capacity_risk: Mapped[Decimal] = mapped_column(Float)
|
|
170
|
+
meta_missing_indicators_pct: Mapped[Decimal] = mapped_column(
|
|
170
171
|
Float, nullable=True
|
|
171
172
|
)
|
|
172
|
-
meta_avg_recentness_years: Mapped[
|
|
173
|
+
meta_avg_recentness_years: Mapped[Decimal] = mapped_column(
|
|
173
174
|
Float, nullable=True
|
|
174
175
|
)
|
|
175
176
|
reference_period_start: Mapped[datetime] = mapped_column(
|
|
@@ -7,7 +7,6 @@ class Gender(str, enum.Enum):
|
|
|
7
7
|
NONBINARY = "x"
|
|
8
8
|
UNSPECIFIED = "u"
|
|
9
9
|
OTHER = "o"
|
|
10
|
-
EUNUCH = "e"
|
|
11
10
|
ALL = "*"
|
|
12
11
|
|
|
13
12
|
|
|
@@ -95,11 +94,11 @@ class RiskClass(str, enum.Enum):
|
|
|
95
94
|
|
|
96
95
|
|
|
97
96
|
class CommodityCategory(str, enum.Enum):
|
|
98
|
-
|
|
97
|
+
CEREALS_TUBERS = "cereals and tubers"
|
|
99
98
|
MEAT_FISH_EGGS = "meat, fish and eggs"
|
|
100
99
|
MILK_DAIRY = "milk and dairy"
|
|
101
100
|
MISCELLANEOUS_FOOD = "miscellaneous food"
|
|
102
101
|
NON_FOOD = "non-food"
|
|
103
|
-
|
|
102
|
+
OIL_FATS = "oil and fats"
|
|
104
103
|
PULSES_NUTS = "pulses and nuts"
|
|
105
104
|
VEGETABLES_FRUITS = "vegetables and fruits"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/view_as_table_code_generator.py
RENAMED
|
File without changes
|
{hapi_schema-0.8.2 → hapi_schema-0.8.3}/src/hapi_schema/utils/view_as_table_definitions.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|