Lokalise API v2 Python interface¶
Official Lokalise APIv2 Python interface that represents returned data as Python objects.
import lokalise
client = lokalise.Client('YOUR_API_TOKEN')
project = client.project('123.abc')
print(project.name)
client.upload_file(project.project_id, {
"data": 'ZnI6DQogIHRlc3Q6IHRyYW5zbGF0aW9u',
"filename": 'python_upload.yml',
"lang_iso": 'en'
})
translation_keys = client.keys(project.project_id, {"page": 2,
"limit": 3,
"disable_references": "1"})
translation_keys.items[0].key_name['web'] # => "sign_up"
You can also use OAuth 2 tokens and perform requests on the user’s behalf:
client = lokalise.OAuthClient('YOUR_OAUTH2_API_TOKEN')
project = client.project('123.abc')
Usage¶
- Getting started
- Branches endpoint
- Comments endpoint
- Contributors endpoint
- Files endpoint
- JWT endpoint
- Keys endpoint
- Languages endpoint
- Orders endpoint
- Payment cards endpoint
- Projects endpoint
- Queued processes endpoint
- Snapshots endpoint
- Screenshots endpoint
- Segments endpoint
- Tasks endpoint
- Teams endpoint
- Team users endpoint
- Team user groups endpoint
- Team user billing details endpoint
- Translations endpoint
- Translation providers endpoint
- Translation statuses endpoint
- Webhooks endpoint