Skip to content

Commit

Permalink
Rename to postal
Browse files Browse the repository at this point in the history
  • Loading branch information
aedobbyn committed Jul 6, 2018
1 parent 3777f55 commit 516f35a
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 30 deletions.
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Package: usps
Package: postal
Type: Package
Title: United States Postal Service API Interface
Version: 0.1.0
Author: Amanda Dobbyn <[email protected]>
Maintainer: Amanda Dobbyn <[email protected]>
Description: Interface to the United States Postal Service Zone Calc API
Description: This package serves as an interface to the United States Postal Service Post Calc and Zone Calc APIs.
It allows users to find the postage price, delivery day, and other information for packages and envelopes,
as well as to find the postal zone for an origin and a destination zip code pair.
Depends: R (>= 2.10)
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: TRUE
URL: https://github.com/aedobbyn/usps/
BugReports: https://github.com/aedobbyn/usps/issues/
URL: https://github.com/aedobbyn/postal/
BugReports: https://github.com/aedobbyn/postal/issues/
Imports:
curl,
dplyr,
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# usps 0.1.0
# postal 0.1.0

This is the first version of the usps package.
This is the first version of the postal package.
4 changes: 2 additions & 2 deletions R/usps-package.R → R/postal-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#' To get postage information, use \code{fetch_mail}.
#' To get zones, use \code{get_zone_three_digit} or \code{get_zone_five_digit}.
#'
#' The zones vignette can be found with \code{browseVignettes(package = "usps")}.
#' The zones vignette can be found with \code{browseVignettes(package = "postal")}.

#' @name usps
#' @name postal
#' @docType package
NULL
22 changes: 11 additions & 11 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ knitr::opts_chunk$set(
)
```

# usps `r emo::ji("mailbox")`
# postal `r emo::ji("mailbox")`

[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![Travis build status](https://travis-ci.org/aedobbyn/usps.svg?branch=master)](https://travis-ci.org/aedobbyn/usps)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/aedobbyn/usps?branch=master&svg=true)](https://ci.appveyor.com/project/aedobbyn/usps)
[![Coverage status](https://codecov.io/gh/aedobbyn/usps/branch/master/graph/badge.svg)](https://codecov.io/github/aedobbyn/usps?branch=master)
[![Travis build status](https://travis-ci.org/aedobbyn/postal.svg?branch=master)](https://travis-ci.org/aedobbyn/postal)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/aedobbyn/postal?branch=master&svg=true)](https://ci.appveyor.com/project/aedobbyn/postal)
[![Coverage status](https://codecov.io/gh/aedobbyn/postal/branch/master/graph/badge.svg)](https://codecov.io/github/aedobbyn/postal?branch=master)

Want an estimate of the price of sending a package somewhere via the US Postal Service? Need to get the USPS shipping zone between two zip codes?

Well, this is a `r emo::ji("package")` for your `r emo::ji("package")`s. `usps` provides a tidy interface to the USPS domestic [zone calc](https://postcalc.usps.com/DomesticZoneChart/) and [post calc](https://postcalc.usps.com/Calculator/) APIs.
Well, this is a `r emo::ji("package")` for your `r emo::ji("package")`s. `postal` provides a tidy interface to the USPS domestic [zone calc](https://postcalc.postal.com/DomesticZoneChart/) and [post calc](https://postcalc.postal.com/Calculator/) APIs.

### Installation

```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("aedobbyn/usps")
devtools::install_github("aedobbyn/postal")
```


Expand All @@ -51,7 +51,7 @@ Currently only destinations in the US are supported.
Specify a 5-digit origin zip and destination zip, along with the date and time you're going to be shipping (`"today"` and `"now"` are allowed). Other specifics are optionals.

```{r}
library(usps)
library(postal)
```

USPS offers many colorful options to handle all your shipping needs, which are included in the arguments to `fetch_mail`. So to answer the burning question...what if we wanted to ship live animals from Wyoming to Philly by ground on July 2 at 2:30pm in a nonrectangular package??
Expand Down Expand Up @@ -210,7 +210,7 @@ origin_zips %>%
```


