-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated examples for STATA and Python. Partially linted code
- Loading branch information
1 parent
038c7e6
commit 2b1985d
Showing
5 changed files
with
68 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
""" | ||
Wrapper for DataBridges client, making it easier to load data in Python, R and STATA. | ||
""" | ||
|
||
from .get_data import DataBridgesShapes | ||
from .load_stata import load_stata | ||
from .load_stata import load_stata | ||
|
||
__all__ = ['DataBridgesShapes', 'load_stata'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
# Load the reticulate package | ||
library(reticulate) | ||
|
||
# Set the path to your Python script | ||
py_script <- "path/to/sample_python_load.py" | ||
|
||
# Source the Python script | ||
source_python(py_script) | ||
|
||
# Call the Python functions | ||
config_path <- "path/to/data_bridges_api_config.yaml" | ||
survey_id <- 3329 | ||
access_type <- "full" | ||
country_iso3 <- "AFG" | ||
survey_date <- "2022-01-01" | ||
|
||
# Get survey data | ||
survey_data <- get_survey_data(config_path, survey_id, access_type) | ||
|
||
# Get price data | ||
price_data <- get_price_data(config_path, country_iso3, survey_date) | ||
# TODO: Load into R dataframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters