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

DataBridges API 5.0 Endpoints #5

Merged
merged 23 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
99ed700
Added pages
AlexGherardelli Jul 24, 2024
a87bd82
feature: commodities API endpoints + udpate ROADMAP
AlexGherardelli Sep 12, 2024
90f7758
docs: updated README example
AlexGherardelli Sep 12, 2024
077cde9
docs: added Data Bridges API key from creedential config file
AlexGherardelli Sep 12, 2024
ed98601
feature: add currency_list, usd_indirect_quotation, economic_indicato…
AlexGherardelli Sep 13, 2024
dc21311
feature: add MarketsApi endpoints
AlexGherardelli Sep 19, 2024
fd8608d
feature: udpate FoodSecurityApi endpoints
AlexGherardelli Sep 19, 2024
52f0125
feature: update GorpApi endpoints
AlexGherardelli Sep 19, 2024
021ae33
feature: update IncubationApi endpoints
AlexGherardelli Sep 19, 2024
b226664
docs: update example.py with markets endpoint
AlexGherardelli Sep 20, 2024
c474c9c
Partial update to v5.0
AlexGherardelli Sep 20, 2024
b80ec1d
docs: update README with examples
AlexGherardelli Sep 20, 2024
ba9821f
docs: update README with installation instructions
AlexGherardelli Sep 20, 2024
bf22dab
Update README.md
AlexGherardelli Sep 20, 2024
7d80f00
feature: update get_household_survey function with DataBridges API ke…
AlexGherardelli Sep 20, 2024
056588c
docs: add examples for household survey and questionnaire
AlexGherardelli Sep 20, 2024
9673229
Merge branch 'feature/v5.0' into dev
AlexGherardelli Sep 20, 2024
977e235
Merge branch 'dev' of https://github.com/WFP-VAM/DataBridgesKnots int…
AlexGherardelli Sep 20, 2024
15a7c1d
feat: IncubationApi Household Surveys endpoints
AlexGherardelli Sep 23, 2024
9db9424
fix: get_household_questionnaire and get_choice_list functions to ret…
AlexGherardelli Sep 23, 2024
05d4d06
feature: add MFI endpoints and examples
AlexGherardelli Sep 23, 2024
9ef72fc
feat: add RPME endpoints
AlexGherardelli Sep 23, 2024
ac7c868
Added get_mfi_xls_forms_detailed
AlexGherardelli Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ data_bridges_api_config.yaml
.Rhistory
*.Rproj
*.yaml
sandbox.py
sandbox.*
*.csv
.vscode
.vscode
*.code-workspace
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,35 @@ This Python module allows you to get data from the WFP Data Bridges API, includi

## Installation

> NB This is the dev version of the data_bridges_knots and API client package, it is frequently updated yet not stable.
> NB This is the development version of the data_bridges_knots and API client package, it is frequently updated yet not stable.

You can install the `data_bridges_knots` package using `pip` and the Git repository URL:

```
pip install git+https://github.com/WFP-VAM/DataBridgesKnots.git
pip install --force-reinstall git+https://github.com/WFP-VAM/DataBridgesKnots.git@dev
```

STATA and R users will also need the appropriate optional dependencies to use this package in their respective software. To install the package with these dependencies, use the following command:

***STATA users***
```
pip install git+https://github.com/WFP-VAM/DataBridgesKnots.git#egg=data_bridges_knots[STATA]
```

***R users***
```
pip install git+https://github.com/WFP-VAM/DataBridgesusKnots.git#egg=data_bridges_knots[R]
```

## Configuration
1. Create a ```data_bridges_api_config.yaml``` in the main folder you're running your core from.
2. The structure of the file is:
```
```yaml
NAME: ''
VERSION : ''
KEY: ''
SECRET: ''
DATA_BRIDGES_API_KEY = ''
SCOPES:
- ''
- ''
Expand All @@ -29,7 +42,7 @@ pip install git+https://github.com/WFP-VAM/DataBridgesKnots.git
3. External users can reach out to [[email protected]](mailto:[email protected]) for support on getting the API credentials.

### Python
Run the following code to extract household survey data.
Run the following code to extract commoditiy data.

