{"id":18810982,"url":"https://github.com/shipengine/shipengine-python","last_synced_at":"2025-04-13T20:31:18.046Z","repository":{"id":46699908,"uuid":"343500391","full_name":"ShipEngine/shipengine-python","owner":"ShipEngine","description":"The official Python SDK for ShipEngine API","archived":false,"fork":false,"pushed_at":"2024-01-12T20:04:16.000Z","size":409,"stargazers_count":8,"open_issues_count":1,"forks_count":8,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-04-14T10:48:14.200Z","etag":null,"topics":["address-normalization","address-validation","api","dhl-api","fedex-api","package-tracking","python","rest-api","sdk","shipengine","shipment-tracking","shipping-api","shipping-label","shipping-rates","tracking-number","ups-api","usps-api"],"latest_commit_sha":null,"homepage":"https://www.shipengine.com/docs/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShipEngine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-01T17:28:18.000Z","updated_at":"2024-04-14T10:48:14.201Z","dependencies_parsed_at":"2023-01-22T15:15:08.890Z","dependency_job_id":null,"html_url":"https://github.com/ShipEngine/shipengine-python","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/ShipEngine%2Fshipengine-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShipEngine%2Fshipengine-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShipEngine%2Fshipengine-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShipEngine%2Fshipengine-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShipEngine","download_url":"https://codeload.github.com/ShipEngine/shipengine-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223603621,"owners_count":17172128,"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":["address-normalization","address-validation","api","dhl-api","fedex-api","package-tracking","python","rest-api","sdk","shipengine","shipment-tracking","shipping-api","shipping-label","shipping-rates","tracking-number","ups-api","usps-api"],"created_at":"2024-11-07T23:23:39.977Z","updated_at":"2024-11-07T23:23:40.438Z","avatar_url":"https://github.com/ShipEngine.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ShipEngine](https://shipengine.github.io/img/shipengine-logo-wide.png)](https://shipengine.com)\n\nShipEngine Python SDK\n=====================\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ShipEngine/shipengine-python/Python%20package?label=shipengine-python\u0026logo=github\u0026logoColor=white)\n[![Coverage Status](https://coveralls.io/repos/github/ShipEngine/shipengine-python/badge.svg?branch=main)](https://coveralls.io/github/ShipEngine/shipengine-python?branch=main)\n![GitHub](https://img.shields.io/github/license/shipengine/shipengine-python?color=blue)\n![OS Compatibility](https://shipengine.github.io/img/badges/os-badges.svg)\n\n- The official Python module for ShipEngine API.\n\nQuick Start\n===========\n\nInstall `shipengine` via `pip`:\n```bash\npip install shipengine\n```\n\n- The only configuration requirement is providing an [API Key](https://www.shipengine.com/docs/auth/#api-keys \"ShipEngine Authentication Docs\").\n\n\u003e The following assumes that you have already set the `SHIPENGINE_API_KEY` environment variable with your API Key using `os.environ[\"SHIPENGINE_API_KEY\"] = \"\u003cYOUR_API_KEY_HERE\u003e\"`.\n\nInstantiate ShipEngine Class\n----------------------------\n\n```python\nimport os\n\nfrom shipengine import ShipEngine\n\napi_key = os.getenv(\"SHIPENGINE_API_KEY\")\n\nshipengine = ShipEngine(api_key)\n```\n- You can also pass in a `dictionary` containing configuration options instead of just passing in a string that is your `API Key`.\n\n```python\nimport os\n\nfrom shipengine import ShipEngine\n\napi_key = os.getenv(\"SHIPENGINE_API_KEY\")\n\nshipengine = ShipEngine(\n    {\"api_key\": api_key, \"page_size\": 75, \"retries\": 3, \"timeout\": 10}\n)\n```\n\nMethods\n-------\n- [addresses_validate](./docs/addresses_validate_example.md) - Indicates whether the provided address is valid. If the\n  address is valid, the method returns a normalized version of the address based on the standards of the country in\n  which the address resides.\n- [create_label_from_rate_id](./docs/create_label_from_rate_id_example.md) - Purchase a label by `rate_id`. When using the `get_rates_from_shipment` method, you can use one of the returned `rate_id` values with this method to purchase a label against a given rate.\n- [create_label_from_shipment](./docs/create_label_from_shipment.md) - Purchase a label created from shipment details.\n- [get_rates_from_shipment](./docs/get_rates_from_shipment_example.md) - Fetch rates from shipment details to shop the best shipping rate for your package.\n- [list_carriers](./docs/list_carriers_example.md) - Lists the carrier accounts connected to your SHipEngine account.\n- [track_package_by_label_id](./docs/track_package_by_label_id_example.md) - Track a package by `label_id`, the preferred way to track shipments if you crate shipping labels using ShipEngine. This method returns\nthe all tracking events for a given shipment.\n- [track_package_by_carrier_code_and_tracking_number](./docs/track_package_by_carrier_code_and_tracking_number_example.md) - Track a package by `carrier_code` and `tracking_number`. This method returns\nthe all tracking events for a given shipment.\n- [void_label_by_label_id](./docs/void_label_by_label_id_example.md) - Void a shipping label you created using ShipEngine by its `label_id`. This method returns an object that indicates the status of the void label request.\n\nClass Objects\n-------------\n- [ShipEngine](./) - A configurable entry point to the ShipEngine API SDK, this class provides convenience methods\n  for various ShipEngine API Services.\n\nContributing\n============\n\nLocal Development\n-----------------\n\u003e You will need to install `Python3.7` if you do not have it locally, before working on this project.\n\nThis project uses [Poetry]() to manage project dependencies, build steps, and publishing to [PYPI]().\n\nYou can use the following `curl` command to download **Poetry** from your terminal is you are\non `osx / linux / bashonwindows`:\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -\n```\n\n- Once you have **Poetry** installed you need to install the projects dependencies with this command from the project root:\n\n```bash\nbin/setup\n```\n- This script will install all dependencies specified in `pyproject.toml` via `Poetry` and install the `pre-commit` hooks\nthis project uses.\n\n## Adding dependencies to the project\nIf your changes require you to install a python package/module using `poetry add \u003csome package\u003e` or\n`poetry add \u003csome package\u003e -D` for a dev dependency. You will also need to run the following command to\nregenerate a `requirements.txt` file that includes the newly added dependencies:\n```bash\npoetry export -f requirements.txt --output requirements.txt --without-hashes --dev\n```\n\n## Pre-Commit Hooks\nWe are using [Pre-Commit](https://pre-commit.com/) to enforce formatting, lint rules, and code analysis so that\nthis repo is always in good health.\n- `Pre-Commit` is installed and initialized when you run `bin/setup` from the project root as outlined above.\n\n- If you choose not to use `Poetry` and prefer `pip` you can simply run `pip install -r requirements.txt`\nTo be able to commit \u0026 push a PR to the repo after making changes locally, you will need to install `pre-commit` which\nis a tool that runs tests, linting, formatting, and code analysis on your changes.\n```bash\npre-commit install\n```\n\u003e Note: The checks run in pre-commit hooks are the same checks run in CI in our GitHub Actions.\n\nTesting\n-------\nYou can run the tests in the `tests/` directory using [Pytest]() in the **Poetry** environment like this:\n\n```bash\npoetry run pytest\n```\n\nOR via `Tox`:\n\n```bash\npoetry run tox\n```\n\nLinting\n-------\nYou can run the `linting environment` in **Tox** using this commandi:\n\n```bash\npoetry tox -e lint\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshipengine%2Fshipengine-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshipengine%2Fshipengine-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshipengine%2Fshipengine-python/lists"}