{"id":19477515,"url":"https://github.com/christopherlai/usps","last_synced_at":"2025-02-25T16:25:52.439Z","repository":{"id":62430658,"uuid":"245239469","full_name":"christopherlai/usps","owner":"christopherlai","description":"Elixir wrapper for USPS API","archived":false,"fork":false,"pushed_at":"2020-03-06T22:41:02.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T06:42:39.287Z","etag":null,"topics":["elixir","usps"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christopherlai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-05T18:32:57.000Z","updated_at":"2020-03-06T22:40:18.000Z","dependencies_parsed_at":"2022-11-01T20:22:07.985Z","dependency_job_id":null,"html_url":"https://github.com/christopherlai/usps","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherlai%2Fusps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherlai%2Fusps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherlai%2Fusps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherlai%2Fusps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christopherlai","download_url":"https://codeload.github.com/christopherlai/usps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240702783,"owners_count":19843971,"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":["elixir","usps"],"created_at":"2024-11-10T19:45:14.445Z","updated_at":"2025-02-25T16:25:52.415Z","avatar_url":"https://github.com/christopherlai.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# USPS\nA wrapper around the [USPS XML API](https://www.usps.com/business/web-tools-apis/).\n\n## Installation\nThe package can be installed by adding `usps` to your list of dependencies in `mix.exs` along with `hackney`.\n```elixir\n# mix.exs\ndefp deps do\n  {:usps, \"~\u003e 0.1\"},\n  {:hackney, \"~\u003e 1.0\"}\nend\n```\n\n## Configuration\nConfigurations are managed through the project configs. `:url`, `:path`, and `:user_id` are required keys.\n\nThe`:url` and`:path` can be found in the [USPS documentation](https://www.usps.com/business/web-tools-apis/documentation-updates.htm). You must [register](https://registration.shippingapis.com/) for an account with with USPS to obtain a `:user_id`.\n```elixir\n# config.exs\nimport Config\n\nconfig :usps,\n  url: \"https://secure.shippingapis.com\",\n  path: \"/ShippingAPI.dll\",\n  user_id: \"\u003cYOUR-USER-ID\u003e,\n  client: MyApp.Client #optional\n```\n\n##  Testing\nA combination of `mox` and `behaviours` are used for testing.\n```elixir\n# test_helper.exs\nExUnit.start()\nMox.defmock(MyApp.UspsTestClient, for: Usps.Client)\n\n# my_app_test.exs\ndefmodule MyAppTest do\n  use ExUnit.Case\n  import Mox\n  setup :verify_on_exit!\n\n  test \"test usps\" do\n   expect(MyApp.UspsTestClient, :request, fn _url -\u003e\n      {:ok, %{status_code: 200, headers: [], body:\"\"}}\n    end)\n\n    assert {:ok, response} =\n      \"1234\"\n      |\u003e Usps.Shipment.new()\n      |\u003e Usps.request()\n  end\nend\n```\n\nPlease see [`mox`](https://hexdocs.pm/mox/Mox.html) for more information.\n\n## Code Status\n![ci](https://github.com/christopherlai/usps/workflows/ci/badge.svg)\n\n## License\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopherlai%2Fusps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristopherlai%2Fusps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopherlai%2Fusps/lists"}