```python

Expand All @@ -39,18 +52,11 @@ CONFIG_PATH = r"data_bridges_api_config.yaml"

client = DataBridgesShapes(CONFIG_PATH)

#%% XSLForm definition and Household dataset

CONGO_CFSVA = {
'questionnaire': 1509,
'dataset': 3094
}
# get household survey data
survey_data = client.get_household_survey(survey_id=CONGO_CFSVA["dataset"], access_type='full')
# get XLSForm data
questionnaire = client.get_household_questionnaire(CONGO_CFSVA["questionnaire"])
# COMMODITY DATA
commodity_units_list = client.get_commodity_units_list(country_code="TZA", commodity_unit_name="Kg", page=1, format='json')

```
Additional examples are in the [examples](https://github.com/WFP-VAM/DataBridgesKnots/tree/main/examples) folder.

## Contributing
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.
Expand Down
96 changes: 40 additions & 56 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,46 @@
# Roadmap for DataBridgesUtils

This document outlines the planned features and improvements for the `DataBridgesUtils` package, which provides a wrapper for the WFP Data Bridges API.

## Upcoming Release: 0.1.0 (DEV)

### Wrapper Endpoints

The following endpoints will be added or improved in the upcoming release:

- [X] Exchange rates
- [X] Food security (IPC)
- [X] GORP (Global Operational Response Plan)
- [X] Market prices
- [X] Surveys
- [X] XSL Forms

### Wrapper Endpoints
- [X] Get variable labels
- [X] Get value labels
- [ ] Output dta with value and variable labels

### Examples and Documentation

- [X] Provide an example file in Python demonstrating the usage of available endpoints
- [X] Provide an example file in STATA demonstrating the usage of available endpoints
- [ ] Test
- [ ] Provide an example file in R demonstrating the usage of available endpoints
- [ ] Test
- [X] Update the README file with Python usage examples
- [X] Add documentation for STATA users in the README file

### Repository Setup

- [X] Create a GitHub repository for the `DataBridgesUtils` package
- [X] Configure optional dependencies in the project files
- [X] Set up the package installation process

## Improvements (1.1.0)

## Bug fixing
- [ ] DPO change for GORP
# Roadmap for DataBridgesKnots

This document outlines the planned features and improvements for the `DataBridgesKnots` package, which provides a wrapper for the WFP Data Bridges API.

## Upcoming Release: 1.0.0 (DataBridges API v5.0)

### New Features
- [ ] Update setup.py and pyproject.toml to include DataBridges API v5.0
- [X] Endpoints: CommoditiesApis
- [X] Endpoints: CurrencyApi
- [X] Endpoints: EconomicDataApi
- [X] Endpoints: MarketsApi
- [X] Endpoints: FoodSecurityApi
- [X] Endpoints: GorpApi
- [X] Endpoints: MarketPricesAPi
- [X] Endpoints: IncubationApi
- [X] Endpoints: RpmeApi
- [ ] Endpoints: SurveysApi
- [ ] Endpoints: XlsFormsApi

### Bug Fixes
- [ ] DPO change for XLSForm
- [ ] Fix optional dependencies for STATA
- [ ] Markets GeoJSON response
- [ ] JSON to DataFrame response
- [ ] Market list JSON and CSV

## Future Release
### v1.x.1
- [ ] Documentation: Enhance documentation and provide more usage examples
- [ ] GitHub Actions linting and testing
- [ ] Test AIMS and RPME endpoints

### v1.1.0
- [ ] R example files
- [ ] Handle SSL certificate error

## Wrapper points
- [ ] Economic data
- [ ] Commodities
- [ ] Commodity units
- [ ] Markets
- [ ] RPME (Resource Planning and Monitoring Environment)

## Future Releases (2.0.0)
### v1.2.0
- [ ] STATA support
- [ ] Fix optional dependencies for STATA

- [ ] Improve error handling and logging
- [ ] Add unit tests and integration tests
- [ ] Enhance documentation and provide more usage examples
- [ ] Optimize performance and improve code efficiency
- [ ] Implement additional features based on user feedback and requirements
## Future Releases (2.0.0 and beyond)
- Testing: Unit testing
- Testing: Improve error handling and logging
- Refactoring: Optimize performance and improve code efficiency

Please note that this roadmap is subject to change, and the priorities may be adjusted based on the project's needs and available resources.
11 changes: 6 additions & 5 deletions data_bridges_api_config_sample.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
NAME: ''
VERSION : ''
KEY: ''
SECRET: ''
SCOPES:
NAME: 'name-of-the-application'
VERSION : '5.0.0'
KEY: '' # WFP API Gateway API Key
SECRET: '' # WFP API Gateway API Secret
DATABRIDGES_API_KEY = '' # WFP DataBridges API Key (required for household data)
SCOPES: # WFP DataBridges API Scopes (required for restricted endpoints)
- ''
- ''
Loading
Loading