@@ -73,59 +73,6 @@ def get_profile(geo, profile_name, request):
73
73
table_fields=None, table_name=None, **kwargs
74
74
"""
75
75
76
- def get_nbs_2018 (geo , session , year ):
77
- mobile_subscription = LOCATIONNOTFOUND
78
- mineral_production = LOCATIONNOTFOUND
79
- hiv_patients = LOCATIONNOTFOUND
80
- telecom_subscription = LOCATIONNOTFOUND
81
- faac = LOCATIONNOTFOUND
82
- jamb = LOCATIONNOTFOUND
83
- debt_data = LOCATIONNOTFOUND
84
-
85
-
86
- with dataset_context (year = '2018' ):
87
- try :
88
- debt_data , _ = get_stat_data (fields = ['year' , 'debt_type' ], geo = geo ,
89
- session = session ,
90
- percent = False , order_by = 'debt_type' )
91
- mobile_subscription , _ = get_stat_data (fields = ['network' , 'subscription_type' ], geo = geo ,
92
- session = session ,
93
- table_name = 'mobile_subscription' , percent = False )
94
- mineral_production , _ = get_stat_data (fields = ['year' ], geo = geo ,
95
- session = session ,
96
- table_name = 'mineral_production' , percent = False , order_by = 'year' )
97
- telecom_subscription , _ = get_stat_data (fields = ['period' , 'subscription_type' ], geo = geo ,
98
- session = session ,
99
- table_name = 'telecom_subscription' , percent = False )
100
- faac , _ = get_stat_data (fields = ['allocation' ], geo = geo ,
101
- session = session ,
102
- table_name = 'faac' , percent = False )
103
- jamb , _ = get_stat_data (fields = ['year' , 'gender' ], geo = geo ,
104
- session = session ,
105
- table_name = 'jamb' , percent = False )
106
-
107
- except Exception as e :
108
- print (str (e ))
109
-
110
- is_missing = mobile_subscription .get ('is_missing' ) and \
111
- mineral_production .get ('is_missing' ) and \
112
- telecom_subscription .get ('is_missing' ) and \
113
- faac .get ('is_missing' ) and jamb .get ('is_missing' ) and \
114
- debt_data .get ('is_missing' )
115
-
116
- final_data = {
117
- 'is_missing' : is_missing ,
118
- 'mobile_subscription' : mobile_subscription ,
119
- 'mineral_production' : mineral_production ,
120
- 'telecom_subscription' : telecom_subscription ,
121
- 'debt_data' : debt_data ,
122
- 'faac' : faac ,
123
- 'jamb' : jamb
124
-
125
- }
126
- return final_data
127
-
128
-
129
76
def get_demographics_profile (geo , session ):
130
77
compiled_indeces = LOCATIONNOTFOUND
131
78
birth_registration = LOCATIONNOTFOUND
@@ -470,6 +417,7 @@ def get_health_profile(geo, session):
470
417
contraceptive_use = LOCATIONNOTFOUND
471
418
vaccine_coverage = LOCATIONNOTFOUND
472
419
hiv_arvs = LOCATIONNOTFOUND
420
+ fertility_rate = LOCATIONNOTFOUND
473
421
474
422
with dataset_context (year = '2016' ):
475
423
try :
@@ -534,7 +482,8 @@ def get_health_profile(geo, session):
534
482
adolescent_fertility .get ('is_missing' ) and \
535
483
contraceptive_use .get ('is_missing' ) and \
536
484
vaccine_coverage .get ('is_missing' ) and \
537
- hiv_arvs .get ('is_missing' )
485
+ hiv_arvs .get ('is_missing' ) and \
486
+ fertility_rate .get ('is_missing' )
538
487
539
488
final_data = {
540
489
'is_missing' : is_missing ,
@@ -544,7 +493,8 @@ def get_health_profile(geo, session):
544
493
'adolescent_fertility' : adolescent_fertility ,
545
494
'contraceptive_use' : contraceptive_use ,
546
495
'vaccine_coverage' : vaccine_coverage ,
547
- 'hiv_arvs' : hiv_arvs
496
+ 'hiv_arvs' : hiv_arvs ,
497
+ 'fertility_rate' : fertility_rate
548
498
}
549
499
return final_data
550
500
@@ -565,6 +515,10 @@ def get_others_profile(geo, session):
565
515
air_transportation_international = LOCATIONNOTFOUND
566
516
diesel_year = LOCATIONNOTFOUND
567
517
driver_licences_processed = LOCATIONNOTFOUND
518
+ mobile_subscription = LOCATIONNOTFOUND
519
+ mineral_production = LOCATIONNOTFOUND
520
+ telecom_subscription = LOCATIONNOTFOUND
521
+ jamb = LOCATIONNOTFOUND
568
522
569
523
with dataset_context (year = '2018' ):
570
524
try :
@@ -683,6 +637,38 @@ def get_others_profile(geo, session):
683
637
print (str (e ))
684
638
pass
685
639
640
+ try :
641
+ mobile_subscription , _ = get_stat_data (fields = ['network' , 'subscription_type' ], geo = geo ,
642
+ session = session ,
643
+ table_name = 'mobile_subscription' , percent = False )
644
+ except Exception as e :
645
+ print (str (e ))
646
+ pass
647
+
648
+ try :
649
+ mineral_production , _ = get_stat_data (fields = ['year' ], geo = geo ,
650
+ session = session ,
651
+ table_name = 'mineral_production' , percent = False , order_by = 'year' )
652
+ except Exception as e :
653
+ print (str (e ))
654
+ pass
655
+
656
+ try :
657
+ telecom_subscription , _ = get_stat_data (fields = ['period' , 'subscription_type' ], geo = geo ,
658
+ session = session ,
659
+ table_name = 'telecom_subscription' , percent = False )
660
+ except Exception as e :
661
+ print (str (e ))
662
+ pass
663
+
664
+ try :
665
+ jamb , _ = get_stat_data (fields = ['year' , 'gender' ], geo = geo ,
666
+ session = session ,
667
+ table_name = 'jamb' , percent = False )
668
+ except Exception as e :
669
+ print (str (e ))
670
+ pass
671
+
686
672
diesel_price = {
687
673
'is_missing' : diesel_price_2019 .get ('is_missing' ) and \
688
674
diesel_price_2018 .get ('is_missing' ) and \
@@ -721,14 +707,20 @@ def get_others_profile(geo, session):
721
707
'air_transportation_domestic' : air_transportation_domestic ,
722
708
'air_transportation_international' : air_transportation_international ,
723
709
'diesel_year' : diesel_year ,
724
- 'driver_licences_processed' : driver_licences_processed
710
+ 'driver_licences_processed' : driver_licences_processed ,
711
+ 'mobile_subscription' : mobile_subscription ,
712
+ 'mineral_production' : mineral_production ,
713
+ 'telecom_subscription' : telecom_subscription ,
714
+ 'jamb' : jamb
725
715
}
726
716
return final_data
727
717
728
718
729
719
def get_finance_profile (geo , session ):
730
720
bank_credit = LOCATIONNOTFOUND
731
721
bank_deposit = LOCATIONNOTFOUND
722
+ debt_data = LOCATIONNOTFOUND
723
+ faac = LOCATIONNOTFOUND
732
724
733
725
with dataset_context (year = '2018' ):
734
726
try :
@@ -747,13 +739,35 @@ def get_finance_profile(geo, session):
747
739
print (str (e ))
748
740
pass
749
741
742
+ try :
743
+ debt_data , _ = get_stat_data (fields = ['year' , 'debt_type' ], geo = geo ,
744
+ session = session ,
745
+ percent = False , order_by = 'debt_type' )
746
+ except Exception as e :
747
+ print (str (e ))
748
+ pass
749
+
750
+ try :
751
+ faac , _ = get_stat_data (fields = ['allocation' ], geo = geo ,
752
+ session = session ,
753
+ table_name = 'faac' , percent = False )
754
+ except Exception as e :
755
+ print (str (e ))
756
+ pass
757
+
758
+
759
+
750
760
is_missing = bank_deposit .get ('is_missing' ) and \
751
- bank_credit .get ('is_missing' )
761
+ bank_credit .get ('is_missing' ) and \
762
+ debt_data .get ('is_missing' ) and \
763
+ faac .get ('is_missing' )
752
764
753
765
final_data = {
754
766
'is_missing' : is_missing ,
755
767
'bank_credit' : bank_credit ,
756
- 'bank_deposit' : bank_deposit
768
+ 'bank_deposit' : bank_deposit ,
769
+ 'debt_data' : debt_data ,
770
+ 'faac' : faac
757
771
}
758
772
759
773
return final_data
0 commit comments