{"id":5060,"library":"smartlingapisdk","title":"Smartling API SDK for Python","description":"The Smartling API SDK for Python simplifies interaction with Smartling's cloud-based translation services APIs from Python applications. It provides a convenient, idiomatic Python interface to automate translation workflows, including file uploads, downloads, job management, and string operations. The current version is 3.1.9, and the library receives regular updates to support new API features and improvements.","status":"active","version":"3.1.9","language":"en","source_language":"en","source_url":"https://github.com/Smartling/api-sdk-python","tags":["translation","localization","l10n","i18n","api","sdk"],"install":[{"cmd":"pip install SmartlingApiSDK","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"FilesApi","correct":"from smartlingApiSdk.api import FilesApi"},{"symbol":"JobsApi","correct":"from smartlingApiSdk.api import JobsApi"},{"symbol":"StringsApi","correct":"from smartlingApiSdk.api import StringsApi"},{"symbol":"AccountProjectsApi","correct":"from smartlingApiSdk.api import AccountProjectsApi"},{"symbol":"ContextApi","correct":"from smartlingApiSdk.api import ContextApi"},{"symbol":"EstimatesApi","correct":"from smartlingApiSdk.api import EstimatesApi"},{"symbol":"JobBatchesV2Api","correct":"from smartlingApiSdk.api import JobBatchesV2Api"},{"symbol":"TagsApi","correct":"from smartlingApiSdk.api import TagsApi"},{"note":"Used for loading credentials from a file, though environment variables are often preferred.","symbol":"Credentials","correct":"from smartlingApiSdk.Credentials import Credentials"}],"quickstart":{"code":"import os\nfrom smartlingApiSdk.api import ProjectsApi\n\nUSER_IDENTIFIER = os.environ.get('SMARTLING_USER_IDENTIFIER', '')\nUSER_SECRET = os.environ.get('SMARTLING_USER_SECRET', '')\nACCOUNT_ID = os.environ.get('SMARTLING_ACCOUNT_ID', '')\n\nif not all([USER_IDENTIFIER, USER_SECRET, ACCOUNT_ID]):\n    print(\"Please set SMARTLING_USER_IDENTIFIER, SMARTLING_USER_SECRET, and SMARTLING_ACCOUNT_ID environment variables.\")\nelse:\n    try:\n        projects_api = ProjectsApi(USER_IDENTIFIER, USER_SECRET, ACCOUNT_ID)\n        # List projects in the account\n        projects_response = projects_api.listProjects()\n        print(\"Successfully connected to Smartling and listed projects.\")\n        print(f\"First 3 projects: {projects_response.data.items[:3]}\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the `ProjectsApi` client using Smartling API credentials (user identifier, user secret, and account ID) retrieved from environment variables. It then attempts to list the first three projects associated with the account, verifying successful connectivity and basic API interaction. Ensure you set the `SMARTLING_USER_IDENTIFIER`, `SMARTLING_USER_SECRET`, and `SMARTLING_ACCOUNT_ID` environment variables before running."},"warnings":[{"fix":"Monitor Smartling's API documentation and release notes for new API versions and associated breaking changes. Upgrade the SDK and update your code accordingly when migrating to a new API version.","message":"Smartling API breaking changes are released in new API versions. These can include removing/renaming endpoints or parameters, changing data types, making optional parameters required, or altering authentication requirements. Always refer to the official API reference for the specific version you are using.","severity":"breaking","affected_versions":"All versions (API dependent)"},{"fix":"Trust the SDK to manage authentication tokens; avoid attempting manual token refresh unless you are directly interacting with the REST API without the SDK.","message":"While Smartling's underlying API uses OAuth2 with expiring access tokens, the Python SDK automatically handles authentication and token refreshing. You provide your `userIdentifier` and `userSecret` once during client initialization, and the SDK manages the access token lifecycle.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For key-based resource files with pre-translated strings that also require HTML processing, upload the source file first *without* HTML processing. Import the translations, then re-upload the source file *with* HTML processing enabled. Smartling may use SmartMatch for existing translations, but some strings might need re-translation.","message":"When importing translations for files that use HTML processing, a specific sequence of operations is required to prevent string fragmentation and loss of keys. Upload the file without HTML processing, import translations, then re-upload with HTML processing enabled.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware of this limitation when migrating TMX files from other systems. If plural information is critical, plan to manage it outside the TMX import process or re-enter it within Smartling after import.","message":"Importing Translation Memory eXchange (TMX) files into Smartling does not preserve plural information. Once imported, all plural form details for those translations are lost.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}