HelloSign Python SDK
A Python wrapper for the HelloSign API, enabling programmatic interaction with e-signature workflows. It supports document creation, signature requests, template management, and more. The current stable version is 4.0.0, and it follows an active release cadence for new features and maintenance.
Common errors
-
ModuleNotFoundError: No module named 'hellosign_sdk'
cause The `hellosign-python-sdk` package is not installed in your current Python environment.fixRun `pip install hellosign-python-sdk` in your terminal. -
AttributeError: module 'hellosign_sdk' has no attribute 'Client'
cause You are trying to import the old client class name (`Client`) from a version 4.0.0 or newer installation.fixChange your import from `from hellosign_sdk import Client` to `from hellosign_sdk import HSClient`. -
hellosign_sdk.exceptions.HSException: The API Key is not valid. Please double check that you are using a valid API Key.
cause The API key provided during client initialization is incorrect, expired, or has leading/trailing whitespace.fixVerify your HelloSign API key from your HelloSign dashboard. Ensure no extra characters are included and that it's active.
Warnings
- breaking The main client class was renamed from `Client` to `HSClient` in version 4.0.0. Code using `from hellosign_sdk import Client` will fail.
- gotcha Authentication methods typically require an API Key or OAuth token. Ensure your key/token is correctly configured and has the necessary permissions for the API calls you are making.
- gotcha API errors are raised as exceptions. It's crucial to implement `try-except` blocks to catch `hellosign_sdk.exceptions.HSException` to handle API-specific errors gracefully.
Install
-
pip install hellosign-python-sdk
Imports
- HSClient
from hellosign_sdk import Client
from hellosign_sdk import HSClient
- HSException
from hellosign_sdk.exceptions import HSException
Quickstart
import os
from hellosign_sdk import HSClient
from hellosign_sdk.exceptions import HSException
# Initialize the client with your API key
# It's recommended to use environment variables for sensitive data.
api_key = os.environ.get('HELLOSIGN_API_KEY', 'YOUR_API_KEY')
if not api_key or api_key == 'YOUR_API_KEY':
print("Please set the HELLOSIGN_API_KEY environment variable or replace 'YOUR_API_KEY' with your actual key.")
else:
client = HSClient(api_key=api_key)
try:
# Example: Get account information
account = client.get_account()
print(f"Successfully connected to HelloSign API. Account email: {account.email_address}")
# Example: List available templates (first page)
templates = client.get_templates(page=1, page_size=10)
if templates:
print(f"Found {len(templates)} templates. First template name: {templates[0].name}")
else:
print("No templates found for this account.")
except HSException as e:
print(f"HelloSign API Error: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")