Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improved sector support #22

Merged
merged 8 commits into from Dec 21, 2018
Merged

Add improved sector support #22

merged 8 commits into from Dec 21, 2018

Conversation

andylolz
Copy link
Member

Here’s a demo:

import pyandi

sector = pyandi.codelists().get('Sector').get(12230)  # "Basic health infrastructure"
pyandi.data().activities.find(sector=sector).sector

# [('12230', '1', '15'), ('12220', '1', '15'), ('12240', '1', '15'), ('13020', '1', '15'), ('14030', '1', '10'), ('72050', '1', '10'), ('52010', '1', '10'), ('16015', '1', '10')]

The output is currently a tuple of (code, vocabulary, percentage). This probably needs to be turned into a Sector model.

@andylolz
Copy link
Member Author

Changed a bit:

import pyandi

sector = pyandi.sector(12230, 1)  # "Basic health infrastructure"
pyandi.data().activities.find(sector=sector).sector

# [<Sector (Basic health infrastructure (12230), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>, <Sector (Basic health care (12220), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>, <Sector (Basic nutrition (12240), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>, <Sector (Reproductive health care (13020), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>, <Sector (Basic drinking water supply and basic sanitation (14030), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>, <Sector (Relief co-ordination; protection and support services (72050), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>, <Sector (Food aid/Food security programmes (52010), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>, <Sector (Social services (incl youth development and women+ children) (16015), Vocabulary: OECD DAC CRS Purpose Codes (5 digit))>]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant