{"id":17133814,"url":"https://github.com/jereinhardt/shipping-scale","last_synced_at":"2025-03-24T05:44:33.745Z","repository":{"id":56895350,"uuid":"74838369","full_name":"jereinhardt/shipping-scale","owner":"jereinhardt","description":"An ruby interface for the USPS Rate Calculator API","archived":false,"fork":false,"pushed_at":"2017-02-05T13:59:09.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T10:41:27.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jereinhardt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-26T16:50:57.000Z","updated_at":"2017-02-21T06:39:17.000Z","dependencies_parsed_at":"2022-08-21T01:20:40.431Z","dependency_job_id":null,"html_url":"https://github.com/jereinhardt/shipping-scale","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jereinhardt%2Fshipping-scale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jereinhardt%2Fshipping-scale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jereinhardt%2Fshipping-scale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jereinhardt%2Fshipping-scale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jereinhardt","download_url":"https://codeload.github.com/jereinhardt/shipping-scale/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217789,"owners_count":20579297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T19:43:06.056Z","updated_at":"2025-03-24T05:44:33.707Z","avatar_url":"https://github.com/jereinhardt.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShippingScale\n\nShippingScale is a simple interface with the USPS Price Calculator API.  With it, you can quickly and easily calculate postage prices for packages.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'shipping-scale'\n\n# or from the github repository\ngem 'shipping-scale', :git =\u003e 'https://github.com/jereinhardt/shipping-scale.git'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install shipping-scale\n\n## Setup\n\nIn order to properly configure your interface, you must first have a registered developer account with the US Postal Service.  \n\nAdd an initializer to your application and configure it to use your API USER ID\n\n```ruby \nShippingScale.configure do |config|\n  config.user_id = ENV[\"USPS_USER_ID\"]\n  config.timeout = 5\n  config.testing = false\nend\n```\n\n## Usage\n\nIf you have all of the necessary information for the package you want to ship, using the gem is as simple as creating an instance of `ShipingScale::Package` and using `#get_price!`.  Other details are also returned with this method.\n\n```ruby\npackage_options = { \n  pounds: 1,\n  ounces: 8, # or weight: 1.5\n  zip_origin: \"66204\",\n  zip_destination: \"63501\" \n}\n\npackage = ShippingScale::Package.new(package_options)\n\n# for the value of postage on a single package\npackage.price # =\u003e 15\n\n# for other details sent back from the request\npackage.details # =\u003e { zip_origination: \"66204\", zip_destination: \"63501\", pounds: \"1\", ... }\n```\n\nYou can also get the price of multiple packages sent in the same shipment.  \n\n```ruby\npackages = [\n  {pounds: 1, ...},\n  {pounds: 5, ...}\n]\n\nshipment = ShippingScale::Package.shipment(packages)\n\n# for the total price of the shipment\nshipment.price # =\u003e 25\n\n# for the price of each individual package in the shipment, by package ID\nshipment.prices # =\u003e {\"1\" =\u003e 10, \"2\" =\u003e 15}\n\n# for details sent back by the request\nshipment.details # =\u003e { zip_origination: \"66204\", ... }\n```\n\nCurrently, all rates retreived from the USPS API are for 2-day Priority Mail only.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\nBug reports and pull requests are welcome on GitHub at https://github.com/jereinhardt/shipping-scale.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjereinhardt%2Fshipping-scale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjereinhardt%2Fshipping-scale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjereinhardt%2Fshipping-scale/lists"}