Registry / http-networking / smartlingapisdk

smartlingapisdk

JSON →
library3.1.9pypypi✓ verified 22d ago

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.

pip install SmartlingApiSDK
INSTALL
IMPORT
SIG · SMARTLINGAPISDK
S
smartlingapisdk
http-networkingpythonv3.1.9
Install
1.6s avg
Import
131ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.1.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.134s · 18.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.128s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FilesApi
from smartlingApiSdk.api import FilesApi
JobsApi
from smartlingApiSdk.api import JobsApi
StringsApi
from smartlingApiSdk.api import StringsApi
AccountProjectsApi
from smartlingApiSdk.api import AccountProjectsApi
ContextApi
from smartlingApiSdk.api import ContextApi
EstimatesApi
from smartlingApiSdk.api import EstimatesApi
JobBatchesV2Api
from smartlingApiSdk.api import JobBatchesV2Api
TagsApi
from smartlingApiSdk.api import TagsApi
Credentials
from smartlingApiSdk.Credentials import Credentials
Used for loading credentials from a file, though environment variables are often preferred.

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.

import os from smartlingApiSdk.api import ProjectsApi USER_IDENTIFIER = os.environ.get('SMARTLING_USER_IDENTIFIER', '') USER_SECRET = os.environ.get('SMARTLING_USER_SECRET', '') ACCOUNT_ID = os.environ.get('SMARTLING_ACCOUNT_ID', '') if not all([USER_IDENTIFIER, USER_SECRET, ACCOUNT_ID]): print("Please set SMARTLING_USER_IDENTIFIER, SMARTLING_USER_SECRET, and SMARTLING_ACCOUNT_ID environment variables.") else: try: projects_api = ProjectsApi(USER_IDENTIFIER, USER_SECRET, ACCOUNT_ID) # List projects in the account projects_response = projects_api.listProjects() print("Successfully connected to Smartling and listed projects.") print(f"First 3 projects: {projects_response.data.items[:3]}") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingSmartling 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.
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.
affects: All versions (API dependent)
gotchaWhile 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.
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.
affects: All versions
gotchaWhen 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.
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.
affects: All versions
gotchaImporting Translation Memory eXchange (TMX) files into Smartling does not preserve plural information. Once imported, all plural form details for those translations are lost.
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.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'smartlingapisdk'
The 'smartlingapisdk' library is not installed in the current Python environment.
fix
pip install smartlingapisdk
AttributeError: 'SmartlingApiSdk' object has no attribute 'upload_file'
The user is attempting to call an API method directly on the main 'SmartlingApiSdk' object instead of on its specific client sub-object (e.g., 'files').
fix
Call the method on the correct client sub-object, for example, 'smartling_client.files.upload_file(...)' instead of 'smartling_client.upload_file(...)'.
smartlingapisdk.errors.SmartlingApiException: {"response":{"code":"VALIDATION_ERROR","errors":[{"message":"userIdentifier is a required field","field":"userIdentifier"}]}}
A required parameter such as 'user_identifier', 'user_secret', or 'project_id' was not provided or was empty during the initialization of the 'SmartlingApiSdk' client.
fix
Ensure 'user_identifier', 'user_secret', and 'project_id' are provided with valid values when initializing the 'SmartlingApiSdk' client: 'smartling_client = SmartlingApiSdk(user_identifier='YOUR_USER_ID', user_secret='YOUR_SECRET', project_id='YOUR_PROJECT_ID')'.
FileNotFoundError: [Errno 2] No such file or directory: 'path/to/your/file.txt'
The file specified for upload or download operations does not exist at the provided path.
fix
Verify that the file path is correct and that the file exists at the specified location.
TypeError: upload_file() missing 1 required positional argument: 'file_type'
A required argument for a method, such as 'file_type' for 'upload_file', was not provided.
fix
Ensure all required positional arguments are passed to the method. For 'upload_file', this includes 'file', 'file_type', 'locale_id', and 'file_uri'.
Upgrade
Version history
3.1.9latest on PyPI · released Sep 3, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources