The Socket Security Python SDK provides an interface to interact with the Socket API for software supply chain security scanning. It allows users to scan packages, retrieve security insights, and manage their Socket account programmatically. The current version is 3.0.32, and it follows an active release cadence with regular updates.
pip install socketdevVerified import paths — ran on the pinned version, not inferred.
Initializes the SocketSDKClient using an API key (preferably from an environment variable) and performs a basic package scan. Demonstrates handling of the returned `ScanPackageResult` object.
Review the official documentation and migration guide for `socketdev` 3.x. Update method signatures, parameter names, and how return values are accessed (e.g., `result.status` instead of `result['status']`). If upgrading from 2.x, carefully check all API calls.
Ensure `os.environ['SOCKET_API_KEY']` is set before initializing the client, or explicitly pass `api_key='YOUR_API_KEY'` during client instantiation. Always protect your API key.
Refer to the Socket API documentation for the list of supported `ecosystem` values. For Python packages, use `ecosystem='pypi'`.