LSMS_Library 0.2.9.dev0__py3-none-any.whl → 0.2.10.dev0__py3-none-any.whl

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.
Files changed (41) hide show
  1. lsms_library/__init__.py +7 -0
  2. lsms_library/countries/Bosnia-Herzegovina/2003/Data/cbh_ind_weighs.dta.dvc +5 -0
  3. lsms_library/countries/Bosnia-Herzegovina/2003/Data/cbhcfhh.dta.dvc +5 -0
  4. lsms_library/countries/Bosnia-Herzegovina/2003/Data/cbhcfind.dta.dvc +5 -0
  5. lsms_library/countries/Bosnia-Herzegovina/2003/Data/cbhhhpos.dta.dvc +5 -0
  6. lsms_library/countries/Bosnia-Herzegovina/2003/Data/cbhihh.dta.dvc +5 -0
  7. lsms_library/countries/Bosnia-Herzegovina/2003/Data/cbhiind.dta.dvc +5 -0
  8. lsms_library/countries/Bosnia-Herzegovina/2003/Data/cbhjhist.dta.dvc +5 -0
  9. lsms_library/countries/China/1995-97/_/data_info.yml +28 -0
  10. lsms_library/countries/China/_/data_scheme.yml +9 -0
  11. lsms_library/countries/India/1997-98/_/data_info.yml +29 -0
  12. lsms_library/countries/India/1997-98/_/testing.py +9 -0
  13. lsms_library/countries/India/_/data_scheme.yml +13 -0
  14. lsms_library/countries/Iraq/2006-07/_/data_info.yml +13 -0
  15. lsms_library/countries/Iraq/2012/_/data_info.yml +13 -0
  16. lsms_library/countries/Iraq/_/data_scheme.yml +8 -0
  17. lsms_library/countries/Kosovo/2000/_/data_info.yml +14 -0
  18. lsms_library/countries/Kosovo/_/data_scheme.yml +9 -0
  19. lsms_library/countries/Liberia/2018-19/_/data_info.yml +13 -0
  20. lsms_library/countries/Liberia/_/data_scheme.yml +8 -0
  21. lsms_library/countries/Nigeria/_/household_roster.py +0 -2
  22. lsms_library/countries/Serbia/2007/_/data_info.yml +13 -0
  23. lsms_library/countries/Serbia/_/data_scheme.yml +8 -0
  24. lsms_library/countries/Serbia and Montenegro/2002/_/data_info.yml +13 -0
  25. lsms_library/countries/Serbia and Montenegro/2003/_/data_info.yml +13 -0
  26. lsms_library/countries/Serbia and Montenegro/_/data_scheme.yml +8 -0
  27. lsms_library/countries/South Africa/1993/_/data_info.yml +34 -0
  28. lsms_library/countries/South Africa/_/data_scheme.yml +8 -0
  29. lsms_library/countries/Timor-Leste/2007-08/_/data_info.yml +13 -0
  30. lsms_library/countries/Timor-Leste/_/data_scheme.yml +8 -0
  31. lsms_library/countries/Togo/2018/_/data_info.yml +13 -0
  32. lsms_library/countries/Togo/_/data_scheme.yml +8 -0
  33. lsms_library/countries/Uganda/2005-06/_/data_info.yml +11 -0
  34. lsms_library/countries/Uganda/2009-10/_/data_info.yml +10 -0
  35. lsms_library/countries/Uganda/_/data_scheme.yml +6 -0
  36. lsms_library-0.2.10.dev0.dist-info/METADATA +290 -0
  37. {lsms_library-0.2.9.dev0.dist-info → lsms_library-0.2.10.dev0.dist-info}/RECORD +39 -10
  38. lsms_library/contributing.org +0 -290
  39. lsms_library-0.2.9.dev0.dist-info/METADATA +0 -138
  40. {lsms_library-0.2.9.dev0.dist-info → lsms_library-0.2.10.dev0.dist-info}/LICENSE.txt +0 -0
  41. {lsms_library-0.2.9.dev0.dist-info → lsms_library-0.2.10.dev0.dist-info}/WHEEL +0 -0
lsms_library/__init__.py CHANGED
@@ -4,3 +4,10 @@ from . import local_tools as tools
4
4
  from .categorical_mapping import ai_agent
5
5
  from . import transformations
6
6
  from .dvc_permissions import authenticate
7
+
8
+ from pathlib import Path
9
+ gpg_path = Path(__file__).resolve().parent / 'countries' / '.dvc'
10
+ creds_file = gpg_path / 's3_creds'
11
+ if not creds_file.exists():
12
+ authenticate()
13
+
@@ -0,0 +1,5 @@
1
+ outs:
2
+ - md5: a1151219b6fca72945421b89215684c9
3
+ size: 234165
4
+ hash: md5
5
+ path: cbh_ind_weighs.dta
@@ -0,0 +1,5 @@
1
+ outs:
2
+ - md5: 6b62a223bda01a8201d312a98bfa4aca
3
+ size: 304669
4
+ hash: md5
5
+ path: cbhcfhh.dta
@@ -0,0 +1,5 @@
1
+ outs:
2
+ - md5: 73018235493fa953aaaba39be9add892
3
+ size: 3746264
4
+ hash: md5
5
+ path: cbhcfind.dta
@@ -0,0 +1,5 @@
1
+ outs:
2
+ - md5: 714331ef355cf179dd5cfe7066b6cb64
3
+ size: 83975
4
+ hash: md5
5
+ path: cbhhhpos.dta
@@ -0,0 +1,5 @@
1
+ outs:
2
+ - md5: c1cd2da7dce1d7eed367c5a9c3a57cae
3
+ size: 2437389
4
+ hash: md5
5
+ path: cbhihh.dta
@@ -0,0 +1,5 @@
1
+ outs:
2
+ - md5: c096def2f3a7b0502f55ce092a848036
3
+ size: 24596089
4
+ hash: md5
5
+ path: cbhiind.dta
@@ -0,0 +1,5 @@
1
+ outs:
2
+ - md5: 7c363245ed8db8780bf07f8ff2842978
3
+ size: 123759
4
+ hash: md5
5
+ path: cbhjhist.dta
@@ -0,0 +1,28 @@
1
+ Country: China
2
+ Wave: 1995-97
3
+
4
+ household_roster:
5
+ file:
6
+ - ../Data/S01A2.DTA
7
+ idxvars:
8
+ i: hid
9
+ pid: pid
10
+ myvars:
11
+ Sex:
12
+ - s01a202
13
+ - mapping:
14
+ 1: Male
15
+ 2: Female
16
+ Relation:
17
+ - s01a203
18
+ - mapping:
19
+ 1: Head
20
+ 2: Spouse
21
+ 3: Child
22
+ 4: Grandchild
23
+ 5: Parent
24
+ 6: Sibling
25
+ 7: Son/Daughter-in-law
26
+ 8: Other relative
27
+ 9: Non-relative
28
+ Age: s01a208
@@ -0,0 +1,9 @@
1
+ Country: China
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid, t)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
9
+
@@ -0,0 +1,29 @@
1
+ Country: India
2
+ Wave: 1997-98
3
+
4
+ cluster_features:
5
+
6
+ household_roster:
7
+ file:
8
+ - ../Data/SECT01A.DTA
9
+ idxvars:
10
+ i: hh
11
+ pid: idcode
12
+ myvars:
13
+ Sex: v01a02
14
+ Age: v01a04
15
+ Relation: v01a03
16
+ Highest_education: v01a05
17
+ employment:
18
+ file:
19
+ - ../Data/SECT02AD.DTA
20
+ idxvars:
21
+ i: hh
22
+ pid: idcode
23
+ myvars:
24
+ Cash_per_day: v02b02
25
+ Rural: v02a05b
26
+
27
+
28
+
29
+
@@ -0,0 +1,9 @@
1
+ import lsms_library as ll
2
+
3
+ #malawi = ll.Country("Malawi")
4
+ #print(malawi.cluster_features())
5
+ #print(malawi.household_roster())
6
+
7
+ ind = ll.Country("India")
8
+ #print(ind.household_roster())
9
+ print(ind.employment())
@@ -0,0 +1,13 @@
1
+ Country: India
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
9
+ Highest_education: str
10
+ employment:
11
+ index: (i, pid)
12
+ Cash_per_day: float
13
+ Rural: str
@@ -0,0 +1,13 @@
1
+ Country: Iraq
2
+ Wave: 2006-07
3
+
4
+ household_roster:
5
+ file:
6
+ - "../Data/2007ihses01_household_roster.dta"
7
+ idxvars:
8
+ i: xhhkey
9
+ pid: idcode
10
+ myvars:
11
+ Relation: q0105
12
+ Sex: q0102
13
+ Age: q0103
@@ -0,0 +1,13 @@
1
+ Country: Iraq
2
+ Wave: 2012
3
+
4
+ household_roster:
5
+ file:
6
+ - "../Data/2012ihses01_household_roster.dta"
7
+ idxvars:
8
+ i: hh
9
+ pid: idcode
10
+ myvars:
11
+ Sex: q0102
12
+ Relation: q0105
13
+ Age: q0104
@@ -0,0 +1,8 @@
1
+ Country: Iraq
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid)
6
+ Relation: str
7
+ Sex: str
8
+ Age: int
@@ -0,0 +1,14 @@
1
+ Country: Kosovo
2
+ Wave: 2000
3
+
4
+ household_roster:
5
+ file:
6
+ - "../Data/POP.dta"
7
+ idxvars:
8
+ i: hhid
9
+ pid: s1a_q00
10
+ myvars:
11
+ Sex: s1a_q02
12
+ Relation: s1a_q03
13
+ Age: s1a_q05
14
+ Marital_status: s1a_q06
@@ -0,0 +1,9 @@
1
+ Country: Kosovo
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
9
+ Marital_status: str
@@ -0,0 +1,13 @@
1
+ Country: Liberia
2
+ Wave: 2018-19
3
+
4
+ household_roster:
5
+ file:
6
+ - "../Data/Household/sect2_public.dta"
7
+ idxvars:
8
+ i: hhid
9
+ pid: member_id
10
+ myvars:
11
+ Relation: S2_2
12
+ Sex: S2_3
13
+ Age: S2_5
@@ -0,0 +1,8 @@
1
+ Country: Liberia
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
@@ -1,6 +1,4 @@
1
1
  import pandas as pd
2
- import json
3
- import numpy as np
4
2
  from lsms_library.local_tools import to_parquet
5
3
  from lsms_library.local_tools import get_dataframe
6
4
 
@@ -0,0 +1,13 @@
1
+ Country: Serbia
2
+
3
+ household_roster:
4
+ file:
5
+ - "../Data/individual.dta"
6
+ idxvars:
7
+ municipality: opstina
8
+ enumeration_area: popkrug
9
+ i: dom
10
+ myvars:
11
+ Sex: pol
12
+ Relation: srodstvo
13
+ Age: starost
@@ -0,0 +1,8 @@
1
+ Country: Serbia
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (municipality, enumeration_area, i)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
@@ -0,0 +1,13 @@
1
+ Country: Serbia
2
+ Wave: 2002
3
+
4
+ household_roster:
5
+ file:
6
+ - "../Data/2002 1 demography.dta"
7
+ idxvars:
8
+ i: rbd
9
+ pid: clan
10
+ myvars:
11
+ Age: starost
12
+ Reglation: a2
13
+ Sex: a1
@@ -0,0 +1,13 @@
1
+ Country: Serbia and Montenegro
2
+ Wave: 2003
3
+
4
+ household_roster:
5
+ file:
6
+ - "../Data/2003 1 demography.dta"
7
+ idxvars:
8
+ i: rbd
9
+ pid: clan
10
+ myvars:
11
+ Age: brojgod
12
+ Reglation: a2
13
+ Sex: a1
@@ -0,0 +1,8 @@
1
+ Country: Serbia and Montenegro
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid, t)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
@@ -0,0 +1,34 @@
1
+ Country: South Africa
2
+ Wave: 1993
3
+
4
+ household_roster:
5
+ file:
6
+ - ../Data/M8_HROST.dta
7
+ idxvars:
8
+ i: hhid
9
+ pid: pcode
10
+ myvars:
11
+ Sex: gender_c
12
+ Age: age
13
+ Relation:
14
+ - rel_head
15
+ - mapping:
16
+ 1: "Resident Head"
17
+ 2: "Absent Head"
18
+ 3: "Wife or husband or partner"
19
+ 4: "Son or daughter"
20
+ 5: "Father or mother"
21
+ 6: "Grandchild"
22
+ 7: "Grandparent"
23
+ 8: "Mother- or father-in-law"
24
+ 9: "Son- or daughter-in-law"
25
+ 10: "Brother- or sister-in-law"
26
+ 11: "Aunt or uncle"
27
+ 12: "Sister or brother"
28
+ 13: "Niece or nephew"
29
+ 14: "Cousin"
30
+ 15: "Great-grandparent"
31
+ 16: "Household help (or relative of)"
32
+ 17: "Lodger or relative of lodgers"
33
+ 18: "Other family"
34
+ 19: "Other non-family"
@@ -0,0 +1,8 @@
1
+ Country: South Africa
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid, t)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
@@ -0,0 +1,13 @@
1
+ Country: Timor-Leste
2
+ Wave: 2007-08
3
+
4
+ household_roster:
5
+ file:
6
+ - ../Data/indiv.dta
7
+ idxvars:
8
+ i: hh_id
9
+ pid: pid
10
+ myvars:
11
+ Sex: q01a01
12
+ Relation: q01a02
13
+ Age: q01a05y
@@ -0,0 +1,8 @@
1
+ Country: Timor-Leste
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
@@ -0,0 +1,13 @@
1
+ Country: Togo
2
+ Wave: 2018
3
+
4
+ household_roster:
5
+ file:
6
+ - ../Data1/s01_me_tgo2018.dta
7
+ idxvars:
8
+ i: menage
9
+ pid: s01q00a
10
+ myvars:
11
+ Sex: s01q01
12
+ Relation: s01q02
13
+ Age: s01q04a
@@ -0,0 +1,8 @@
1
+ Country: Togo
2
+
3
+ Data Scheme:
4
+ household_roster:
5
+ index: (i, pid)
6
+ Sex: str
7
+ Age: int
8
+ Relation: str
@@ -1,6 +1,17 @@
1
1
  Country: Uganda
