Skip to content

Commit

Permalink
Merge pull request #66 from ropensci/api-update
Browse files Browse the repository at this point in the history
merge new additions and some fixes to main
  • Loading branch information
datapumpernickel committed Oct 15, 2023
2 parents 55dce0a + 70a7702 commit ecf7b04
Show file tree
Hide file tree
Showing 54 changed files with 1,404 additions and 609 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
^data-raw$
^\.github$
^codecov\.yml$
^codemeta\.json$
^doc$
^Meta$
47 changes: 47 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing to comtradr

This outlines how to propose a change to comtradr.
For more detailed info about contributing to this, and other tidyverse packages, please see the
[**development contributing guide**](https://rstd.io/tidy-contrib).

## Fixing typos

You can fix typos, spelling mistakes, or grammatical errors in the documentation directly using the GitHub web interface, as long as the changes are made in the _source_ file.
This generally means you'll need to edit [roxygen2 comments](https://roxygen2.r-lib.org/articles/roxygen2.html) in an `.R`, not a `.Rd` file.
You can find the `.R` file that generates the `.Rd` by reading the comment in the first line.

## Bigger changes

If you want to make a bigger change, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed.
If you’ve found a bug, please file an issue that illustrates the bug with a minimal
[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed).

### Pull request process

* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("ropensci/comtradr", fork = TRUE)`.

* Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`.
If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.
* Create a Git branch for your pull request (PR). We recommend using `usethis::pr_init("brief-description-of-change")`.

* Make your changes, commit to git, and then create a PR by running `usethis::pr_push()`, and following the prompts in your browser.
The title of your PR should briefly describe the change.
The body of your PR should contain `Fixes #issue-number`.

* For user-facing changes, add a bullet to the top of `NEWS.md` (i.e. just below the first header). Follow the style described in <https://style.tidyverse.org/news.html>.

### Code style

* New code should follow the tidyverse [style guide](https://style.tidyverse.org).
You can use the [styler](https://CRAN.R-project.org/package=styler) package to apply these styles, but please don't restyle code that has nothing to do with your PR.

* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for documentation.

* We use [testthat](https://cran.r-project.org/package=testthat) for unit tests.
Contributions with test cases included are easier to accept.

## Code of Conduct

Please note that the comtradr project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this
project you agree to abide by its terms.
23 changes: 23 additions & 0 deletions .github/workflows/pkgcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pkgcheck

# This will cancel running jobs once a new run is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

on:
# Manually trigger the Action under Actions/pkgcheck
workflow_dispatch:
# Run on every push to main
push:
branches:
- main
- api-update

jobs:
pkgcheck:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: ropensci-review-tools/pkgcheck-action@main
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ TODO.md
R/test_package.R
test_package.R
inst/doc
/doc/
/Meta/
21 changes: 15 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
Package: comtradr
Title: Interface with the United Nations Comtrade API
Version: 0.3.0.09000
Authors@R: c(person("Chris", "Muir",
Version: 0.4.0.0
Authors@R: c(
person("Paul", "Bochtler",
email = "paulbochtler.gh@gmail.com",
role = c("aut", "cre","cph"),
comment = c(ORCID = "0000-0002-9146-6185")),
person("Harriet", "Goers",
email = "hgoers@umd.edu",
role = c("aut")),
person("Chris", "Muir",
email = "chrismuirRVA@gmail.com",
role = c("aut", "cre")),
role = c("aut")),
person("Alicia", "Schep",
role = "rev",
comment = c(ORCID = "0000-0002-3915-0618",
Expand All @@ -16,7 +24,7 @@ Authors@R: c(person("Chris", "Muir",
see https://github.com/ropensci/onboarding/issues/141")),
person("Juergen", "Amann", role=c("ctb")))
Description: Interface with and extract data from the United Nations Comtrade
API <https://comtrade.un.org/data/>. Comtrade provides country level shipping
API <https://comtradeplus.un.org/>. Comtrade provides country level shipping
data for a variety of commodities, these functions allow for easy API query
and data returned as a tidy data frame.
Depends: R (>= 4.1.0)
Expand All @@ -39,15 +47,16 @@ RoxygenNote: 7.2.3
URL: https://docs.ropensci.org/comtradr/, https://github.com/ropensci/comtradr
BugReports: https://github.com/ropensci/comtradr/issues
NeedsCompilation: no
Maintainer: Chris Muir <chrismuirRVA@gmail.com>
Maintainer: Paul Bochtler <paulbochtler.gh@gmail.com>
Suggests:
covr,
dplyr,
ggplot2,
httptest2,
knitr,
rmarkdown,
testthat (>= 3.0.0)
testthat (>= 3.0.0),
vcr
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ export(ct_update_databases)
export(ct_use_pretty_cols)
export(get_primary_comtrade_key)
export(set_primary_comtrade_key)
importFrom(lifecycle,deprecated)
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
comtradr 0.4
====================

Comtradr has received a complete overhaul. Please reference the Readme for all new functions and use-cases.

comtradr 0.3.0.09000
====================

Expand Down
1 change: 0 additions & 1 deletion R/comtradr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"_PACKAGE"

## usethis namespace: start
#' @importFrom lifecycle deprecated
## usethis namespace: end
NULL
22 changes: 21 additions & 1 deletion R/ct_build_request.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,27 @@
#'
#' @param verbose whether the function sends status updates to the console
#'
#' @return a httr2 request object
#' @examplesIf interactive()
#' # Build request from checked parameters
#' ct_build_request(comtradr:::ct_check_params(type = 'goods',
#' frequency = 'A',
#' commodity_classification = 'HS',
#' commodity_code = 'TOTAL',
#' flow_direction = 'all',
#' reporter = 'all',
#' partner = 'World',
#' start_date = 2020,
#' end_date = 2022,
#' process = TRUE,
#' tidy_cols = TRUE,
#' verbose = FALSE,
#' primary_token = 'xxxx',
#' mode_of_transport = '0',
#' partner_2 = 'World',
#' customs_code ='C00',
#' update = FALSE ))
#'
#' @returns a httr2 request object
ct_build_request <- function(params,
primary_token = NULL,
verbose = FALSE) {
Expand Down

0 comments on commit ecf7b04

Please sign in to comment.