Similarly, map over both origin and destination zips and end up at a dataframe. `verbose` gives you a play-by-play if you want it. (More on auto-prepending leading 0s to input zips in the [On Digits](https://github.com/aedobbyn/usps#on-digits) section below.)
Similarly, map over both origin and destination zips and end up at a dataframe. `verbose` gives you a play-by-play if you want it. (More on auto-prepending leading 0s to input zips in the [On Digits](https://github.com/aedobbyn/postal#on-digits) section below.)

```{r}
dest_zips <- c("867", "53", "09")
Expand Down Expand Up @@ -306,7 +306,7 @@ But if you just want to use the equivalent of the ["Get Zone for ZIP Code Pair"]
fetch_zones_five_digit("31415", "92653")
```

Details given when `show_details = TRUE` in `fetch_zones_five_digit` are slightly different than they are for `fetch_zones_three_digit` (see [Details](https://github.com/aedobbyn/usps#details)).
Details given when `show_details = TRUE` in `fetch_zones_five_digit` are slightly different than they are for `fetch_zones_three_digit` (see [Details](https://github.com/aedobbyn/postal#details)).

<br>

Expand Down Expand Up @@ -362,11 +362,11 @@ zips_zones_sample
```


The sample is about a quarter of the total number of rows between all origin prefixes and all destination prefixes, plus the 5 digit exceptions (~4m rows). See it put to use in the [vignette](https://github.com/aedobbyn/usps/blob/dev/vignettes/getting-zoned.Rmd).
The sample is about a quarter of the total number of rows between all origin prefixes and all destination prefixes, plus the 5 digit exceptions (~4m rows). See it put to use in the [vignette](https://github.com/aedobbyn/postal/blob/dev/vignettes/getting-zoned.Rmd).

<br>

That's it! [Bug reports](https://github.com/aedobbyn/usps/issues) and PRs welcome! `r emo::ji("mailbox_with_mail")`
That's it! [Bug reports](https://github.com/aedobbyn/postal/issues) and PRs welcome! `r emo::ji("mailbox_with_mail")`

<p align="center">
<img src="https://media.giphy.com/media/2fTYDdciZFEKZJgY7g/giphy.gif" alt="catch_mailman">
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ This is a first-time submission.
0 errors | 0 warnings | 0 note

## Downstream dependencies
I have also run R CMD check on downstream dependencies of usps.
I have also run R CMD check on downstream dependencies of postal.
All packages that I could install passed.
10 changes: 5 additions & 5 deletions man/usps.Rd → man/postal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
10 changes: 5 additions & 5 deletions vignettes/getting-zoned.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ library(ggplot2)
library(glue)
library(dplyr)
library(tidyr)
library(usps)
library(postal)
library(zipcode)
```

The `usps::zips_zones_sample` dataset provides a quarter of the ~4 million 3-digit origin-destination pairs. (If you want allll of them, you can run `fetch_all` and put on a pot of coffee.)
The `postal::zips_zones_sample` dataset provides a quarter of the ~4 million 3-digit origin-destination pairs. (If you want allll of them, you can run `fetch_all` and put on a pot of coffee.)

What if we wanted to use that to plot how zones increase as the destination gets farther from the origin?

We'll need a measure of latitude and longitude for that. Luckily, data from the [`zipcode`](https://github.com/cran/zipcode) package relates every zip codes to its latitude and longitude. We can that along with the *partial* data in `usps::zips_zones_sample` to match up zips to latitudes and longitudes.
We'll need a measure of latitude and longitude for that. Luckily, data from the [`zipcode`](https://github.com/cran/zipcode) package relates every zip codes to its latitude and longitude. We can that along with the *partial* data in `postal::zips_zones_sample` to match up zips to latitudes and longitudes.

Let's load in the randomly sampled `usps` package data.
Let's load in the randomly sampled `postal` package data.

```{r}
data(zips_zones_sample)
zips_zones_sample
```

Later we'll `select` away all the other details and focus just on `origin_zip`, `dest_zip`, and `zone`. As we know, the `usps::zip_zones` data displays all origin zips as 3 digit prefixes and most destination zips as 3 digits as well.
Later we'll `select` away all the other details and focus just on `origin_zip`, `dest_zip`, and `zone`. As we know, the `postal::zip_zones` data displays all origin zips as 3 digit prefixes and most destination zips as 3 digits as well.

However, the `zipcode::zipcode` data displays zips in the usual way, as 5 digit.

Expand Down

0 comments on commit 516f35a

Please sign in to comment.