2
2
  Wave: 2005-06
3
3
 
4
+ household_roster:
5
+ file:
6
+ - ../Data/GSEC2.dta
7
+ idxvars:
8
+ i: HHID
9
+ pid: PID
10
+ myvars:
11
+ Sex: h2q4
12
+ Relation: h2q5
13
+ Age: h2q9
14
+
4
15
  people_last7days:
5
16
  file: GSEC14.dta
6
17
  idxvars:
@@ -1,6 +1,16 @@
1
1
  Country: Uganda
2
2
  Wave: 2009-10
3
3
 
4
+ household_roster:
5
+ file:
6
+ - ../Data/GSEC2.dta
7
+ idxvars:
8
+ i: HHID
9
+ pid: PID
10
+ myvars:
11
+ Sex: h2q3
12
+ Relation: h2q4
13
+ Age: h2q8
4
14
  people_last7days:
5
15
  file: GSEC15A.dta
6
16
  idxvars:
@@ -10,6 +10,12 @@ Data Scheme:
10
10
 
11
11
  cluster_features:
12
12
  index: (i,t,v)
13
+
14
+ household_roster:
15
+ index: (i, pid, t)
16
+ Sex: str
17
+ Age: int
18
+ Relation: str
13
19
 
14
20
  shocks: # USE_MAKEFILE
15
21
  earnings: # USE_MAKEFILE