Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Shippo is a shipping API that connects you with multiple shipping carriers (such as USPS, UPS, DHL, Canada Post, Australia Post, and many others) through one interface.
You must register for a Shippo account to use our API. It's free to sign up. Only pay to print a live label, test labels are free.
To use the API, you must generate an API Token. In the following examples, replace <YOUR_API_KEY_HERE>
with your own token.
For example.
api_key_header="shippo_test_595d9cb0c0e14497bf07e75ecfec6c6d"
Shippo external API.: Use this API to integrate with the Shippo service
The SDK can be installed using the pip package manager, with dependencies and metadata stored in the setup.py
file.
pip install shippo
pip install --force-reinstall -I shippo==3.4.4
import shippo
shippo_sdk = shippo.Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
# the API version can be globally set, though this is normally not required
# shippo_api_version='<YYYY-MM-DD>',
)
address_list = shippo_sdk.addresses.list()
if address_list is not None:
# handle response
pass
The Python SDK makes API calls using the requests HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom requests.Session
object.
For example, you could specify a header for every request that this sdk makes as follows:
import shippo
import requests
http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = shippo.Shippo(client=http_client)
The Shippo Python SDK returns schema models directly rather than wrapping the response in an envelope along with
additional request/response details (status code, raw json, etc). However, there are times when the underlying
http information is useful so a 'debug' client is provided. Using this client, you can retrieve the
requests.PreparedRequest
and requests.Response
from the most recent API call.
import shippo
from shippo.debug import DebugSession
debug_session = DebugSession()
shippo_sdk = shippo.Shippo(api_key_header="<YOUR_API_KEY_HERE>", client=debug_session)
shippo_sdk.addresses.list()
# print the previous request http headers
print(debug_session.last_request.headers)
# print the previous response status code and raw json
print(debug_session.last_response.status_code, debug_session.last_response.text)
Review our full guides and references at https://docs.goshippo.com/.
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release.
Connect with multiple different carriers, get discounted shipping labels, track parcels, and much more with just one integration. You can use your own carrier accounts or take advantage of our discounted rates with the Shippo carrier accounts. Using Shippo makes it easy to deal with multiple carrier integrations, rate shopping, tracking and other parts of the shipping workflow. We provide the API and web app for all your shipping needs.
FAQs
Shipping API Python library (USPS, FedEx, UPS and more)
We found that shippo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.